skarcha/tests — Issue #16: 17 - handler_mirror response bug 
Author: skarcha
Created: 2011-10-17 23:11:09+00:00
State: open

I am using handler_mirror to have cherokee load balance a couple webservers and use its internal
iocache for static content. I have noticed when using the mirror handler that
cherokee_handler_mirror_step is sending the data it recieves from the webservers and
cherokee_handler_mirror_add_headers just returns ret_ok. This will result in a response like
this...

'\r\n\r\n<response-from-webserver>'

The response from webserver is the full response including headers. This ends up being
rendered by the web browser. To attempt to fix this issue I moved the step code to the
add_headers and did resolve the problem, but I can't seem to find a correct return value for step.
I tried ret_ok_and_sent assuming it will basically be ignored, but it in fact hangs on another
request and I am not sure of the root of this and may just be misconfiguration or something
related to Django.

If I use ret_ok cherokee_socket_write enforces the assertion that there is no data in the buffer.

Any ideas?

Original link: http://code.google.com/p/cherokee/issues/detail?id=17