Added support for 'Connection: close' header in HTTP proxy
This commit is contained in:
parent
b919475630
commit
00a47f24d8
1 changed files with 9 additions and 0 deletions
|
@ -388,6 +388,11 @@ namespace Connector_HTTP {
|
||||||
std::cout << "Received request: " << Client.getUrl() << " (" << conn->getSocket() << ") => " << handler << " (" << Client.GetVar("stream")
|
std::cout << "Received request: " << Client.getUrl() << " (" << conn->getSocket() << ") => " << handler << " (" << Client.GetVar("stream")
|
||||||
<< ")" << std::endl;
|
<< ")" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
bool closeConnection = false;
|
||||||
|
if( Client.GetHeader( "Connection" ) == "close" ) {
|
||||||
|
closeConnection = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (handler == "none" || handler == "internal"){
|
if (handler == "none" || handler == "internal"){
|
||||||
if (handler == "internal"){
|
if (handler == "internal"){
|
||||||
Handle_Internal(Client, conn);
|
Handle_Internal(Client, conn);
|
||||||
|
@ -400,6 +405,10 @@ namespace Connector_HTTP {
|
||||||
#if DEBUG >= 4
|
#if DEBUG >= 4
|
||||||
std::cout << "Completed request (" << conn->getSocket() << ") " << handler << " in " << (Util::getMS() - startms) << " ms" << std::endl;
|
std::cout << "Completed request (" << conn->getSocket() << ") " << handler << " in " << (Util::getMS() - startms) << " ms" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
if( closeConnection ) {
|
||||||
|
fprintf( stderr, "Called for connection close\n" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
Client.Clean(); //clean for any possible next requests
|
Client.Clean(); //clean for any possible next requests
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Add table
Reference in a new issue