Project

General

Profile

Actions

Bug #2196

closed

mod_proxy caching data

Added by nishant over 14 years ago. Updated over 14 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_proxy
Target version:
ASK QUESTIONS IN Forums:

Description

Hi..

lighttpd version 1.4.26.

mod_proxy does not forward response until socket connection is closed with host proxy (it simply caches the data).

I did a fix but 'm not very sure how much generalized/stable it is (it is working fine in my scenario).

Please have a look at it & if the fix seems fine then a patch can be released.
The file is attached for reference.

==========================================================
CHANGES:
1.
function: static int proxy_demux_response(server *srv, handler_ctx *hctx)
change:
//PATCH ADDED FOR SENDING RESPONSE DATA.
//Check for Content-Length tag & data received is equal to Content-Length
if((con->parsed_response & HTTP_CONTENT_LENGTH) && (con->response.content_length == blen))
hctx->response->used = 0;

2. static handler_t proxy_write_request(server *srv, handler_ctx *hctx)
change:
case PROXY_STATE_READ:

//PATCH ADDED FOR SENDING RESPONSE DATA.
//IF ALL RESPONSE DATA IS READ SUCCESSFULLY.
if(hctx->response->used 0)
return HANDLER_GO_ON ;
else
/* waiting for a response */
return HANDLER_WAIT_FOR_EVENT;

3. SUBREQUEST_FUNC(mod_proxy_handle_subrequest)
change:
//PATCH ADDED FOR SENDING RESPONSE DATA.
case HANDLER_GO_ON:
return HANDLER_GO_ON;

========================================================

Regards,
~Nishant


Files

mod_proxy.c (35.3 KB) mod_proxy.c Patched file -- to send response data back to lighty as soon as it read successfully from host proxy port. nishant, 2010-05-10 11:38
Actions #1

Updated by stbuehler over 14 years ago

  • Target version changed from 1.4.x to 1.4.27
Actions #2

Updated by stbuehler over 14 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2756.

Actions

Also available in: Atom