Hi,

It seems that libevent incorrectly handles case when HTTP server wants to send HTTP response with empty content. The problem is that libevent doesn't generate Content-Length header in this case what causes HTTP1.1 clients to hang until it timeouts. The problem seems to be in the code in evhttp_make_header_response().

Basically it looks like:

static void
evhttp_make_header_response(struct evhttp_connection *evcon,
    struct evhttp_request *req)
{
    ...
    if (EVBUFFER_LENGTH(req->output_buffer)) {
        ...
        code to generate headers Data, Content-Type and
        Content-Length if they are not present already
        ...
    }
    ...
}

This looks wrong maybe except for Content-Type header. Why doesn't it generates these headers if buffer length is 0? Missing Date header is not critical but missing Content-Length header definitely breaks HTTP clients.

--
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to