[Asterisk-cvs] asterisk rtp.c,1.80,1.81

markster at lists.digium.com markster at lists.digium.com
Mon Jul 19 14:23:32 CDT 2004


Update of /usr/cvsroot/asterisk
In directory localhost.localdomain:/tmp/cvs-serv12318

Modified Files:
	rtp.c 
Log Message:
Don't copmile in the no-RTP checksum stuff for non-Linux (bug #2089)


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- rtp.c	17 Jul 2004 21:08:12 -0000	1.80
+++ rtp.c	19 Jul 2004 18:09:33 -0000	1.81
@@ -52,7 +52,9 @@
 
 static int rtpstart = 0;
 static int rtpend = 0;
+#ifdef SO_NO_CHECK
 static int checksums = 1;
+#endif
 
 /* The value of each payload format mapping: */
 struct rtpPayloadType {
@@ -766,9 +768,11 @@
 	if (s > -1) {
 		flags = fcntl(s, F_GETFL);
 		fcntl(s, F_SETFL, flags | O_NONBLOCK);
+#ifdef SO_NO_CHECK
 		if (checksums) {
 			setsockopt(s, SOL_SOCKET, SO_NO_CHECK, &checksums, sizeof(checksums));
 		}
+#endif
 	}
 	return s;
 }
@@ -1494,7 +1498,9 @@
 	char *s;
 	rtpstart = 5000;
 	rtpend = 31000;
+#ifdef SO_NO_CHECK
 	checksums = 1;
+#endif
 	cfg = ast_load("rtp.conf");
 	if (cfg) {
 		if ((s = ast_variable_retrieve(cfg, "general", "rtpstart"))) {
@@ -1512,10 +1518,15 @@
 				rtpend = 65535;
 		}
 		if ((s = ast_variable_retrieve(cfg, "general", "rtpchecksums"))) {
+#ifdef SO_NO_CHECK
 			if (ast_true(s))
 				checksums = 1;
 			else
 				checksums = 0;
+#else
+			if (ast_true(s))
+				ast_log(LOG_WARNING, "Disabling RTP checksums is not supported on this operating system!\n");
+#endif
 		}
 		ast_destroy(cfg);
 	}




More information about the svn-commits mailing list