diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-11-04 20:17:32 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-11-04 20:17:32 +0000 |
commit | 47bad8abb70c49f1d2bc1ddbc13ec7ec96bc20f5 (patch) | |
tree | bdf4a326cd0cc91223201d1d9b4f05a4f75a379d /http-internal.h | |
parent | 86db1c851be804b13aadebcc0b1a21a4493192dd (diff) | |
download | libevent-47bad8abb70c49f1d2bc1ddbc13ec7ec96bc20f5.tar.gz |
Implement size limits on HTTP header length and body length.
Patch from Constantine Verutin, simplified a little.
svn:r1500
Diffstat (limited to 'http-internal.h')
-rw-r--r-- | http-internal.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/http-internal.h b/http-internal.h index 5567e179..72a011b3 100644 --- a/http-internal.h +++ b/http-internal.h @@ -24,7 +24,8 @@ enum message_read_status { ALL_DATA_READ = 1, MORE_DATA_EXPECTED = 0, DATA_CORRUPTED = -1, - REQUEST_CANCELED = -2 + REQUEST_CANCELED = -2, + DATA_TOO_LONG = -3 }; enum evhttp_connection_error { @@ -70,6 +71,9 @@ struct evhttp_connection { char *address; /* address to connect to */ u_short port; + size_t max_headers_size; + uint64_t max_body_size; + int flags; #define EVHTTP_CON_INCOMING 0x0001 /* only one request on it ever */ #define EVHTTP_CON_OUTGOING 0x0002 /* multiple requests possible */ @@ -127,8 +131,11 @@ struct evhttp { /* NULL if this server is not a vhost */ char *vhost_pattern; - int timeout; + int timeout; + size_t default_max_headers_size; + size_t default_max_body_size; + void (*gencb)(struct evhttp_request *req, void *); void *gencbarg; |