version 1.127, 2008/11/18 01:20:51
|
version 1.128, 2008/11/26 08:06:38
|
|
|
| |
static int _maxConnectionQueueLength = -1; | static int _maxConnectionQueueLength = -1; |
| |
|
Uint32 HTTPAcceptor::_socketWriteTimeout = |
|
PEGASUS_DEFAULT_SOCKETWRITE_TIMEOUT_SECONDS; |
|
|
|
#ifndef PEGASUS_INTEGERS_BOUNDARY_ALIGNED |
|
Mutex HTTPAcceptor::_socketWriteTimeoutMutex; |
|
#endif |
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
// HTTPAcceptorRep | // HTTPAcceptorRep |
|
|
_connectionType(connectionType), | _connectionType(connectionType), |
_portNumber(portNumber), | _portNumber(portNumber), |
_sslcontext(sslcontext), | _sslcontext(sslcontext), |
_sslContextObjectLock(sslContextObjectLock), |
_sslContextObjectLock(sslContextObjectLock) |
_idleConnectionTimeoutSeconds(0) |
|
{ | { |
PEGASUS_ASSERT(!_sslcontext == !_sslContextObjectLock); | PEGASUS_ASSERT(!_sslcontext == !_sslContextObjectLock); |
Socket::initializeInterface(); | Socket::initializeInterface(); |
|
|
| |
void HTTPAcceptor::setSocketWriteTimeout(Uint32 socketWriteTimeout) | void HTTPAcceptor::setSocketWriteTimeout(Uint32 socketWriteTimeout) |
{ | { |
|
#ifndef PEGASUS_INTEGERS_BOUNDARY_ALIGNED |
|
AutoMutex lock(_socketWriteTimeoutMutex); |
|
#endif |
_socketWriteTimeout = socketWriteTimeout; | _socketWriteTimeout = socketWriteTimeout; |
} | } |
| |
void HTTPAcceptor::setIdleConnectionTimeout(Uint32 idleConnectionTimeoutSeconds) |
|
{ |
|
_idleConnectionTimeoutSeconds = idleConnectionTimeoutSeconds; |
|
} |
|
|
|
void HTTPAcceptor::unbind() | void HTTPAcceptor::unbind() |
{ | { |
if (_rep) | if (_rep) |
|
|
socketPtr.release(); | socketPtr.release(); |
| |
mp_socket->disableBlocking(); | mp_socket->disableBlocking(); |
|
|
|
{ |
|
#ifndef PEGASUS_INTEGERS_BOUNDARY_ALIGNED |
|
AutoMutex lock(_socketWriteTimeoutMutex); |
|
#endif |
mp_socket->setSocketWriteTimeout(_socketWriteTimeout); | mp_socket->setSocketWriteTimeout(_socketWriteTimeout); |
|
} |
| |
// Perform the SSL handshake, if applicable. | // Perform the SSL handshake, if applicable. |
| |
|
|
this, | this, |
_outputMessageQueue)); | _outputMessageQueue)); |
| |
if (_idleConnectionTimeoutSeconds) |
if (HTTPConnection::getIdleConnectionTimeout()) |
{ | { |
connection->_idleConnectionTimeoutSeconds = |
|
_idleConnectionTimeoutSeconds; |
|
Time::gettimeofday(&connection->_idleStartTime); | Time::gettimeofday(&connection->_idleStartTime); |
} | } |
| |