From owner-svn-ports-all@freebsd.org Wed Aug 17 19:48:30 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59318BBDEA2; Wed, 17 Aug 2016 19:48:30 +0000 (UTC) (envelope-from arved@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 184AE1B79; Wed, 17 Aug 2016 19:48:30 +0000 (UTC) (envelope-from arved@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJmTam087865; Wed, 17 Aug 2016 19:48:29 GMT (envelope-from arved@FreeBSD.org) Received: (from arved@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJmSOb087860; Wed, 17 Aug 2016 19:48:28 GMT (envelope-from arved@FreeBSD.org) Message-Id: <201608171948.u7HJmSOb087860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arved set sender to arved@FreeBSD.org using -f From: Tilman Keskinoz Date: Wed, 17 Aug 2016 19:48:28 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r420370 - in head/www/lighttpd: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2016 19:48:30 -0000 Author: arved Date: Wed Aug 17 19:48:28 2016 New Revision: 420370 URL: https://svnweb.freebsd.org/changeset/ports/420370 Log: Fix two regressions: 1) mod_proxy, mod_scgi may trigger POLLHUP on *BSD,Darwin: https://redmine.lighttpd.net/issues/2743 2) writev failed: Socket is not connected (fastcgi,scgi,proxy): https://redmine.lighttpd.net/issues/2744 PR: 211646 Submitted by: maintainer Added: head/www/lighttpd/files/patch-src_mod__fastcgi.c (contents, props changed) head/www/lighttpd/files/patch-src_mod__proxy.c (contents, props changed) head/www/lighttpd/files/patch-src_mod__scgi.c (contents, props changed) Modified: head/www/lighttpd/Makefile Modified: head/www/lighttpd/Makefile ============================================================================== --- head/www/lighttpd/Makefile Wed Aug 17 19:26:59 2016 (r420369) +++ head/www/lighttpd/Makefile Wed Aug 17 19:48:28 2016 (r420370) @@ -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/ Added: head/www/lighttpd/files/patch-src_mod__fastcgi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/lighttpd/files/patch-src_mod__fastcgi.c Wed Aug 17 19:48:28 2016 (r420370) @@ -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; + } Added: head/www/lighttpd/files/patch-src_mod__proxy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/lighttpd/files/patch-src_mod__proxy.c Wed Aug 17 19:48:28 2016 (r420370) @@ -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; + } Added: head/www/lighttpd/files/patch-src_mod__scgi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/lighttpd/files/patch-src_mod__scgi.c Wed Aug 17 19:48:28 2016 (r420370) @@ -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; + }