From 617b78fa5ad447cdd2ce088f8f89b33f5fe5265a Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Sun, 27 Jul 2014 19:14:01 +0300 Subject: [PATCH] YaHTTP upgrade --- pdns/ext/yahttp/yahttp/reqresp.cpp | 4 ++-- pdns/ext/yahttp/yahttp/router.hpp | 4 ++-- pdns/ext/yahttp/yahttp/utility.hpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pdns/ext/yahttp/yahttp/reqresp.cpp b/pdns/ext/yahttp/yahttp/reqresp.cpp index 9f12c54773..14196b998d 100644 --- a/pdns/ext/yahttp/yahttp/reqresp.cpp +++ b/pdns/ext/yahttp/yahttp/reqresp.cpp @@ -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 > 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 (target->kind == YAHTTP_TYPE_REQUEST && static_cast(minbody) > target->max_request_size) throw ParseError("Max request body size exceeded"); + else if (target->kind == YAHTTP_TYPE_RESPONSE && static_cast(minbody) > target->max_response_size) throw ParseError("Max response body size exceeded"); } if (maxbody == 0) hasBody = false; diff --git a/pdns/ext/yahttp/yahttp/router.hpp b/pdns/ext/yahttp/yahttp/router.hpp index 1115af7d37..60bd21725d 100644 --- a/pdns/ext/yahttp/yahttp/router.hpp +++ b/pdns/ext/yahttp/yahttp/router.hpp @@ -34,9 +34,9 @@ namespace YaHTTP { This class implements a router for masked urls. The URL mask syntax is as of follows -//url/. +/<masked>/url<number>/<hi>.<format> -You can use <*param> to denote that everything will be matched and consumed into the parameter, including slash (/). Use <*> to denote that URL +You can use <*param> to denote that everything will be matched and consumed into the parameter, including slash (/). Use <*> to denote that URL is consumed but not stored. Note that only path is matched, scheme, host and url parameters are ignored. */ class Router { diff --git a/pdns/ext/yahttp/yahttp/utility.hpp b/pdns/ext/yahttp/yahttp/utility.hpp index 191ef24722..c6be7c6333 100644 --- a/pdns/ext/yahttp/yahttp/utility.hpp +++ b/pdns/ext/yahttp/yahttp/utility.hpp @@ -224,7 +224,7 @@ namespace YaHTTP { if (!std::isalnum(*iter) && (!asUrl || skip.find(*iter) == std::string::npos)) { // replace with different thing pos = std::distance(result.begin(), iter); - snprintf(repl,3,"%02x", static_cast(*iter)); + ::snprintf(repl,3,"%02x", static_cast(*iter)); result = result.replace(pos, 1, "%", 1).insert(pos+1, repl, 2); iter = result.begin() + pos + 2; } -- 2.47.2