]> granicus.if.org Git - libevent/commitdiff
Fix a few types to use compatible versions
authorNick Mathewson <nickm@torproject.org>
Thu, 5 Nov 2009 15:57:22 +0000 (15:57 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 5 Nov 2009 15:57:22 +0000 (15:57 +0000)
svn:r1501

bufferevent_openssl.c
http-internal.h
http.c

index b88a78aabe05afd699e14be29339b0741034e109..ba8e7f9576b72303c559d4c25348fc1ff63cc724 100644 (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
index 72a011b38d992d06f30597df25a6515b7d6c905e..49ee9bcbbcdb87f301e9ae90196da27fb542f041 100644 (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,8 +134,8 @@ 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;
 
diff --git a/http.c b/http.c
index cf10692b840979a144d67a40bf205887567d6d2e..33990716239a657b76fefb658c5cfaa25eebc2da 100644 (file)
--- a/http.c
+++ b/http.c
@@ -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