version 1.101, 2005/08/14 00:54:43
|
version 1.102, 2005/08/19 00:24:32
|
|
|
_outputMessageQueue(outputMessageQueue), | _outputMessageQueue(outputMessageQueue), |
_contentOffset(-1), | _contentOffset(-1), |
_contentLength(-1), | _contentLength(-1), |
_connectionClosePending(false) |
_connectionClosePending(false), |
|
_acceptPending(false) |
{ | { |
PEG_METHOD_ENTER(TRC_HTTP, "HTTPConnection::HTTPConnection"); | PEG_METHOD_ENTER(TRC_HTTP, "HTTPConnection::HTTPConnection"); |
| |
|
|
static const char func[] = "HTTPConnection::_handleReadEvent()"; | static const char func[] = "HTTPConnection::_handleReadEvent()"; |
PEG_METHOD_ENTER(TRC_HTTP, func); | PEG_METHOD_ENTER(TRC_HTTP, func); |
| |
|
if (_acceptPending) |
|
{ |
|
PEGASUS_ASSERT(!_isClient()); |
|
|
|
Sint32 socketAcceptStatus = _socket->accept(); |
|
|
|
if (socketAcceptStatus < 0) |
|
{ |
|
PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL2, |
|
"HTTPConnection: SSL_accept() failed"); |
|
_closeConnection(); |
|
PEG_METHOD_EXIT(); |
|
return; |
|
} |
|
else if (socketAcceptStatus == 0) |
|
{ |
|
// Not enough data yet to complete the SSL handshake |
|
PEG_TRACE_STRING(TRC_HTTP, Tracer::LEVEL2, |
|
"HTTPConnection: SSL_accept() pending"); |
|
PEG_METHOD_EXIT(); |
|
return; |
|
} |
|
else |
|
{ |
|
// Add SSL verification information to the authentication info |
|
if (_socket->isSecure() && |
|
_socket->isPeerVerificationEnabled() && |
|
_socket->isCertificateVerified()) |
|
{ |
|
_authInfo->setAuthStatus(AuthenticationInfoRep::AUTHENTICATED); |
|
_authInfo->setAuthType(AuthenticationInfoRep::AUTH_TYPE_SSL); |
|
_authInfo->setClientCertificate(_socket->getPeerCertificate()); |
|
} |
|
|
|
// Go back to the select() and wait for data on the connection |
|
_acceptPending = false; |
|
PEG_METHOD_EXIT(); |
|
return; |
|
} |
|
} |
|
|
// -- Append all data waiting on socket to incoming buffer: | // -- Append all data waiting on socket to incoming buffer: |
| |
String httpStatus; | String httpStatus; |