Changeset 605
- Timestamp:
- 08/08/06 01:13:31 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/trunk/nepenthes-core/include/SocketManager.hpp
r500 r605 68 68 69 69 virtual Socket *addPOLLSocket(POLLSocket *sock); 70 virtual bool removePOLLSocket(POLLSocket *sock); 70 71 71 72 bool doLoop(uint32_t polltimeout); nepenthes/trunk/nepenthes-core/src/SocketManager.cpp
r550 r605 229 229 { 230 230 // socket is dead 231 logSpam("Socket % s is Dead\n",(*itSocket)->getDescription().c_str());231 logSpam("Socket %i %s is Dead\n",(*itSocket)->getSocket(), (*itSocket)->getDescription().c_str()); 232 232 (*itSocket)->unsetPolled(); 233 233 … … 597 597 } 598 598 599 599 bool SocketManager::removePOLLSocket(POLLSocket *sock) 600 { 601 logPF(); 602 list <Socket *>::iterator it; 603 for ( it = m_Sockets.begin();it != m_Sockets.end(); it++ ) 604 { 605 if (sock == (*it)) 606 { 607 /* this is really *bad* 608 * as it may change the order of pollfd's 609 * we should replace the socket to remove with a dead dummy socket who shares the same poll flags instead, and 610 * let the poll loop remove the socket instead 611 * but this works for now, and does not make any problem, so ... 612 */ 613 m_Sockets.erase(it); 614 return true; 615 } 616 } 617 return false; 618 } 619
