Remove dead code and comments
This commit is contained in:
+1
-38
@@ -77,16 +77,11 @@ private:
|
|||||||
/* Get socket ext */
|
/* Get socket ext */
|
||||||
HttpResponseData<SSL> *httpResponseData = (HttpResponseData<SSL> *) static_dispatch(us_ssl_socket_ext, us_socket_ext)(s);
|
HttpResponseData<SSL> *httpResponseData = (HttpResponseData<SSL> *) static_dispatch(us_ssl_socket_ext, us_socket_ext)(s);
|
||||||
|
|
||||||
std::cout << "Close event!" << std::endl;
|
|
||||||
|
|
||||||
/* Signal broken HTTP request only if we have a pending request */
|
/* Signal broken HTTP request only if we have a pending request */
|
||||||
if (httpResponseData->onAborted) {
|
if (httpResponseData->onAborted) {
|
||||||
httpResponseData->onAborted();
|
httpResponseData->onAborted();
|
||||||
}
|
}
|
||||||
|
|
||||||
// we might want to also signal the read stream?
|
|
||||||
// smash onAborted together with read?
|
|
||||||
|
|
||||||
/* Destruct socket ext */
|
/* Destruct socket ext */
|
||||||
httpResponseData->~HttpResponseData<SSL>();
|
httpResponseData->~HttpResponseData<SSL>();
|
||||||
|
|
||||||
@@ -139,19 +134,6 @@ private:
|
|||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Did we upgrade this guy? */
|
|
||||||
// if (httpResponseData->state & HttpResponseData<SSL>::HTTP_UPGRADED_TO_WEBSOCKET) {
|
|
||||||
// std::cout << "we upgraded from the handler!" << std::endl;
|
|
||||||
|
|
||||||
|
|
||||||
// std::cout << "We were upgraded to: " << httpContextData->upgradedWebSocket << std::endl;
|
|
||||||
|
|
||||||
// return httpContextData->upgradedWebSocket;
|
|
||||||
|
|
||||||
|
|
||||||
// // here we should adopt the socket and transition to websocket parsing, returning a socket different will halt parsing
|
|
||||||
// }
|
|
||||||
|
|
||||||
/* Was the socket closed? */
|
/* Was the socket closed? */
|
||||||
if (us_socket_is_closed((struct us_socket *) s)) {
|
if (us_socket_is_closed((struct us_socket *) s)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -162,9 +144,6 @@ private:
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Was the socket upgraded? */
|
|
||||||
// if (some global variable in this loop)
|
|
||||||
|
|
||||||
/* Continue parsing */
|
/* Continue parsing */
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
@@ -199,25 +178,9 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (SOCKET_TYPE *) returnedSocket;
|
return (SOCKET_TYPE *) returnedSocket;
|
||||||
} else {
|
|
||||||
// we cannot return nullptr to the underlying stack in any case
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
// below is never reached
|
|
||||||
|
|
||||||
/* Only uncork still valid sockets */
|
|
||||||
if (returnedSocket == s) {
|
|
||||||
/* Timeout on uncork failure */
|
|
||||||
auto [written, failed] = ((AsyncSocket<SSL> *) s)->uncork();
|
|
||||||
if (failed) {
|
|
||||||
((AsyncSocket<SSL> *) s)->timeout(HTTP_IDLE_TIMEOUT_S);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// was this socket upgraded?
|
|
||||||
std::cout << "Socket was closed or shut down in handler or maybe upgraded" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we cannot return nullptr to the underlying stack in any case
|
||||||
return s;
|
return s;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user