Browse Source

Fix mod_proxy HUP handling (send final chunk, fix usage counter)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2718 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.27
Stefan Bühler 12 years ago
parent
commit
e789ea231f
  1. 1
      NEWS
  2. 12
      src/mod_proxy.c

1
NEWS

@ -5,6 +5,7 @@ NEWS
- 1.4.27 -
* Fix handling return value of SSL_CTX_set_options (fixes #2157, thx mlcreech)
* Fix mod_proxy HUP handling (send final chunk, fix usage counter)
- 1.4.26 - 2010-02-07
* Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105)

12
src/mod_proxy.c

@ -349,6 +349,10 @@ static void proxy_connection_close(server *srv, handler_ctx *hctx) {
srv->cur_fds--;
}
if (hctx->host) {
hctx->host->usage--;
}
handler_ctx_free(hctx);
con->plugin_ctx[p->id] = NULL;
}
@ -989,8 +993,6 @@ static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) {
case 0:
break;
case 1:
hctx->host->usage--;
/* we are done */
proxy_connection_close(srv, hctx);
@ -1077,8 +1079,11 @@ static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) {
return HANDLER_FINISHED;
}
con->file_finished = 1;
if (!con->file_finished) {
http_chunk_append_mem(srv, con, NULL, 0);
}
con->file_finished = 1;
proxy_connection_close(srv, hctx);
joblist_append(srv, con);
} else if (revents & FDEVENT_ERR) {
@ -1086,6 +1091,7 @@ static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) {
log_error_write(srv, __FILE__, __LINE__, "sd", "proxy-FDEVENT_ERR, but no HUP", revents);
con->file_finished = 1;
joblist_append(srv, con);
proxy_connection_close(srv, hctx);
}

Loading…
Cancel
Save