On Tue, Mar 01, 2011 at 05:39:18PM -0800, Nathaniel Irvin wrote:
> It seems like even after I set the flag ANA_REQ_HTTP_BODY, the fetch
> function still does not work with the entire message in the buffer.

You should add some markers in the http request body parser to ensure
it is properly called and it does its job.

> What it
> seems like it is getting is just the CRLF in the 100-Continue message.

The body parser should be able to deal with expect: 100-continue and send
the response itself. So most likely you did not pass through it in time.

Oh I see what might be happening :

    int http_process_request_body(struct session *s, struct buffer *req, int 
an_bit)
    {
        struct http_txn *txn = &s->txn;
        struct http_msg *msg = &s->txn.req;
        long long limit = s->be->url_param_post_limit;

See this limit above ? Since you have no url_param, by default it waits for
zero byte. Change that to a full buffer size :

        long long limit = req->size;

Also, in session.c, you'll probably have to move the call to
http_process_request_body() earlier (eg: before process_switching_rules)
so that you have the data when you want to do the job.

> Also
> in our fetch function, it seems like the buffer from previous requests is
> preserved and merely written over, so sometimes we will have leftover data
> from a previous buffer.

It is normal and expected, as the buffer has a fixed size, everything
that is beyond your data size is undefined. If you noticed that, I
suspect that your parsing function did not take into account the
buffer's length (req->l) to detect the end of the known data.

Regards,
Willy


Reply via email to