Changeset - f6e991030a70
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2010-07-31 00:56:13
ohnobinki@ohnopublishing.net
tabletennis_del_client() actually deletes the client if it's not at the front of one of the PING or PONG queues (fixing a segfault).
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/server/tabletennis.c
Show inline comments
 
@@ -162,25 +162,25 @@ int tabletennis_del_client(tabletennis_t
 
      thelist = tabletennis->clients_need_pong;
 
      break;
 

	
 
    case TABLETENNIS_DELINQUENT:
 
      thelist = NULL;
 
      break;
 
    }
 

	
 
  if(!thelist)
 
    return 0;
 

	
 
  list_traverse(thelist, (void *)client, (list_traverse_func_t)&tabletennis_del_client_traverse,
 
		LIST_FORW | LIST_FRNT | LIST_SAVE);
 
		LIST_FORW | LIST_FRNT | LIST_ALTR);
 
  if(list_curr(thelist) == client)
 
    list_remove_curr(thelist);
 

	
 
  return 0;
 
}
 

	
 
void tabletennis_free(tabletennis_t tabletennis)
 
{
 
  q_free(tabletennis->clients_to_ping, LIST_NODEALLOC);
 
  q_free(tabletennis->clients_need_pong, LIST_NODEALLOC);
 

	
 
  free(tabletennis);
0 comments (0 inline, 0 general)