From: Aki Tuomi Date: Thu, 10 Jul 2014 20:31:03 +0000 (+0300) Subject: Sync with upstream X-Git-Tag: auth-3.4.0-rc1~85^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3118434fd75c302263936f229362d103d94ab967;p=thirdparty%2Fpdns.git Sync with upstream --- diff --git a/pdns/ext/yahttp/yahttp/Makefile.am b/pdns/ext/yahttp/yahttp/Makefile.am index a2866513aa..b5c6ee0f22 100644 --- a/pdns/ext/yahttp/yahttp/Makefile.am +++ b/pdns/ext/yahttp/yahttp/Makefile.am @@ -1,5 +1,7 @@ -AM_CPPFLAGS=$(BOOST_CPPFLAGS) - +AM_CPPFLAGS=$(BOOST_CPPFLAGS) @THREADFLAGS@ noinst_LTLIBRARIES=libyahttp.la libyahttp_la_SOURCES=cookie.hpp exception.hpp reqresp.cpp reqresp.hpp router.cpp router.hpp url.hpp utility.hpp yahttp-config.h yahttp.hpp + +yahttp-config.h: + cat ../../../../config.h > yahttp-config.h diff --git a/pdns/ext/yahttp/yahttp/reqresp.cpp b/pdns/ext/yahttp/yahttp/reqresp.cpp index 9b94a2720a..9f12c54773 100644 --- a/pdns/ext/yahttp/yahttp/reqresp.cpp +++ b/pdns/ext/yahttp/yahttp/reqresp.cpp @@ -75,8 +75,8 @@ namespace YaHTTP { minbody = 0; // check for expected body size - if (target->kind == YAHTTP_TYPE_REQUEST) maxbody = YAHTTP_MAX_REQUEST_SIZE; - else if (target->kind == YAHTTP_TYPE_RESPONSE) maxbody = YAHTTP_MAX_RESPONSE_SIZE; + if (target->kind == YAHTTP_TYPE_REQUEST) maxbody = target->max_request_size; + else if (target->kind == YAHTTP_TYPE_RESPONSE) maxbody = target->max_response_size; else maxbody = 0; if (!chunked) { @@ -86,8 +86,8 @@ namespace YaHTTP { maxbody = minbody; } if (minbody < 1) return true; // guess there isn't anything left. - if (target->kind == YAHTTP_TYPE_REQUEST && minbody > YAHTTP_MAX_REQUEST_SIZE) throw ParseError("Max request body size exceeded"); - else if (target->kind == YAHTTP_TYPE_RESPONSE && minbody > YAHTTP_MAX_RESPONSE_SIZE) throw ParseError("Max response body size exceeded"); + if (target->kind == YAHTTP_TYPE_REQUEST && minbody > target->max_request_size) throw ParseError("Max request body size exceeded"); + else if (target->kind == YAHTTP_TYPE_RESPONSE && minbody > target->max_response_size) throw ParseError("Max response body size exceeded"); } if (maxbody == 0) hasBody = false; diff --git a/pdns/ext/yahttp/yahttp/reqresp.hpp b/pdns/ext/yahttp/yahttp/reqresp.hpp index 44be27a563..a66dcb622f 100644 --- a/pdns/ext/yahttp/yahttp/reqresp.hpp +++ b/pdns/ext/yahttp/yahttp/reqresp.hpp @@ -87,6 +87,8 @@ namespace YaHTTP { #ifdef HAVE_CPP_FUNC_PTR renderer = SendBodyRender(); #endif + max_request_size = YAHTTP_MAX_REQUEST_SIZE; + max_response_size = YAHTTP_MAX_RESPONSE_SIZE; }; protected: HTTPBase(const HTTPBase& rhs) { @@ -127,6 +129,9 @@ public: std::string routeName; // renderer; //utc_offset = ((t2-t)/10)*10; // removes any possible differences. #endif }; //utc_offset = 0; #endif }; //tm_wday; #ifdef HAVE_TM_GMTOFF utc_offset = tm->tm_gmtoff; -#else - utc_offset = 0; #endif isSet = true; }; //