Fixed HTTP proxy not correctly handling connectors that disconnect in between handling requests.

This commit is contained in:
Thulinma 2013-08-28 15:49:45 +02:00
parent a343b67f09
commit 59b21d94ec

View file

@ -391,7 +391,7 @@ namespace Connector_HTTP {
//check if a connection exists, and if not create one
connMutex.lock();
if ( !connectorConnections.count(uid) || !connectorConnections[uid]->conn->connected()){
if ( !connectorConnections.count(uid) || (!connectorConnections[uid]->conn->spool() && !connectorConnections[uid]->conn->connected())){
if (connectorConnections.count(uid)){
delete connectorConnections[uid];
connectorConnections.erase(uid);
@ -462,7 +462,7 @@ namespace Connector_HTTP {
}
break; //continue down below this while loop
}
}else{
}
//keep trying unless the timeout triggers
if (timeout++ > 4000){
std::cout << "[20s timeout triggered]" << std::endl;
@ -475,7 +475,6 @@ namespace Connector_HTTP {
Util::sleep(5);
}
}
}
//unset to only read headers
H.headerOnly = false;
if ( !myCConn->conn->connected() || !conn->connected()){