Changeset 5052

Show
Ignore:
Timestamp:
12/02/07 20:51:09 (7 months ago)
Author:
morris
Message:

Drain pool on every iteration

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wired/trunk/wired/server.c

    r4843 r5052  
    314314 
    315315        while(wd_running) { 
     316                wi_pool_drain(pool); 
     317 
    316318                /* accept new user */ 
    317319                socket = wi_socket_accept_multiple(wd_control_sockets, wd_control_socket_context, 30.0, &address); 
     
    320322                        wi_log_err(WI_STR("Could not accept a connection: %m")); 
    321323                         
    322                         goto next
     324                        continue
    323325                } 
    324326                 
     
    328330                        wi_log_err(WI_STR("Could not accept a connection for %@: %m"), ip); 
    329331                         
    330                         goto next
     332                        continue
    331333                } 
    332334                 
     
    340342                if(!wi_thread_create_thread(wd_control_thread, user)) 
    341343                        wi_log_err(WI_STR("Could not create a thread for %@: %m"), ip); 
    342  
    343 next: 
    344                 if(++i % 10 == 0) 
    345                         wi_pool_drain(pool); 
    346344        } 
    347345         
     
    363361 
    364362        while(wd_running) { 
     363                wi_pool_drain(pool); 
     364 
    365365                /* accept new connection */ 
    366366                socket = wi_socket_accept_multiple(wd_transfer_sockets, wd_transfer_socket_context, 30.0, &address); 
     
    369369                        wi_log_err(WI_STR("Could not accept a connection: %m")); 
    370370                         
    371                         goto next
     371                        continue
    372372                } 
    373373                 
     
    377377                        wi_log_err(WI_STR("Could not accept a connection for %@: %m"), ip); 
    378378                         
    379                         goto next
     379                        continue
    380380                } 
    381381 
     
    386386                                wi_log_warn(WI_STR("Could not read from %@: %m"), ip); 
    387387 
    388                         goto next
     388                        continue
    389389                } 
    390390                 
     
    397397                         
    398398                        if(!transfer) 
    399                                 goto next
     399                                continue
    400400                         
    401401                        if(!wi_is_equal(ip, wd_user_ip(transfer->user))) 
    402                                 goto next
     402                                continue
    403403                         
    404404                        transfer->socket = wi_retain(socket); 
     
    408408                                wi_log_err(WI_STR("Could not create a thread for %@: %m"), ip); 
    409409                } 
    410  
    411 next: 
    412                 if(++i % 10 == 0) 
    413                         wi_pool_drain(pool); 
    414410        } 
    415411