version 1.71, 2005/07/01 21:29:24
|
version 1.72, 2005/08/19 00:24:32
|
|
|
"HTTPAcceptor - accept() success. Socket: $1" | "HTTPAcceptor - accept() success. Socket: $1" |
,socket); | ,socket); |
| |
// Create a new conection and add it to the connection list: |
AutoPtr<MP_Socket> mp_socket(new MP_Socket( |
|
socket, _sslcontext, _sslContextObjectLock, _exportConnection)); |
| |
AutoPtr<MP_Socket> mp_socket(new MP_Socket(socket, _sslcontext, _exportConnection)); |
// Perform the SSL handshake, if applicable. Make the socket non-blocking |
|
// for this operation so we can send it back to the Monitor's select() loop |
|
// if it takes a while. |
|
|
|
mp_socket->disableBlocking(); |
|
Sint32 socketAcceptStatus = mp_socket->accept(); |
|
mp_socket->enableBlocking(); |
| |
Sint32 retVal; |
if (socketAcceptStatus < 0) |
|
|
if (_sslcontext) |
|
{ |
|
// |
|
// For SSL connections, obtain read lock to SSLContext object before |
|
// calling the accept() method of MP_Socket. |
|
// |
|
ReadLock rlock(*_sslContextObjectLock); |
|
retVal = mp_socket->accept(); |
|
} |
|
else |
|
{ |
|
retVal = mp_socket->accept(); |
|
} |
|
|
|
if (retVal < 0) |
|
{ | { |
PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL2, | PEG_TRACE_STRING(TRC_DISCARDED_DATA, Tracer::LEVEL2, |
"HTTPAcceptor: SSL_accept() failed"); | "HTTPAcceptor: SSL_accept() failed"); |
|
|
return; | return; |
} | } |
| |
|
// Create a new connection and add it to the connection list: |
|
|
HTTPConnection* connection = new HTTPConnection(_monitor, mp_socket, | HTTPConnection* connection = new HTTPConnection(_monitor, mp_socket, |
this, static_cast<MessageQueue *>(_outputMessageQueue), _exportConnection); | this, static_cast<MessageQueue *>(_outputMessageQueue), _exportConnection); |
| |
|
if (socketAcceptStatus == 0) |
|
{ |
|
PEG_TRACE_STRING(TRC_HTTP, Tracer::LEVEL2, |
|
"HTTPAcceptor: SSL_accept() pending"); |
|
connection->_acceptPending = true; |
|
} |
|
|
// Solicit events on this new connection's socket: | // Solicit events on this new connection's socket: |
int index; | int index; |
| |