Browse code

CSeq is increasing in traceroute modus now.

Nils Ohlmeier authored on 22/05/2002 19:01:07
Showing 1 changed files
... ...
@@ -425,19 +425,18 @@ void shoot(char *buff, long address, int lport, int rport, int maxforw, int trac
425 425
 		create_msg(buff, REQ_REG, lport);
426 426
 		retryAfter = 5000;
427 427
 	}
428
-	if (trace & !fbool)
429
-		create_msg(buff, REQ_OPT, lport);
430
-	if(maxforw!=-1)
431
-		set_maxforw(buff, maxforw);
432
-	if(vbool)
433
-		add_via(buff, lport);
434
-	
435
-	if (trace) {
428
+	if (trace){
436 429
 		if (maxforw)
437 430
 			nretries=maxforw;
438 431
 		else
439 432
 			nretries=255;
433
+		namebeg=1;
434
+		create_msg(buff, REQ_OPT, lport);
440 435
 	}
436
+	if(maxforw!=-1)
437
+		set_maxforw(buff, maxforw);
438
+	if(vbool)
439
+		add_via(buff, lport);
441 440
 
442 441
 	/* if we got a redirect this loop ensures sending to the 
443 442
 	   redirected server*/
... ...
@@ -605,6 +604,8 @@ void shoot(char *buff, long address, int lport, int rport, int maxforw, int trac
605 604
 #ifdef DEBUG
606 605
 						printf("%s\n", reply);
607 606
 #endif
607
+						namebeg++;
608
+						create_msg(buff, REQ_OPT, lport);
608 609
 						continue;
609 610
 					}
610 611
 					else {
... ...
@@ -902,17 +903,16 @@ int main(int argc, char *argv[])
902 903
 			exit(2);
903 904
 		}
904 905
 		if (fbool) {
905
-			if (strncmp(buff, "OPTIONS", 7)){
906
+/*			if (strncmp(buff, "OPTIONS", 7)){
906 907
 				printf("error: tracerouting only possible with an OPTIONS request.\n"
907 908
 					"       Give another request file or convert it to an OPTIONS request.\n");
908 909
 				exit(2);
909
-			}
910
+			} */
911
+			printf("warning: file will be ignored for tracing.");
910 912
 		}
911
-		else {
912
-			if (!username) {
913
-				printf("error: for trace modus without a file the sip:uir have to contain a username\n");
914
-				exit(2);
915
-			}
913
+		if (!username) {
914
+			printf("error: for trace modus without a file the sip:uir have to contain a username\n");
915
+			exit(2);
916 916
 		}
917 917
 		if (!vbool){
918 918
 			printf("warning: Via-Line is needed for tracing. Ignoring -i\n");
... ...
@@ -936,9 +936,10 @@ int main(int argc, char *argv[])
936 936
 		if (namebeg==-1)
937 937
 			namebeg=0;
938 938
 	}
939
-	else if (!fbool & !sbool)
939
+	else if (!fbool & !sbool) {
940 940
 		printf("error: you have to give the file to send and the sip:uri at least.\n");
941 941
 		print_help();
942
+	}
942 943
 	/* here we go...*/
943 944
 	shoot(buff, address, lport, rport, maxforw, tbool, vbool, fbool, ubool, dbool);
944 945