[asterisk-commits] mnicholson: branch 1.6.2 r273271 - in /branches/1.6.2: ./ main/manager.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jun 30 13:50:16 CDT 2010
Author: mnicholson
Date: Wed Jun 30 13:50:12 2010
New Revision: 273271
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=273271
Log:
Merged revisions 273270 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r273270 | mnicholson | 2010-06-30 13:48:21 -0500 (Wed, 30 Jun 2010) | 2 lines
Set TCP_NODELAY on manager TCP sockets to prevent delays on outgoing packets. This regression was introduced in r48338.
........
Modified:
branches/1.6.2/ (props changed)
branches/1.6.2/main/manager.c
Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.2/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/manager.c?view=diff&rev=273271&r1=273270&r2=273271
==============================================================================
--- branches/1.6.2/main/manager.c (original)
+++ branches/1.6.2/main/manager.c Wed Jun 30 13:50:12 2010
@@ -3210,9 +3210,24 @@
struct mansession s = {.session = NULL, };
int flags;
int res;
+ struct protoent *p;
if (session == NULL)
goto done;
+
+ /* XXX here we set TCP_NODELAY on the socket to disable Nagle's
+ * algorithm. A better solution might be to buffer outgoing messages
+ * until they are complete then write them to the socket in one burst
+ * rather than sending them in bits and pieces. */
+ p = getprotobyname("tcp");
+ if (p) {
+ int arg = 1;
+ if( setsockopt(ser->fd, p->p_proto, TCP_NODELAY, (char *)&arg, sizeof(arg) ) < 0 ) {
+ ast_log(LOG_WARNING, "Failed to set manager tcp connection to TCP_NODELAY mode: %s\nSome manager actions may be slow to respond.\n", strerror(errno));
+ }
+ } else {
+ ast_log(LOG_WARNING, "Failed to set manager tcp connection to TCP_NODELAY, getprotobyname(\"tcp\") failed\nSome manager actions may be slow to respond.\n");
+ }
session->writetimeout = 100;
session->waiting_thread = AST_PTHREADT_NULL;
More information about the asterisk-commits
mailing list