Hello All,

If I'm reading this right, the logic at handler_cgi_base.c:1152 is the
key (see below).

<pre>
/* Handle X-Sendfile
 */
if (! cherokee_buffer_is_empty (&cgi->xsendfile))
{
        cherokee_buffer_t cgi_header = CHEROKEE_BUF_INIT;

        /* Instance the 'file' sub-handler
         */
        handler_file_props.use_cache = true;
        ret = cherokee_handler_file_new ((cherokee_handler_t **) &cgi-
>file_handler,
                                         conn, 
MODULE_PROPS(&handler_file_props));
        if (ret != ret_ok)
                return ret_error;

        ret = cherokee_handler_file_custom_init (cgi->file_handler, &cgi-
>xsendfile);
        if (ret != ret_ok)
                return ret_error;

        /* Work out the header
         */
        cherokee_buffer_add_buffer (&cgi_header, outbuf);
        cherokee_buffer_clean (outbuf);

        ret = cherokee_handler_file_add_headers (cgi->file_handler, outbuf);
        if (ret != ret_ok)
                return ret_error;

        /* Overwrite the handler properties
         */
        HANDLER(cgi)->support  = HANDLER(cgi->file_handler)->support;
        conn->chunked_encoding = false;

        mix_headers (outbuf, &cgi_header);
        return ret_ok;
}
</pre>

This same logic needs to be added to handler_proxy.c at line 1345.
This is just after the Expires header is possibly overwriten, and
before the "No Content-Encoding" logic (see below).

<pre>
/* Deal with Content-Encoding: If the response is no encoded,
 * and the handler is configured to encode, it has to add the
 * encoder headers at this point.
 */
if (conn->encoder_new_func) {
        ret = cherokee_connection_instance_encoder (conn);
        if (ret == ret_ok) {
                cherokee_encoder_add_headers (conn->encoder, buf_out);
        }
}
</pre>

Does this sound right?

Dave

On Sep 27, 12:45 am, chumpalump <[email protected]> wrote:
> Hello All,
>
> We have switched our django deployments from fastcgi to gunicorn.  All
> is wonderful (and much improved), but X-Sendfile is not supported for
> Reverse Proxies.  X-Sendfile allows us to deliver files from cherokee
> without the security pains per-user file access normally would cause.
>
> Is there a technical barrier, or is it that noone has needed this yet?
>
> Thank you for all the excellent code and support I've found here.
>
> Dave
> _______________________________________________
> Cherokee mailing list
> [email protected]http://lists.octality.com/listinfo/cherokee
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to