serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1712048 - /serf/trunk/test/MockHTTPinC/MockHTTP_server.c
Date Mon, 02 Nov 2015 15:33:15 GMT
Author: rhuijben
Date: Mon Nov  2 15:33:15 2015
New Revision: 1712048

URL: http://svn.apache.org/viewvc?rev=1712048&view=rev
Log:
* test/MockHTTPinC/MockHTTP_server.c
  (cleanupServer): Suppress another problem valgrind found in our
    test suite, by removing a double close socket. Cleanup handlers
    should only cleanup their own junk, not that already cleaned
    up by others living in the same pool.

Modified:
    serf/trunk/test/MockHTTPinC/MockHTTP_server.c

Modified: serf/trunk/test/MockHTTPinC/MockHTTP_server.c
URL: http://svn.apache.org/viewvc/serf/trunk/test/MockHTTPinC/MockHTTP_server.c?rev=1712048&r1=1712047&r2=1712048&view=diff
==============================================================================
--- serf/trunk/test/MockHTTPinC/MockHTTP_server.c (original)
+++ serf/trunk/test/MockHTTPinC/MockHTTP_server.c Mon Nov  2 15:33:15 2015
@@ -157,10 +157,14 @@ static apr_status_t cleanupServer(void *
         apr_pollset_destroy(ctx->pollset);
         ctx->pollset = NULL;
     }
-    if (ctx->skt) {
-        status = apr_socket_close(ctx->skt);
-        ctx->skt = NULL;
-    }
+    /* We used to explicitly close the socket here, but APR already sets
+       up a cleanup handler for that. As our cleanup is registered before
+       that of the apr socket, ours will last, which the triggers a close(-1)
+       from here on the unix implementations, as the initial close sets
+       the socket to -1.
+
+       On Windows APR checks before closing again */
+    ctx->skt = NULL;
 
     return status;
 }



Mime
View raw message