FreeBSD Bugzilla – Attachment 173385 Details for
Bug 211646
www/lighttpd: [mod_proxy,mod_scgi] shutdown remote only if local, [core] enforce wait for POLLWR after EINPROGRESS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
lighttpd.patch (text/plain), 5.22 KB, created by
Piotr Kubaj
on 2016-08-07 21:31:07 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Piotr Kubaj
Created:
2016-08-07 21:31:07 UTC
Size:
5.22 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 419776) >+++ Makefile (working copy) >@@ -3,6 +3,7 @@ > > PORTNAME?= lighttpd > PORTVERSION= 1.4.41 >+PORTREVISION= 1 > CATEGORIES?= www > MASTER_SITES?= http://download.lighttpd.net/lighttpd/releases-1.4.x/ > >Index: files/patch-src_mod__fastcgi.c >=================================================================== >--- files/patch-src_mod__fastcgi.c (nonexistent) >+++ files/patch-src_mod__fastcgi.c (working copy) >@@ -0,0 +1,12 @@ >+--- src/mod_fastcgi.c.orig 2016-08-07 17:19:10 UTC >++++ src/mod_fastcgi.c >+@@ -3257,7 +3257,8 @@ SUBREQUEST_FUNC(mod_fastcgi_handle_subre >+ } >+ } >+ >+- return (0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb)) >++ return ((0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb)) >++ && hctx->state != FCGI_STATE_CONNECT_DELAYED) >+ ? fcgi_send_request(srv, hctx) >+ : HANDLER_WAIT_FOR_EVENT; >+ } > >Property changes on: files/patch-src_mod__fastcgi.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: files/patch-src_mod__proxy.c >=================================================================== >--- files/patch-src_mod__proxy.c (nonexistent) >+++ files/patch-src_mod__proxy.c (working copy) >@@ -0,0 +1,34 @@ >+--- src/mod_proxy.c.orig 2016-07-31 12:42:39 UTC >++++ src/mod_proxy.c >+@@ -854,7 +854,20 @@ static handler_t proxy_write_request(ser >+ >+ if (hctx->wb->bytes_out == hctx->wb_reqlen) { >+ fdevent_event_clr(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT); >+- shutdown(hctx->fd, SHUT_WR);/* future: remove if HTTP/1.1 request */ >++ #if (defined(__APPLE__) && defined(__MACH__)) \ >++ || defined(__FreeBSD__) || defined(__NetBSD__) \ >++ || defined(__OpenBSD__) || defined(__DragonflyBSD__) >++ /*(*BSD stack on remote might signal POLLHUP and remote >++ * might treat as socket error instead of half-close)*/ >++ #else >++ /*(remote could be different machine running affected OS, >++ * so only issue shutdown for known local sockets)*/ >++ if ( '/' == host->host->ptr[0] >++ || buffer_is_equal_string(host->host, CONST_STR_LEN("127.0.0.1")) >++ || buffer_is_equal_string(host->host, CONST_STR_LEN("::1"))) { >++ shutdown(hctx->fd, SHUT_WR);/* future: remove if HTTP/1.1 request */ >++ } >++ #endif >+ proxy_set_state(srv, hctx, PROXY_STATE_READ); >+ } else { >+ off_t wblen = hctx->wb->bytes_in - hctx->wb->bytes_out; >+@@ -992,7 +1005,8 @@ SUBREQUEST_FUNC(mod_proxy_handle_subrequ >+ } >+ } >+ >+- return (0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb)) >++ return ((0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb)) >++ && hctx->state != PROXY_STATE_CONNECT) >+ ? proxy_send_request(srv, hctx) >+ : HANDLER_WAIT_FOR_EVENT; >+ } > >Property changes on: files/patch-src_mod__proxy.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: files/patch-src_mod__scgi.c >=================================================================== >--- files/patch-src_mod__scgi.c (nonexistent) >+++ files/patch-src_mod__scgi.c (working copy) >@@ -0,0 +1,34 @@ >+--- src/mod_scgi.c.orig 2016-08-07 12:39:31 UTC >++++ src/mod_scgi.c >+@@ -2438,7 +2438,20 @@ static handler_t scgi_write_request(serv >+ >+ if (hctx->wb->bytes_out == hctx->wb_reqlen) { >+ fdevent_event_clr(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT); >+- shutdown(hctx->fd, SHUT_WR); >++ #if (defined(__APPLE__) && defined(__MACH__)) \ >++ || defined(__FreeBSD__) || defined(__NetBSD__) \ >++ || defined(__OpenBSD__) || defined(__DragonflyBSD__) >++ /*(*BSD stack on remote might signal POLLHUP and remote >++ * might treat as socket error instead of half-close)*/ >++ #else >++ /*(remote could be different machine running affected OS, >++ * so only issue shutdown for known local sockets)*/ >++ if ( '/' == host->host->ptr[0] >++ || buffer_is_equal_string(host->host, CONST_STR_LEN("127.0.0.1")) >++ || buffer_is_equal_string(host->host, CONST_STR_LEN("::1"))) { >++ shutdown(hctx->fd, SHUT_WR); >++ } >++ #endif >+ scgi_set_state(srv, hctx, FCGI_STATE_READ); >+ } else { >+ off_t wblen = hctx->wb->bytes_in - hctx->wb->bytes_out; >+@@ -2585,7 +2598,8 @@ SUBREQUEST_FUNC(mod_scgi_handle_subreque >+ } >+ } >+ >+- return (0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb)) >++ return ((0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb)) >++ && hctx->state != FCGI_STATE_CONNECT) >+ ? scgi_send_request(srv, hctx) >+ : HANDLER_WAIT_FOR_EVENT; >+ } > >Property changes on: files/patch-src_mod__scgi.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
pkubaj
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 211646
: 173385