mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Fix newly introduced crash in the Brynet backend.
This commit is contained in:
parent
5c2d97ebbb
commit
a16222e29e
@ -9,18 +9,18 @@ void BryRequest::send() {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
if (http_parser->isKeepAlive()) {
|
if (http_parser->isKeepAlive()) {
|
||||||
response->addHeadValue("Connection", "Keep-Alive");
|
|
||||||
|
|
||||||
response->setBody(compiled_body);
|
response->setBody(compiled_body);
|
||||||
|
|
||||||
|
response->addHeadValue("Connection", "Keep-Alive");
|
||||||
|
|
||||||
std::string result = response->getResult();
|
std::string result = response->getResult();
|
||||||
|
|
||||||
session->send(result.c_str(), result.size());
|
session->send(result.c_str(), result.size());
|
||||||
} else {
|
} else {
|
||||||
response->addHeadValue("Connection", "Close");
|
|
||||||
|
|
||||||
response->setBody(compiled_body);
|
response->setBody(compiled_body);
|
||||||
|
|
||||||
|
response->addHeadValue("Connection", "Close");
|
||||||
|
|
||||||
std::string result = response->getResult();
|
std::string result = response->getResult();
|
||||||
|
|
||||||
HttpSession::Ptr lsession = session;
|
HttpSession::Ptr lsession = session;
|
||||||
@ -102,6 +102,8 @@ void BryRequest::pool() {
|
|||||||
BryRequest::BryRequest() :
|
BryRequest::BryRequest() :
|
||||||
Request() {
|
Request() {
|
||||||
response = nullptr;
|
response = nullptr;
|
||||||
|
|
||||||
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
BryRequest::~BryRequest() {
|
BryRequest::~BryRequest() {
|
||||||
|
@ -162,8 +162,6 @@ Request::Request() {
|
|||||||
//It is a tradeoff on server memory though, as every active download will consume this amount of memory
|
//It is a tradeoff on server memory though, as every active download will consume this amount of memory
|
||||||
//where the file is bigger than this number
|
//where the file is bigger than this number
|
||||||
file_chunk_size = 1 << 21; //2MB
|
file_chunk_size = 1 << 21; //2MB
|
||||||
|
|
||||||
reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Request::~Request() {
|
Request::~Request() {
|
||||||
|
@ -83,7 +83,7 @@ void DRequest::pool() {
|
|||||||
DRequest::pool(this);
|
DRequest::pool(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
DRequest::DRequest() {
|
DRequest::DRequest() : Request() {
|
||||||
|
|
||||||
//This value will need benchmarks, 2 MB seems to be just as fast for me as 4 MB, but 1MB is slower
|
//This value will need benchmarks, 2 MB seems to be just as fast for me as 4 MB, but 1MB is slower
|
||||||
//It is a tradeoff on server memory though, as every active download will consume this amount of memory
|
//It is a tradeoff on server memory though, as every active download will consume this amount of memory
|
||||||
|
Loading…
Reference in New Issue
Block a user