summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorj.alex <j.alex>2005-08-05 18:24:21 +0000
committerj.alex <j.alex>2005-08-05 18:24:21 +0000
commitda13954c733289dbc663cfa6ccdff86a4596ceea (patch)
tree89124dec779b0f7906cfd9757b8274968c9d721e /src
parentcb4df4cb4cf7f250bc2ffd1d1ed9f70052dec811 (diff)
downloadtog-pegasus-da13954c733289dbc663cfa6ccdff86a4596ceea.zip
tog-pegasus-da13954c733289dbc663cfa6ccdff86a4596ceea.tar.gz
tog-pegasus-da13954c733289dbc663cfa6ccdff86a4596ceea.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 with an authentication challenge. Files affected: ../Pegasus/Client/CIMClientRep.cpp ../Pegasus/Client/CIMExportResponseDecoder.cpp ../Pegasus/ExportClient/CIMExportClient.cpp ../Pegasus/ExportClient/CIMExportResponseDecoder.cpp
Diffstat (limited to 'src')
-rw-r--r--src/Pegasus/ExportClient/CIMExportClient.cpp13
-rw-r--r--src/Pegasus/ExportClient/CIMExportResponseDecoder.cpp13
2 files changed, 22 insertions, 4 deletions
diff --git a/src/Pegasus/ExportClient/CIMExportClient.cpp b/src/Pegasus/ExportClient/CIMExportClient.cpp
index 1baeb6f..e0c2e23 100644
--- a/src/Pegasus/ExportClient/CIMExportClient.cpp
+++ b/src/Pegasus/ExportClient/CIMExportClient.cpp
@@ -381,8 +381,9 @@ Message* CIMExportClient::_doRequest(
// Reconnect to reset the connection
// if Server response contained a Connection: Close Header
//
- if(response->getCloseConnect() == true){
- _reconnect();
+ if (response->getCloseConnect() == true){
+ _reconnect();
+ response->setCloseConnect(false);
}
@@ -475,6 +476,14 @@ Message* CIMExportClient::_doRequest(
PEG_METHOD_EXIT();
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
diff --git a/src/Pegasus/ExportClient/CIMExportResponseDecoder.cpp b/src/Pegasus/ExportClient/CIMExportResponseDecoder.cpp
index bf13a32..63def67 100644
--- a/src/Pegasus/ExportClient/CIMExportResponseDecoder.cpp
+++ b/src/Pegasus/ExportClient/CIMExportResponseDecoder.cpp
@@ -162,7 +162,7 @@ void CIMExportResponseDecoder::_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"))
{
@@ -218,7 +218,16 @@ void CIMExportResponseDecoder::_handleHTTPMessage(HTTPMessage* httpMessage)
Message* reqMessage = _authenticator->getRequestMessage();
- _encoderQueue->enqueue(reqMessage);
+ if (cimReconnect == true)
+ {
+ reqMessage->setCloseConnect(cimReconnect);
+ _outputQueue->enqueue(reqMessage);
+ }
+ else
+ {
+ _encoderQueue->enqueue(reqMessage);
+ }
+
PEG_METHOD_EXIT();
return;