Browse code

added comments and more noisy -V

Jiri Kuthan authored on 14/11/2001 05:49:51
Showing 2 changed files
... ...
@@ -47,6 +47,12 @@ static char flags[]="NOCR:"
47 47
 #else
48 48
 "Off"
49 49
 #endif
50
+", STATS:"
51
+#ifdef STATS
52
+"On"
53
+#else
54
+"Off"
55
+#endif
50 56
 ;
51 57
 
52 58
 static char help_msg[]= "\
... ...
@@ -76,6 +82,12 @@ Options:\n\
76 82
                  auto-probing procedure even if  OS allows\n\
77 83
 ";
78 84
 
85
+/* print compile-time constants */
86
+void print_ct_constants()
87
+{
88
+	printf("MAX_RECV_BUFFER_SIZE %d, MAX_LISTEN %d, MAX_URI_SIZE %d\n",
89
+		MAX_RECV_BUFFER_SIZE, MAX_LISTEN, MAX_URI_SIZE );
90
+}
79 91
 
80 92
 /* debuging function */
81 93
 /*
... ...
@@ -332,6 +344,7 @@ int main(int argc, char** argv)
332 344
 			case 'V':
333 345
 					printf("version: %s\n", version);
334 346
 					printf("flags: %s\n", flags );
347
+					print_ct_constants();
335 348
 					printf("%s\n",id);
336 349
 					exit(0);
337 350
 					break;
... ...
@@ -79,6 +79,7 @@ int udp_init(unsigned long ip, unsigned short port)
79 79
         	if (setsockopt( udp_sock, SOL_SOCKET, SO_RCVBUF,
80 80
                              (void*)&optval, sizeof(optval)) ==-1)
81 81
         	{
82
+			/* Solaris returns -1 if asked size too big; Linux ignores */
82 83
 			LOG(L_DBG, "DEBUG: udp_init: SOL_SOCKET failed for %d, phase %d: %s\n",
83 84
 			    optval,  phase, strerror(errno) );
84 85
 			/* if setting buffer size failed and still in the aggressive
... ...
@@ -88,6 +89,9 @@ int udp_init(unsigned long ip, unsigned short port)
88 89
 			else break;
89 90
         	} 
90 91
 		/* verify if change has taken effect */
92
+		/* Linux note -- otherwise I would never know that; funny thing: Linux
93
+		   doubles size for which we asked in setsockopt
94
+		*/
91 95
 		voptvallen=sizeof(voptval);
92 96
 		if (getsockopt( udp_sock, SOL_SOCKET, SO_RCVBUF, (void*) &voptval,
93 97
 		    &voptvallen) == -1 )