mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Fixed problems with Win32 build
This commit is contained in:
parent
d7bb402ca7
commit
64991a560a
@ -2452,6 +2452,7 @@ Server::process_request(Stream &strm, bool last_connection,
|
|||||||
// Check if the request URI doesn't exceed the limit
|
// Check if the request URI doesn't exceed the limit
|
||||||
if (reader.size() > CPPHTTPLIB_REQUEST_URI_MAX_LENGTH) {
|
if (reader.size() > CPPHTTPLIB_REQUEST_URI_MAX_LENGTH) {
|
||||||
res.status = 414;
|
res.status = 414;
|
||||||
|
connection_close = true;
|
||||||
return write_response(strm, last_connection, req, res);
|
return write_response(strm, last_connection, req, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2459,6 +2460,7 @@ Server::process_request(Stream &strm, bool last_connection,
|
|||||||
if (!parse_request_line(reader.ptr(), req) ||
|
if (!parse_request_line(reader.ptr(), req) ||
|
||||||
!detail::read_headers(strm, req.headers)) {
|
!detail::read_headers(strm, req.headers)) {
|
||||||
res.status = 400;
|
res.status = 400;
|
||||||
|
connection_close = true;
|
||||||
return write_response(strm, last_connection, req, res);
|
return write_response(strm, last_connection, req, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ protected:
|
|||||||
.Get("/streamed-cancel",
|
.Get("/streamed-cancel",
|
||||||
[&](const Request & /*req*/, Response &res) {
|
[&](const Request & /*req*/, Response &res) {
|
||||||
res.set_content_provider(
|
res.set_content_provider(
|
||||||
uint64_t(-1),
|
size_t(-1),
|
||||||
[](uint64_t /*offset*/, uint64_t /*length*/, Out out) {
|
[](uint64_t /*offset*/, uint64_t /*length*/, Out out) {
|
||||||
std::string data = "data_chunk";
|
std::string data = "data_chunk";
|
||||||
out(data.data(), data.size());
|
out(data.data(), data.size());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user