(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.105.2.2 and 1.106

version 1.105.2.2, 2008/09/25 21:46:15 version 1.106, 2007/09/11 17:56:33
Line 49 
Line 49 
 # include <Pegasus/Common/PaseCcsid.h> # include <Pegasus/Common/PaseCcsid.h>
 #endif #endif
  
 #if defined(PEGASUS_OS_VXWORKS)  
 # define HTTP_ACCEPTOR_MAX_CONNECTIONS 2  
 #else  
 # define HTTP_ACCEPTOR_MAX_CONNECTIONS Uint32(0xFFFFFFFF)  
 //# define HTTP_ACCEPTOR_MAX_CONNECTIONS 2  
 #endif  
   
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
Line 199 
Line 192 
  
 void HTTPAcceptor::handleEnqueue(Message *message) void HTTPAcceptor::handleEnqueue(Message *message)
 { {
     Uint32 numConnections = HTTP_ACCEPTOR_MAX_CONNECTIONS;  
   
     if (!message)     if (!message)
        return;        return;
  
Line 245 
Line 236 
                {                {
                    _monitor->unsolicitSocketMessages(socket);                    _monitor->unsolicitSocketMessages(socket);
                    _rep->connections.remove(i);                    _rep->connections.remove(i);
                    numConnections = _rep->connections.size();  
                    delete connection;                    delete connection;
                    break;                    break;
                }                }
Line 262 
Line 252 
     }     }
  
     delete message;     delete message;
   
     // Re-enable connections if connection count falls below maximum.  
   
     if (_entry_index == -1 && numConnections < HTTP_ACCEPTOR_MAX_CONNECTIONS)  
     {  
         startAcceptingConnections();  
     }  
 } }
  
   
 void HTTPAcceptor::handleEnqueue() void HTTPAcceptor::handleEnqueue()
 { {
     Message* message = dequeue();     Message* message = dequeue();
Line 725 
Line 709 
  
     // Accept the connection (populate the address):     // Accept the connection (populate the address):
  
     struct sockaddr* accept_address = 0;      struct sockaddr* accept_address;
     SocketLength address_size;     SocketLength address_size;
  
     if (_connectionType == LOCAL_CONNECTION)     if (_connectionType == LOCAL_CONNECTION)
Line 797 
Line 781 
 #ifdef PEGASUS_ENABLE_IPV6 #ifdef PEGASUS_ENABLE_IPV6
         char ipBuffer[PEGASUS_INET6_ADDRSTR_LEN];         char ipBuffer[PEGASUS_INET6_ADDRSTR_LEN];
         int rc;         int rc;
         while ((rc = getnameinfo(accept_address, address_size, ipBuffer,          if ((rc = System::getNameInfo(accept_address,
             PEGASUS_INET6_ADDRSTR_LEN, 0, 0, NI_NUMERICHOST)) == EAI_AGAIN)                  address_size,
             ;                  ipBuffer,
         if (rc)                  PEGASUS_INET6_ADDRSTR_LEN,
                   0,
                   0,
                   NI_NUMERICHOST)))
         {         {
             Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,             Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
                 "HTTPAcceptor - getnameinfo() failure.  rc: $0", rc);                 "HTTPAcceptor - getnameinfo() failure.  rc: $0", rc);
Line 900 
Line 887 
  
     // Save the socket for cleanup later:     // Save the socket for cleanup later:
     connection->_entry_index = index;     connection->_entry_index = index;
     Uint32 numConnections;  
     {  
         AutoMutex autoMut(_rep->_connection_mut);         AutoMutex autoMut(_rep->_connection_mut);
         _rep->connections.append(connection);         _rep->connections.append(connection);
         numConnections = _rep->connections.size();  
     }  
   
     // Start accepting new connections when we exceeded maximum connections.  
   
     if (numConnections >= HTTP_ACCEPTOR_MAX_CONNECTIONS)  
     {  
         stopAcceptingConnections();  
     }  
 }  
   
 int HTTPAcceptor::startAcceptingConnections()  
 {  
     if ((_entry_index = _monitor->solicitSocketMessages(  
         _rep->socket,  
         SocketMessage::READ | SocketMessage::EXCEPTION,  
         getQueueId(),  
         Monitor::ACCEPTOR)) == -1)  
     {  
         return false;  
     }  
   
     return true;  
 }  
   
 void HTTPAcceptor::stopAcceptingConnections()  
 {  
     _monitor->unsolicitSocketMessages(_rep->socket);  
     _entry_index = -1;  
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.105.2.2  
changed lines
  Added in v.1.106

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2