Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2007, 8:44:04 PM (16 years ago)
Author:
scheusso
Message:

corrected clientinformation::removeClient(enet event)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/ClientInformation.cc

    r444 r446  
    143143bool ClientInformation::removeClient(ENetPeer *peer){
    144144  ClientInformation *temp = this;
    145   while(temp!=0 && (temp->getPeer()->address.host!=peer->address.host || temp->getPeer()->address.port!=peer->address.port))
     145  while(temp!=0){
     146    if(!temp->head)
     147      if(temp->getPeer()->address.host==peer->address.host && temp->getPeer()->address.port==peer->address.port)
     148        break;
    146149    temp = temp->next();
     150  }
    147151  if(temp==0)
    148152    return false;
     
    159163ClientInformation *ClientInformation::findClient(int clientID, bool look_backwards){
    160164  ClientInformation *temp = this;
    161   while(temp!=0 && temp->getID()!=clientID)
     165  while(temp!=0 && temp->getID()!=clientID){
     166    if (temp->head)
     167      continue;
    162168    temp = temp->next();
     169  }
    163170  // returns 0 if nothing has been found
    164171  return temp;
Note: See TracChangeset for help on using the changeset viewer.