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 76
                  auto-probing procedure even if  OS allows\n\
77 77
 ";
78 78
 
79
+/* print compile-time constants */
80
+void print_ct_constants()
81
+{
82
+	printf("MAX_RECV_BUFFER_SIZE %d, MAX_LISTEN %d, MAX_URI_SIZE %d\n",
83
+		MAX_RECV_BUFFER_SIZE, MAX_LISTEN, MAX_URI_SIZE );
84
+}
79 85
 
80 86
 /* debuging function */
81 87
 /*
... ...
@@ -332,6 +344,7 @@ int main(int argc, char** argv)
332 332
 			case 'V':
333 333
 					printf("version: %s\n", version);
334 334
 					printf("flags: %s\n", flags );
335
+					print_ct_constants();
335 336
 					printf("%s\n",id);
336 337
 					exit(0);
337 338
 					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 88
 			else break;
89 89
         	} 
90 90
 		/* verify if change has taken effect */
91
+		/* Linux note -- otherwise I would never know that; funny thing: Linux
92
+		   doubles size for which we asked in setsockopt
93
+		*/
91 94
 		voptvallen=sizeof(voptval);
92 95
 		if (getsockopt( udp_sock, SOL_SOCKET, SO_RCVBUF, (void*) &voptval,
93 96
 		    &voptvallen) == -1 )