(file) Return to HTTPAcceptor.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/HTTPAcceptor.cpp between version 1.80 and 1.80.2.3

version 1.80, 2006/01/30 16:17:04 version 1.80.2.3, 2008/01/02 21:07:59
Line 45 
Line 45 
 //          John Alex, IBM (johnalex@us.ibm.com) for Bug#3312 //          John Alex, IBM (johnalex@us.ibm.com) for Bug#3312
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
   //NOCHKSRC
  
 #include "Config.h" #include "Config.h"
 #include "Constants.h" #include "Constants.h"
Line 169 
Line 170 
      _portNumber(portNumber),      _portNumber(portNumber),
      _sslcontext(sslcontext),      _sslcontext(sslcontext),
      _exportConnection(exportConnection),      _exportConnection(exportConnection),
      _sslContextObjectLock(sslContextObjectLock)       _sslContextObjectLock(sslContextObjectLock),
        _idleConnectionTimeoutSeconds(0)
 { {
    Socket::initializeInterface();    Socket::initializeInterface();
  
Line 382 
Line 384 
       throw BindFailedException(parms);       throw BindFailedException(parms);
    }    }
  
      Socket::disableBlocking(_rep->socket);
  
 // set the close-on-exec bit for this file handle. // set the close-on-exec bit for this file handle.
 // any unix that forks needs this bit set. // any unix that forks needs this bit set.
Line 602 
Line 605 
     return _portNumber;     return _portNumber;
 } }
  
   void HTTPAcceptor::setSocketWriteTimeout(Uint32 socketWriteTimeout)
   {
       _socketWriteTimeout = socketWriteTimeout;
   }
   
   void HTTPAcceptor::setIdleConnectionTimeout(Uint32 idleConnectionTimeoutSeconds)
   {
       _idleConnectionTimeoutSeconds = idleConnectionTimeoutSeconds;
   }
   
 void HTTPAcceptor::unbind() void HTTPAcceptor::unbind()
 { {
    if (_rep)    if (_rep)
Line 684 
Line 697 
        address_size = sizeof(struct sockaddr_in);        address_size = sizeof(struct sockaddr_in);
    }    }
  
      // It is not necessary to handle EINTR errors from this accept() call.
      // An EINTR error should not occur on a non-blocking socket.  If the
      // listen socket is blocking and EINTR occurs, the new socket connection
      // is not accepted here.
   
      // EAGAIN errors are also not handled here.  An EAGAIN error should not
      // occur after select() indicates that the listen socket is available for
      // reading.  If the accept() fails with an EAGAIN error code, a new
      // connection is not accepted here.
   
    PEGASUS_SOCKET socket = accept(_rep->socket, accept_address, &address_size);    PEGASUS_SOCKET socket = accept(_rep->socket, accept_address, &address_size);
  
    delete accept_address;    delete accept_address;
Line 726 
Line 749 
    AutoPtr<MP_Socket> mp_socket(new MP_Socket(    AutoPtr<MP_Socket> mp_socket(new MP_Socket(
        socket, _sslcontext, _sslContextObjectLock, _exportConnection));        socket, _sslcontext, _sslContextObjectLock, _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();    mp_socket->disableBlocking();
      mp_socket->setSocketWriteTimeout(_socketWriteTimeout);
   
      // Perform the SSL handshake, if applicable.
   
    Sint32 socketAcceptStatus = mp_socket->accept();    Sint32 socketAcceptStatus = mp_socket->accept();
    mp_socket->enableBlocking();  
  
    if (socketAcceptStatus < 0)    if (socketAcceptStatus < 0)
    {    {
Line 747 
Line 769 
    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 (_idleConnectionTimeoutSeconds)
      {
          connection->_idleConnectionTimeoutSeconds =
              _idleConnectionTimeoutSeconds;
          connection->_idleStartTime = TimeValue::getCurrentTime();
      }
   
    if (socketAcceptStatus == 0)    if (socketAcceptStatus == 0)
    {    {
        PEG_TRACE_STRING(TRC_HTTP, Tracer::LEVEL2,        PEG_TRACE_STRING(TRC_HTTP, Tracer::LEVEL2,
            "HTTPAcceptor: SSL_accept() pending");            "HTTPAcceptor: SSL_accept() pending");
        connection->_acceptPending = true;        connection->_acceptPending = true;
          connection->_acceptPendingStartTime = TimeValue::getCurrentTime();
    }    }
  
    // Solicit events on this new connection's socket:    // Solicit events on this new connection's socket:


Legend:
Removed from v.1.80  
changed lines
  Added in v.1.80.2.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2