serverspy/src/serverspy.cxx
void ClientDescriptor::RemoveClient(ClientDescriptor *p) {
    ClientDescriptor *prev = NULL;
    ClientDescriptor *cur  = sd_list;
    while(cur != NULL) {
        if(p==cur) {
            if (m_NumberClients > 0) {
                m_NumberClients--;
            }
            if (cur->m_Type != -1) {
                LogConnectionEvent( cur, 0 );
            }
            closesocket(cur->m_ClientSocket);
            closesocket(cur->m_ServerSocket);
            if(prev == NULL)
                sd_list = cur->m_Next;
            else
                prev->m_Next = cur->m_Next;
            if(sd_list_last == cur)
                sd_list_last = prev;
            delete cur;
            return;
        }
        prev = cur;
        cur  = cur->m_Next;
    }
}
//------------------------------------------------------------------------------
// This function will remove client with the given address
//------------------------------------------------------------------------------
This function will remove client with the given address
This function will remove client with the given address
void ClientDescriptor::RemoveClient(ClientDescriptor *p) {
    ClientDescriptor *prev = NULL;
    ClientDescriptor *cur  = sd_list;
    while(cur != NULL) {
        if(p==cur) {
            if (m_NumberClients > 0) {
                m_NumberClients--;
            }
            if (cur->m_Type != -1) {
                LogConnectionEvent( cur, 0 );
            }
            closesocket(cur->m_ClientSocket);
            closesocket(cur->m_ServerSocket);
            if(prev == NULL)
                sd_list = cur->m_Next;
            else
                prev->m_Next = cur->m_Next;
            if(sd_list_last == cur)
                sd_list_last = prev;
            delete cur;
            return;
        }
        prev = cur;
        cur  = cur->m_Next;
    }
}
void ClientDescriptor :: RemoveClient ( ClientDescriptor * p ) { ClientDescriptor * prev = NULL ; ClientDescriptor * cur = sd_list ; while ( cur != NULL ) { if ( p == cur ) { if ( m_NumberClients > 0 ) { m_NumberClients -- ; } if ( cur -> m_Type != -1 ) { LogConnectionEvent ( cur , 0 ) ; } closesocket ( cur -> m_ClientSocket ) ; closesocket ( cur -> m_ServerSocket ) ; if ( prev == NULL ) sd_list = cur -> m_Next ; else prev -> m_Next = cur -> m_Next ; if ( sd_list_last == cur ) sd_list_last = prev ; delete cur ; return ; } prev = cur ; cur = cur -> m_Next ; } }
This function will remove client with the given address
This function will remove client with the given address