httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1703248 - /httpd/httpd/trunk/server/connection.c
Date Tue, 15 Sep 2015 16:34:07 GMT
Author: ylavic
Date: Tue Sep 15 16:34:06 2015
New Revision: 1703248

URL: http://svn.apache.org/r1703248
Log:
core: Avoid a compiler warning when NO_LINGCLOSE is used (-Wunreachable-code).
Also, check c->aborted before apr_socket_shutdown() because it is set earlier,
and there is no point in calling shutdown() before close().

Modified:
    httpd/httpd/trunk/server/connection.c

Modified: httpd/httpd/trunk/server/connection.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/connection.c?rev=1703248&r1=1703247&r2=1703248&view=diff
==============================================================================
--- httpd/httpd/trunk/server/connection.c (original)
+++ httpd/httpd/trunk/server/connection.c Tue Sep 15 16:34:06 2015
@@ -116,12 +116,6 @@ AP_DECLARE(int) ap_start_lingering_close
         ap_update_child_status(c->sbh, SERVER_CLOSING, NULL);
     }
 
-#ifdef NO_LINGCLOSE
-    ap_flush_conn(c); /* just close it */
-    apr_socket_close(csd);
-    return 1;
-#endif
-
     /* Close the connection, being careful to send out whatever is still
      * in our buffers.  If possible, try to avoid a hard close until the
      * client has ACKed our FIN and/or has stopped sending us data.
@@ -130,21 +124,20 @@ AP_DECLARE(int) ap_start_lingering_close
     /* Send any leftover data to the client, but never try to again */
     ap_flush_conn(c);
 
-    if (c->aborted) {
-        apr_socket_close(csd);
-        return 1;
-    }
-
+#ifdef NO_LINGCLOSE
+    apr_socket_close(csd);
+    return 1;
+#else
     /* Shut down the socket for write, which will send a FIN
      * to the peer.
      */
-    if (apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS
-        || c->aborted) {
+    if (c->aborted
+            || apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS) {
         apr_socket_close(csd);
         return 1;
     }
-
     return 0;
+#endif
 }
 
 AP_DECLARE(void) ap_lingering_close(conn_rec *c)



Mime
View raw message