]> granicus.if.org Git - apache/commitdiff
core_filters: restore/disable TCP_NOPUSH option after non-blocking sendfile.
authorYann Ylavic <ylavic@apache.org>
Thu, 26 Mar 2015 08:15:32 +0000 (08:15 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 26 Mar 2015 08:15:32 +0000 (08:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1669289 13f79535-47bb-0310-9956-ffa450edef68

server/core_filters.c

index 1d7470b27f2e45bb7bd121a068a5d1f3afd50c56..a6c2bd666b24a631c7a1477a7c02307e7f49e4cf 100644 (file)
@@ -677,7 +677,6 @@ static apr_status_t send_brigade_nonblocking(apr_socket_t *s,
                 if (nvec > 0) {
                     (void)apr_socket_opt_set(s, APR_TCP_NOPUSH, 1);
                     rv = writev_nonblocking(s, vec, nvec, bb, bytes_written, c);
-                    nvec = 0;
                     if (rv != APR_SUCCESS) {
                         (void)apr_socket_opt_set(s, APR_TCP_NOPUSH, 0);
                         return rv;
@@ -686,6 +685,7 @@ static apr_status_t send_brigade_nonblocking(apr_socket_t *s,
                 rv = sendfile_nonblocking(s, bucket, bytes_written, c);
                 if (nvec > 0) {
                     (void)apr_socket_opt_set(s, APR_TCP_NOPUSH, 0);
+                    nvec = 0;
                 }
                 if (rv != APR_SUCCESS) {
                     return rv;