mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Remove the limit on size of HTTP headers by removing static buffers
svn:r1240
This commit is contained in:
parent
749f4ce319
commit
23967f73a2
@ -1,5 +1,6 @@
|
|||||||
Changes in 1.4.11-stable:
|
Changes in 1.4.11-stable:
|
||||||
o Fix a bug when removing a timeout from the heap. [Patch from Marko Kreen]
|
o Fix a bug when removing a timeout from the heap. [Patch from Marko Kreen]
|
||||||
|
o Remove the limit on size of HTTP headers by removing static buffers.
|
||||||
|
|
||||||
Changes in 1.4.10-stable:
|
Changes in 1.4.10-stable:
|
||||||
o clean up buffered http connection data on reset; reported by Brian O'Kelley
|
o clean up buffered http connection data on reset; reported by Brian O'Kelley
|
||||||
|
12
http.c
12
http.c
@ -378,16 +378,14 @@ static void
|
|||||||
evhttp_make_header_request(struct evhttp_connection *evcon,
|
evhttp_make_header_request(struct evhttp_connection *evcon,
|
||||||
struct evhttp_request *req)
|
struct evhttp_request *req)
|
||||||
{
|
{
|
||||||
char line[1024];
|
|
||||||
const char *method;
|
const char *method;
|
||||||
|
|
||||||
evhttp_remove_header(req->output_headers, "Proxy-Connection");
|
evhttp_remove_header(req->output_headers, "Proxy-Connection");
|
||||||
|
|
||||||
/* Generate request line */
|
/* Generate request line */
|
||||||
method = evhttp_method(req->type);
|
method = evhttp_method(req->type);
|
||||||
evutil_snprintf(line, sizeof(line), "%s %s HTTP/%d.%d\r\n",
|
evbuffer_add_printf(evcon->output_buffer, "%s %s HTTP/%d.%d\r\n",
|
||||||
method, req->uri, req->major, req->minor);
|
method, req->uri, req->major, req->minor);
|
||||||
evbuffer_add(evcon->output_buffer, line, strlen(line));
|
|
||||||
|
|
||||||
/* Add the content length on a post request if missing */
|
/* Add the content length on a post request if missing */
|
||||||
if (req->type == EVHTTP_REQ_POST &&
|
if (req->type == EVHTTP_REQ_POST &&
|
||||||
@ -464,11 +462,9 @@ evhttp_make_header_response(struct evhttp_connection *evcon,
|
|||||||
struct evhttp_request *req)
|
struct evhttp_request *req)
|
||||||
{
|
{
|
||||||
int is_keepalive = evhttp_is_connection_keepalive(req->input_headers);
|
int is_keepalive = evhttp_is_connection_keepalive(req->input_headers);
|
||||||
char line[1024];
|
evbuffer_add_printf(evcon->output_buffer, "HTTP/%d.%d %d %s\r\n",
|
||||||
evutil_snprintf(line, sizeof(line), "HTTP/%d.%d %d %s\r\n",
|
|
||||||
req->major, req->minor, req->response_code,
|
req->major, req->minor, req->response_code,
|
||||||
req->response_code_line);
|
req->response_code_line);
|
||||||
evbuffer_add(evcon->output_buffer, line, strlen(line));
|
|
||||||
|
|
||||||
if (req->major == 1) {
|
if (req->major == 1) {
|
||||||
if (req->minor == 1)
|
if (req->minor == 1)
|
||||||
@ -515,7 +511,6 @@ evhttp_make_header_response(struct evhttp_connection *evcon,
|
|||||||
void
|
void
|
||||||
evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req)
|
evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req)
|
||||||
{
|
{
|
||||||
char line[1024];
|
|
||||||
struct evkeyval *header;
|
struct evkeyval *header;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -529,9 +524,8 @@ evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TAILQ_FOREACH(header, req->output_headers, next) {
|
TAILQ_FOREACH(header, req->output_headers, next) {
|
||||||
evutil_snprintf(line, sizeof(line), "%s: %s\r\n",
|
evbuffer_add_printf(evcon->output_buffer, "%s: %s\r\n",
|
||||||
header->key, header->value);
|
header->key, header->value);
|
||||||
evbuffer_add(evcon->output_buffer, line, strlen(line));
|
|
||||||
}
|
}
|
||||||
evbuffer_add(evcon->output_buffer, "\r\n", 2);
|
evbuffer_add(evcon->output_buffer, "\r\n", 2);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user