Minor fix of streambuf size check in chunked transfer
This commit is contained in:
parent
84455ac966
commit
1bc0b9a779
2 changed files with 2 additions and 2 deletions
|
|
@ -722,7 +722,7 @@ namespace SimpleWeb {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(chunk_size + session->response->streambuf.size() > session->response->streambuf.max_size()) {
|
if(2 + chunk_size + session->response->streambuf.size() > session->response->streambuf.max_size()) {
|
||||||
session->response->content.end = false;
|
session->response->content.end = false;
|
||||||
session->callback(ec);
|
session->callback(ec);
|
||||||
session->response = std::shared_ptr<Response>(new Response(*session->response));
|
session->response = std::shared_ptr<Response>(new Response(*session->response));
|
||||||
|
|
|
||||||
|
|
@ -613,7 +613,7 @@ namespace SimpleWeb {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(chunk_size + session->request->streambuf.size() > session->request->streambuf.max_size()) {
|
if(2 + chunk_size + session->request->streambuf.size() > session->request->streambuf.max_size()) {
|
||||||
auto response = std::shared_ptr<Response>(new Response(session, this->config.timeout_content));
|
auto response = std::shared_ptr<Response>(new Response(session, this->config.timeout_content));
|
||||||
response->write(StatusCode::client_error_payload_too_large);
|
response->write(StatusCode::client_error_payload_too_large);
|
||||||
if(this->on_error)
|
if(this->on_error)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue