Browse code

Fixed bugs with MF at command line.

Nils Ohlmeier authored on 22/05/2002 20:39:57
Showing 1 changed files
... ...
@@ -425,7 +425,7 @@ 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
 	}else if (trace){
428
-		if (maxforw)
428
+		if (maxforw!=-1)
429 429
 			nretries=maxforw;
430 430
 		else
431 431
 			nretries=255;
... ...
@@ -457,7 +457,7 @@ void shoot(char *buff, long address, int lport, int rport, int maxforw, int trac
457 457
 			exit(2);
458 458
 		}
459 459
 
460
-		for (i = 0; i < nretries; i++)
460
+		for (i = 0; i <= nretries; i++)
461 461
 		{
462 462
 			if (trace) {
463 463
 				set_maxforw(buff, i);
... ...
@@ -599,7 +599,7 @@ void shoot(char *buff, long address, int lport, int rport, int maxforw, int trac
599 599
 				else if (trace) {
600 600
 					/* in trace we only look for 483, anything else is 
601 601
 					   treated as the final reply*/
602
-					printf("%i: ", i+1);
602
+					printf("%i: ", i);
603 603
 					if (regexec((regex_t*)regexp, reply, 0, 0, 0)==0) {
604 604
 						printf("* (483) \n");
605 605
 #ifdef DEBUG
... ...
@@ -613,7 +613,7 @@ void shoot(char *buff, long address, int lport, int rport, int maxforw, int trac
613 613
 					else {
614 614
 						crlf=strchr(reply,'\n');
615 615
 						sprintf(crlf, "\0");
616
-						printf("%s\n", reply);
616
+//						printf("%s\n", reply);
617 617
 						crlf++;
618 618
 						contact=strstr(crlf, "Contact");
619 619
 						if (contact){
... ...
@@ -622,7 +622,7 @@ void shoot(char *buff, long address, int lport, int rport, int maxforw, int trac
622 622
 						printf("   %s\n", contact);
623 623
 						}
624 624
 						else {
625
-							printf("received reply without contact:\n%s\n"
625
+							printf("received reply without contact: %s\n"
626 626
 								, reply);
627 627
 						}
628 628
 						exit(0);
... ...
@@ -832,6 +832,7 @@ int main(int argc, char *argv[])
832 832
 					puts("error: non-numerical number of max-forwards");
833 833
 					exit(2);
834 834
 				}
835
+				break;
835 836
 			case 'r':
836 837
 				rport=atoi(optarg);
837 838
 				if (!rport) {