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<ssize_t>(minbody) > target->max_request_size) throw ParseError("Max request body size exceeded");
+ else if (target->kind == YAHTTP_TYPE_RESPONSE && static_cast<ssize_t>(minbody) > target->max_response_size) throw ParseError("Max response body size exceeded");
}
if (maxbody == 0) hasBody = false;
This class implements a router for masked urls. The URL mask syntax is as of follows
-/<masked>/url<number>/<hi>.<format>
+/<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 {
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<unsigned char>(*iter));
+ ::snprintf(repl,3,"%02x", static_cast<unsigned char>(*iter));
result = result.replace(pos, 1, "%", 1).insert(pos+1, repl, 2);
iter = result.begin() + pos + 2;
}