mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-05-02 13:47:56 +02:00
Don't check for connection closed in send and send_file. Sometimes the connection closed callback gets called before send, but the connection still seems to be alive. Will work on it later.
This commit is contained in:
parent
b8624f190a
commit
c5ea34afdc
@ -54,7 +54,7 @@ void HTTPServer::closedCallbackDefault(const HttpSession::Ptr &session) {
|
|||||||
|
|
||||||
if (r == nullptr) {
|
if (r == nullptr) {
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
printf("Error HTTPServer::closedCallbackDefault: r == nullptr!\n");
|
//printf("Error HTTPServer::closedCallbackDefault: r == nullptr!\n");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -42,10 +42,10 @@ void Request::next_stage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Request::send() {
|
void Request::send() {
|
||||||
if (connection_closed) {
|
//if (connection_closed) {
|
||||||
RequestPool::return_request(this);
|
// RequestPool::return_request(this);
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (http_parser->isKeepAlive()) {
|
if (http_parser->isKeepAlive()) {
|
||||||
response->addHeadValue("Connection", "Keep-Alive");
|
response->addHeadValue("Connection", "Keep-Alive");
|
||||||
@ -67,10 +67,10 @@ void Request::send() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Request::send_file(const std::string &p_file_path) {
|
void Request::send_file(const std::string &p_file_path) {
|
||||||
if (connection_closed) {
|
//if (connection_closed) {
|
||||||
RequestPool::return_request(this);
|
// RequestPool::return_request(this);
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
|
|
||||||
file_path = p_file_path;
|
file_path = p_file_path;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user