View | Details | Raw Unified | Return to bug 211646
Collapse All | Expand All

(-)Makefile (+1 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME?=	lighttpd
4
PORTNAME?=	lighttpd
5
PORTVERSION=	1.4.41
5
PORTVERSION=	1.4.41
6
PORTREVISION=	1
6
CATEGORIES?=	www
7
CATEGORIES?=	www
7
MASTER_SITES?=	http://download.lighttpd.net/lighttpd/releases-1.4.x/
8
MASTER_SITES?=	http://download.lighttpd.net/lighttpd/releases-1.4.x/
8
9
(-)files/patch-src_mod__fastcgi.c (+12 lines)
Line 0 Link Here
1
--- src/mod_fastcgi.c.orig	2016-08-07 17:19:10 UTC
2
+++ src/mod_fastcgi.c
3
@@ -3257,7 +3257,8 @@ SUBREQUEST_FUNC(mod_fastcgi_handle_subre
4
 		}
5
 	}
6
 
7
-	return (0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb))
8
+	return ((0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb))
9
+		&& hctx->state != FCGI_STATE_CONNECT_DELAYED)
10
 	  ? fcgi_send_request(srv, hctx)
11
 	  : HANDLER_WAIT_FOR_EVENT;
12
 }
(-)files/patch-src_mod__proxy.c (+34 lines)
Line 0 Link Here
1
--- src/mod_proxy.c.orig	2016-07-31 12:42:39 UTC
2
+++ src/mod_proxy.c
3
@@ -854,7 +854,20 @@ static handler_t proxy_write_request(ser
4
 
5
 		if (hctx->wb->bytes_out == hctx->wb_reqlen) {
6
 			fdevent_event_clr(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
7
-			shutdown(hctx->fd, SHUT_WR);/* future: remove if HTTP/1.1 request */
8
+		      #if (defined(__APPLE__) && defined(__MACH__)) \
9
+			|| defined(__FreeBSD__) || defined(__NetBSD__) \
10
+			|| defined(__OpenBSD__) || defined(__DragonflyBSD__)
11
+			/*(*BSD stack on remote might signal POLLHUP and remote
12
+			 * might treat as socket error instead of half-close)*/
13
+		      #else
14
+			/*(remote could be different machine running affected OS,
15
+			 * so only issue shutdown for known local sockets)*/
16
+			if ( '/' == host->host->ptr[0]
17
+			    || buffer_is_equal_string(host->host, CONST_STR_LEN("127.0.0.1"))
18
+			    || buffer_is_equal_string(host->host, CONST_STR_LEN("::1"))) {
19
+				shutdown(hctx->fd, SHUT_WR);/* future: remove if HTTP/1.1 request */
20
+			}
21
+		      #endif
22
 			proxy_set_state(srv, hctx, PROXY_STATE_READ);
23
 		} else {
24
 			off_t wblen = hctx->wb->bytes_in - hctx->wb->bytes_out;
25
@@ -992,7 +1005,8 @@ SUBREQUEST_FUNC(mod_proxy_handle_subrequ
26
 		}
27
 	}
28
 
29
-	return (0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb))
30
+	return ((0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb))
31
+		&& hctx->state != PROXY_STATE_CONNECT)
32
 	  ? proxy_send_request(srv, hctx)
33
 	  : HANDLER_WAIT_FOR_EVENT;
34
 }
(-)files/patch-src_mod__scgi.c (+34 lines)
Line 0 Link Here
1
--- src/mod_scgi.c.orig	2016-08-07 12:39:31 UTC
2
+++ src/mod_scgi.c
3
@@ -2438,7 +2438,20 @@ static handler_t scgi_write_request(serv
4
 
5
 		if (hctx->wb->bytes_out == hctx->wb_reqlen) {
6
 			fdevent_event_clr(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
7
-			shutdown(hctx->fd, SHUT_WR);
8
+		      #if (defined(__APPLE__) && defined(__MACH__)) \
9
+			|| defined(__FreeBSD__) || defined(__NetBSD__) \
10
+			|| defined(__OpenBSD__) || defined(__DragonflyBSD__)
11
+			/*(*BSD stack on remote might signal POLLHUP and remote
12
+			 * might treat as socket error instead of half-close)*/
13
+		      #else
14
+			/*(remote could be different machine running affected OS,
15
+			 * so only issue shutdown for known local sockets)*/
16
+			if ( '/' == host->host->ptr[0]
17
+			    || buffer_is_equal_string(host->host, CONST_STR_LEN("127.0.0.1"))
18
+			    || buffer_is_equal_string(host->host, CONST_STR_LEN("::1"))) {
19
+				shutdown(hctx->fd, SHUT_WR);
20
+			}
21
+		      #endif
22
 			scgi_set_state(srv, hctx, FCGI_STATE_READ);
23
 		} else {
24
 			off_t wblen = hctx->wb->bytes_in - hctx->wb->bytes_out;
25
@@ -2585,7 +2598,8 @@ SUBREQUEST_FUNC(mod_scgi_handle_subreque
26
 		}
27
 	}
28
 
29
-	return (0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb))
30
+	return ((0 == hctx->wb->bytes_in || !chunkqueue_is_empty(hctx->wb))
31
+		&& hctx->state != FCGI_STATE_CONNECT)
32
 	  ? scgi_send_request(srv, hctx)
33
 	  : HANDLER_WAIT_FOR_EVENT;
34
 }

Return to bug 211646