Fix a few types to use compatible versions

svn:r1501
This commit is contained in:
Nick Mathewson 2009-11-05 15:57:22 +00:00
parent 47bad8abb7
commit 34f28e08b3
3 changed files with 18 additions and 8 deletions

View File

@ -359,7 +359,7 @@ put_error(struct bufferevent_openssl *bev_ssl, unsigned long err)
than 32 bits of it, since it needs to report errors on systems
where long is only 32 bits.
*/
bev_ssl->errors[bev_ssl->n_errors++] = (uint32_t) err;
bev_ssl->errors[bev_ssl->n_errors++] = (ev_uint32_t) err;
}
/* Have the base communications channel (either the underlying bufferevent or

View File

@ -72,7 +72,7 @@ struct evhttp_connection {
u_short port;
size_t max_headers_size;
uint64_t max_body_size;
ev_uint64_t max_body_size;
int flags;
#define EVHTTP_CON_INCOMING 0x0001 /* only one request on it ever */
@ -134,7 +134,7 @@ struct evhttp {
int timeout;
size_t default_max_headers_size;
size_t default_max_body_size;
ev_uint64_t default_max_body_size;
void (*gencb)(struct evhttp_request *req, void *);
void *gencbarg;

18
http.c
View File

@ -2672,12 +2672,22 @@ evhttp_set_timeout(struct evhttp* http, int timeout_in_secs)
http->timeout = timeout_in_secs;
}
void evhttp_set_max_headers_size(struct evhttp* http, ssize_t max_headers_size) {
http->default_max_headers_size = max_headers_size;
void
evhttp_set_max_headers_size(struct evhttp* http, ev_ssize_t max_headers_size)
{
if (max_headers_size < 0)
http->default_max_headers_size = EV_SIZE_MAX;
else
http->default_max_headers_size = max_headers_size;
}
void evhttp_set_max_body_size(struct evhttp* http, ssize_t max_body_size) {
http->default_max_body_size = max_body_size;
void
evhttp_set_max_body_size(struct evhttp* http, ev_ssize_t max_body_size)
{
if (max_body_size < 0)
http->default_max_body_size = EV_UINT64_MAX;
else
http->default_max_body_size = max_body_size;
}
int