gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r28011 - in libmicrohttpd: . src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r28011 - in libmicrohttpd: . src/microhttpd
Date: Sun, 14 Jul 2013 19:59:09 +0200

Author: grothoff
Date: 2013-07-14 19:59:09 +0200 (Sun, 14 Jul 2013)
New Revision: 28011

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/microhttpd/connection.c
   libmicrohttpd/src/microhttpd/daemon.c
Log:
eliminate shutdown calls that are not required, strictly speaking

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2013-07-14 17:51:18 UTC (rev 28010)
+++ libmicrohttpd/ChangeLog     2013-07-14 17:59:09 UTC (rev 28011)
@@ -1,3 +1,9 @@
+Sun Jul 14 19:57:56 CEST 2013
+       Removing 'shutdown' calls that happen just before close or
+       that are for read-only and for a client that has already
+       stopped sending anyway (thus reducing number of system calls
+       slightly). -CG
+
 Sun Jul 14 19:37:37 CEST 2013
        Name MHD worker threads on glibc >= 2.12. -,L4X[o](B
 

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2013-07-14 17:51:18 UTC (rev 
28010)
+++ libmicrohttpd/src/microhttpd/connection.c   2013-07-14 17:59:09 UTC (rev 
28011)
@@ -1504,7 +1504,9 @@
     {
       /* other side closed connection */
       connection->read_closed = MHD_YES;
-      SHUTDOWN (connection->socket_fd, SHUT_RD);
+      /* shutdown is not required here, as the other side already
+        knows; so flagging this internally should suffice */
+      /* SHUTDOWN (connection->socket_fd, SHUT_RD); */
       return MHD_YES;
     }
   connection->read_buffer_offset += bytes_read;

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2013-07-14 17:51:18 UTC (rev 
28010)
+++ libmicrohttpd/src/microhttpd/daemon.c       2013-07-14 17:59:09 UTC (rev 
28011)
@@ -1002,7 +1002,6 @@
                                     client_socket,
                                     addr, addrlen);
       /* all pools are at their connection limit, must refuse */
-      SHUTDOWN (client_socket, SHUT_RDWR);
       if (0 != CLOSE (client_socket))
        MHD_PANIC ("close failed\n");
       return MHD_NO;      
@@ -1018,7 +1017,6 @@
                client_socket,
                FD_SETSIZE);
 #endif
-      SHUTDOWN (client_socket, SHUT_RDWR);
       if (0 != CLOSE (client_socket))
        MHD_PANIC ("close failed\n");
       return MHD_NO;
@@ -1039,7 +1037,6 @@
       MHD_DLOG (daemon,
                 "Server reached connection limit (closing inbound 
connection)\n");
 #endif
-      SHUTDOWN (client_socket, SHUT_RDWR);
       if (0 != CLOSE (client_socket))
        MHD_PANIC ("close failed\n");
       return MHD_NO;
@@ -1055,7 +1052,6 @@
       MHD_DLOG (daemon, "Connection rejected, closing connection\n");
 #endif
 #endif
-      SHUTDOWN (client_socket, SHUT_RDWR);
       if (0 != CLOSE (client_socket))
        MHD_PANIC ("close failed\n");
       MHD_ip_limit_del (daemon, addr, addrlen);
@@ -1079,7 +1075,6 @@
                "Error allocating memory: %s\n", 
                STRERROR (errno));
 #endif
-      SHUTDOWN (client_socket, SHUT_RDWR);
       if (0 != CLOSE (client_socket))
        MHD_PANIC ("close failed\n");
       MHD_ip_limit_del (daemon, addr, addrlen);
@@ -1094,7 +1089,6 @@
                "Error allocating memory: %s\n", 
                STRERROR (errno));
 #endif
-      SHUTDOWN (client_socket, SHUT_RDWR);
       if (0 != CLOSE (client_socket))
        MHD_PANIC ("close failed\n");
       MHD_ip_limit_del (daemon, addr, addrlen);
@@ -1110,7 +1104,6 @@
                "Error allocating memory: %s\n", 
                STRERROR (errno));
 #endif
-      SHUTDOWN (client_socket, SHUT_RDWR);
       if (0 != CLOSE (client_socket))
        MHD_PANIC ("close failed\n");
       MHD_ip_limit_del (daemon, addr, addrlen);
@@ -1184,7 +1177,6 @@
                     "Failed to setup TLS credentials: unknown credential type 
%d\n",
                     daemon->cred_type);
 #endif
-          SHUTDOWN (client_socket, SHUT_RDWR);
           if (0 != CLOSE (client_socket))
            MHD_PANIC ("close failed\n");
           MHD_ip_limit_del (daemon, addr, addrlen);
@@ -1261,7 +1253,6 @@
   return MHD_YES;  
 #if HTTPS_SUPPORT || EPOLL_SUPPORT
  cleanup:
-  SHUTDOWN (client_socket, SHUT_RDWR);
   if (0 != CLOSE (client_socket))
     MHD_PANIC ("close failed\n");
   MHD_ip_limit_del (daemon, addr, addrlen);
@@ -1330,7 +1321,6 @@
 #endif
       if (-1 != s)
         {
-          SHUTDOWN (s, SHUT_RDWR);
           if (0 != CLOSE (s))
            MHD_PANIC ("close failed\n");
           /* just in case */




reply via email to

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