myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-510


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-510-gb5cf0bb
Date: Mon, 08 Aug 2011 14:01:19 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  b5cf0bb7f8f309b80c94c0a94acb2631cc024dcc (commit)
       via  0464a1c4588eb8d8f277d8f4e5cc9d8620c76ab6 (commit)
      from  c7cd463b7970e3a428e665e81d888157e111288e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit b5cf0bb7f8f309b80c94c0a94acb2631cc024dcc
Author: Giuseppe Scrivano <address@hidden>
Date:   Mon Aug 8 16:01:13 2011 +0200

    Allow to disable the TCP Nagle algorithm.

diff --git a/myserver/NEWS b/myserver/NEWS
index 05be47d..f2c8ea8 100644
--- a/myserver/NEWS
+++ b/myserver/NEWS
@@ -2,6 +2,10 @@ GNU myserver NEWS                                    -*- 
outline -*-
 
 * Noteworthy changes in release X.Y.Z
 
+** New features
+
+   Allow to disable the TCP Nagle algorithm.
+
 * Noteworthy changes in release 0.11
 
 ** Bug fixes
diff --git a/myserver/documentation/virtual_hosts.texi 
b/myserver/documentation/virtual_hosts.texi
index cd0afff..135948f 100644
--- a/myserver/documentation/virtual_hosts.texi
+++ b/myserver/documentation/virtual_hosts.texi
@@ -163,3 +163,15 @@ For example, the HTTP TRACE command can be disabled using:
 @example
 <DEFINE name="http.trace.allow" value="NO" />
 @end example
+
address@hidden Disable TCP Nagle
+It is possible to disable the TCP Nagle algorithm by specifying this
+value in the virtual host configuration file (or globally):
+
address@hidden
+<DEFINE name="connection.tcp_nodelay" value="YES" />
address@hidden example
+
+It might be a good performance enhancement to disable this algorithm on
+very fast networks, more TCP packets may be sent with the advantage of
+a better latency.
diff --git a/myserver/src/protocol/http/http.cpp 
b/myserver/src/protocol/http/http.cpp
index 48d4fe1..6228a83 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -51,6 +51,8 @@
 #include <ostream>
 #include <errno.h>
 
+#include <netinet/tcp.h>
+
 using namespace std;
 
 int HttpProtocol::loadProtocol ()
@@ -1006,6 +1008,16 @@ int Http::controlConnection (ConnectionPtr a, char*, 
char*, u_long, u_long,
               return ClientsThread::DELETE_CONNECTION;
             }
 
+          if (! strcmp (td->securityToken.getData ("connection.tcp_nodelay",
+                                                   MYSERVER_VHOST_CONF |
+                                                   MYSERVER_SERVER_CONF, "NO"),
+                        "YES"))
+            {
+              int flag = 1;
+              td->connection->socket->setsockopt (IPPROTO_TCP, TCP_NODELAY,
+                                                  (char *) &flag, sizeof(int));
+            }
+
           if (td->request.uri.length () > 2 && td->request.uri[1] == '~')
             {
               string documentRoot;



commit 0464a1c4588eb8d8f277d8f4e5cc9d8620c76ab6
Author: Giuseppe Scrivano <address@hidden>
Date:   Mon Aug 8 15:56:50 2011 +0200

    Use safer gnulib replacements for `freeaddrinfo' and `getnameinfo'.

diff --git a/myserver/src/base/socket/socket.cpp 
b/myserver/src/base/socket/socket.cpp
index fef320e..aed247e 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -275,16 +275,16 @@ void Socket::getLocalIPsList (string &out)
           if ( pCurrentSockAddr == NULL )
             continue;
 
-          checked::checkError (getnameinfo (pCrtHostInfo->ai_addr,
-                                            sizeof (sockaddr_storage), straddr,
-                                            NI_MAXHOST, NULL, 0,
-                                            NI_NUMERICHOST));
+          checked::checkError (gnulib::getnameinfo (pCrtHostInfo->ai_addr,
+                                                    sizeof (sockaddr_storage),
+                                                    straddr, NI_MAXHOST, NULL,
+                                                    0, NI_NUMERICHOST));
 
           stream << ( !stream.str ().empty () ? ", " : "" ) << straddr;
         }
 
       out.assign (stream.str ());
-      freeaddrinfo (pHostInfo);
+      gnulib::freeaddrinfo (pHostInfo);
     }
 #else
   MYSERVER_HOSTENT *localhe;
@@ -478,8 +478,8 @@ int Socket::connect (const char* host, u_short port)
           break;
         }
     }
-  freeaddrinfo (pHostInfo);
-  if ( !bSocketConnected )
+  gnulib::freeaddrinfo (pHostInfo);
+  if (! bSocketConnected)
     return -1;
 #else
   MYSERVER_HOSTENT *hp = Socket::gethostbyname (host);

-----------------------------------------------------------------------

Summary of changes:
 myserver/NEWS                             |    4 ++++
 myserver/documentation/virtual_hosts.texi |   12 ++++++++++++
 myserver/src/base/socket/socket.cpp       |   14 +++++++-------
 myserver/src/protocol/http/http.cpp       |   12 ++++++++++++
 4 files changed, 35 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]