Changeset 616
- Timestamp:
- 08/14/06 23:13:49 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/branches/nepenthes-experimental/configure.ac
r562 r616 728 728 modules/log-irc/Makefile 729 729 modules/module-portwatch/Makefile 730 modules/module-peiros/Makefile 730 731 modules/submit-file/Makefile 731 732 modules/submit-gotek/Makefile nepenthes/branches/nepenthes-experimental/modules/Makefile.am
r536 r616 12 12 vuln-sub7 vuln-upnp vuln-veritas vuln-wins vuln-dameware vuln-ssh \ 13 13 module-portwatch \ 14 module-peiros \ 14 15 dnsresolve-adns \ 15 16 x-1 x-2 x-3 x-4 x-5 x-6 \ nepenthes/branches/nepenthes-experimental/nepenthes-core/src/SocketManager.cpp
r542 r616 185 185 bool SocketManager::doLoop(uint32_t polltimeout) 186 186 { 187 list <Socket *>::iterator itSocket; 188 189 // check socket timeouts and remove dead sockets 190 for (itSocket = m_Sockets.begin();itSocket != m_Sockets.end(); itSocket++) 191 { 192 (*itSocket)->checkTimeout(); 193 if ((*itSocket)->getStatus() == SS_TIMEOUT ) 194 { 195 logDebug("Deleting Socket %s due to timeout \n",(*itSocket)->getDescription().c_str()); 196 Socket *delsocket = *itSocket; 187 list <Socket *>::iterator itSocket, itNext; 188 189 // check socket timeouts and remove dead sockets 190 for (itSocket = m_Sockets.begin();itSocket != m_Sockets.end(); itSocket = itNext) 191 { 192 itNext = itSocket; 193 ++itNext; 194 195 (* itSocket)->checkTimeout(); 196 197 if((* itSocket)->getStatus() == SS_TIMEOUT) 198 { 199 logDebug("Deleting Socket %s due to timeout\n", (* itSocket)->getDescription().c_str()); 200 201 delete * itSocket; 197 202 m_Sockets.erase(itSocket); 198 delete delsocket; 199 200 itSocket = m_Sockets.begin(); // FIXME ? 201 if(m_Sockets.size() == 0) 203 204 if(m_Sockets.empty()) 202 205 return false; 206 } 207 else if((*itSocket)->getStatus() == SS_CLOSED) 208 { 209 logDebug("Deleting %s due to closed connection \n", (* itSocket)->getDescription().c_str()); 203 210 204 205 } 206 207 if ( (*itSocket)->getStatus() == SS_CLOSED ) 208 { 209 logDebug("Deleting %s due to closed connection \n",(*itSocket)->getDescription().c_str()); 210 Socket *delsocket = *itSocket; 211 delete * itSocket; 211 212 m_Sockets.erase(itSocket); 212 delete delsocket; 213 itSocket = m_Sockets.begin(); // FIXME ? 214 } 215 } 216 217 pollfd *polls = (pollfd *) malloc( (m_Sockets.size())* sizeof(pollfd)); 218 memset(polls,0,(m_Sockets.size())* sizeof(pollfd)); 219 int32_t i=0; 220 for (itSocket = m_Sockets.begin();itSocket != m_Sockets.end(); itSocket++) 213 } 214 } 215 216 pollfd * polls = (pollfd *) malloc(m_Sockets.size() * sizeof(pollfd)); 217 218 int32_t i = 0; 219 220 for(itSocket = m_Sockets.begin();itSocket != m_Sockets.end(); itSocket++) 221 221 { 222 222 int32_t iError = 0; 223 223 int32_t iSize = sizeof(iError); 224 224 225 if((*itSocket)->getType() & ST_FILE) 225 226 {
