summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorj.alex <j.alex>2005-08-05 18:17:37 +0000
committerj.alex <j.alex>2005-08-05 18:17:37 +0000
commitc00a2b7fd10dce91a164c5e3a5795645eca6edd9 (patch)
tree09e33d8d66e488e372148a94ffe3722a16f89489 /src
parentf3cc51a969e4e9c6fcc21bb804ac1b890bf27dd5 (diff)
downloadtog-pegasus-c00a2b7fd10dce91a164c5e3a5795645eca6edd9.zip
tog-pegasus-c00a2b7fd10dce91a164c5e3a5795645eca6edd9.tar.gz
tog-pegasus-c00a2b7fd10dce91a164c5e3a5795645eca6edd9.tar.xz
BUG#: 2290
TITLE: pegasus should honor HTTP header 'Connection: Close' DESCRIPTION: Added changes to reconnect Client with Server when "Connection: Close" header is detected during an Authentication Challenge.
Diffstat (limited to 'src')
-rw-r--r--src/Pegasus/Client/CIMClientRep.cpp17
-rw-r--r--src/Pegasus/Client/CIMOperationResponseDecoder.cpp12
2 files changed, 22 insertions, 7 deletions
diff --git a/src/Pegasus/Client/CIMClientRep.cpp b/src/Pegasus/Client/CIMClientRep.cpp
index 9b144a1..8a99613 100644
--- a/src/Pegasus/Client/CIMClientRep.cpp
+++ b/src/Pegasus/Client/CIMClientRep.cpp
@@ -409,7 +409,6 @@ void CIMClientRep::disconnect()
_connectSSLContext.reset();
}
-
Boolean CIMClientRep::isConnected() const throw()
{
return _connected;
@@ -1125,8 +1124,9 @@ Message* CIMClientRep::_doRequest(
// Reconnect to reset the connection
// if Server response contained a Connection: Close Header
//
- if(response->getCloseConnect() == true){
+ if (response->getCloseConnect() == true){
_reconnect();
+ response->setCloseConnect(false);
}
//
@@ -1252,16 +1252,23 @@ Message* CIMClientRep::_doRequest(
}//end of if statmet that call the callback method
return response;
}
+ else if (dynamic_cast<CIMRequestMessage*>(response) != 0)
+ {
+ // Respond to an authentication challenge
+ _requestEncoder->enqueue(response);
+ nowMilliseconds = TimeValue::getCurrentTime().toMilliseconds();
+ stopMilliseconds = nowMilliseconds + _timeoutMilliseconds;
+ continue;
+ }
else
{
// l10n
// CIMClientResponseException responseException(
// "Mismatched response message type.");
-
MessageLoaderParms mlParms(
- "Client.CIMOperationResponseDecoder.MISMATCHED_RESPONSE_TYPE",
- "Mismatched response message type.");
+ "Client.CIMOperationResponseDecoder.MISMATCHED_RESPONSE_TYPE",
+ "Mismatched response message type.");
String mlString(MessageLoader::getMessage(mlParms));
CIMClientResponseException responseException(mlString);
diff --git a/src/Pegasus/Client/CIMOperationResponseDecoder.cpp b/src/Pegasus/Client/CIMOperationResponseDecoder.cpp
index dc2ac27..c202c32 100644
--- a/src/Pegasus/Client/CIMOperationResponseDecoder.cpp
+++ b/src/Pegasus/Client/CIMOperationResponseDecoder.cpp
@@ -158,7 +158,7 @@ void CIMOperationResponseDecoder::_handleHTTPMessage(HTTPMessage* httpMessage)
//
// Check for Connection: Close
//
- if(HTTPMessage::lookupHeader(headers, "Connection", connectClose, false))
+ if (HTTPMessage::lookupHeader(headers, "Connection", connectClose, false))
{
if (String::equalNoCase(connectClose, "Close"))
{
@@ -228,7 +228,15 @@ void CIMOperationResponseDecoder::_handleHTTPMessage(HTTPMessage* httpMessage)
// re-sending with authentication challenge response.
//
Message* reqMessage = _authenticator->getRequestMessage();
- _encoderQueue->enqueue(reqMessage);
+ if (cimReconnect == true)
+ {
+ reqMessage->setCloseConnect(cimReconnect);
+ _outputQueue->enqueue(reqMessage);
+ }
+ else
+ {
+ _encoderQueue->enqueue(reqMessage);
+ }
return;
}