Browse code

- modified udp_rcv_loop to continue on EAGAIN/EWOULDBLOCK - fixed type in usrloc.c

Andrei Pelinescu-Onciul authored on 30/04/2002 16:58:44
Showing 3 changed files
... ...
@@ -8,7 +8,7 @@
8 8
 VERSION = 0
9 9
 PATCHLEVEL = 8
10 10
 SUBLEVEL = 7
11
-EXTRAVERSION = -8-sipit2
11
+EXTRAVERSION = -9
12 12
 
13 13
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
14 14
 OS = $(shell uname -s)
... ...
@@ -632,14 +632,15 @@ int parse_headers(struct sip_msg* msg, int flags)
632 632
 				if (msg->route==0) msg->route=hf;
633 633
 				msg->parsed_flag|=HDR_ROUTE;
634 634
 				break;
635
-		        case HDR_RECORDROUTE:
635
+			case HDR_RECORDROUTE:
636 636
 				if (msg->record_route==0) msg->record_route = hf;
637 637
 				msg->parsed_flag|=HDR_RECORDROUTE;
638 638
 				break;
639
-		        case HDR_VIA:
639
+			case HDR_VIA:
640 640
 				msg->parsed_flag|=HDR_VIA;
641
-				DBG("parse_headers: Via1 found, flags=%d\n", flags);
641
+				DBG("parse_headers: Via found, flags=%d\n", flags);
642 642
 				if (msg->via1==0) {
643
+					DBG("parse_headers: this is the first via\n");
643 644
 					msg->h_via1=hf;
644 645
 					msg->via1=hf->parsed;
645 646
 					if (msg->via1->next){
... ...
@@ -650,7 +651,7 @@ int parse_headers(struct sip_msg* msg, int flags)
650 651
 					msg->h_via2=hf;
651 652
 					msg->via2=hf->parsed;
652 653
 					msg->parsed_flag|=HDR_VIA2;
653
-				DBG("parse_headers: Via2 found, flags=%d\n", flags);
654
+					DBG("parse_headers: this is the second via\n");
654 655
 				}
655 656
 				break;
656 657
 			default:
... ...
@@ -185,9 +185,10 @@ int udp_rcv_loop()
185 185
 		len=recvfrom(udp_sock, buf, BUF_SIZE, 0, (struct sockaddr*)from,
186 186
 						&fromlen);
187 187
 		if (len==-1){
188
-			LOG(L_ERR, "ERROR: udp_rcv_loop:recvfrom: %s\n",
189
-						strerror(errno));
190
-			if (errno==EINTR)	continue; /* goto skip;*/
188
+			LOG(L_ERR, "ERROR: udp_rcv_loop:recvfrom:[%d] %s\n",
189
+						errno, strerror(errno));
190
+			if ((errno==EINTR)||(errno==EAGAIN)||(errno==EWOULDBLOCK))
191
+				continue; /* goto skip;*/
191 192
 			else goto error;
192 193
 		}
193 194
 		/*debugging, make print* msg work */