Changeset 2818


Ignore:
Timestamp:
Aug 17, 2007, 3:57:26 AM (15 years ago)
Author:
joshe
Message:

Shut down ipc server on fatal signal, not just torrent client.

Location:
trunk/daemon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/daemon.c

    r2807 r2818  
    345345        exiting = 1;
    346346        errmsg( "received fatal signal %i, attempting to exit cleanly", sig );
    347         torrent_exit( 0 );
     347        server_quit();
    348348    }
    349349    else
  • trunk/daemon/server.c

    r2784 r2818  
    187187
    188188void
     189server_quit( void )
     190{
     191    struct client * ii, * next;
     192
     193    torrent_exit( 0 );
     194    gl_exiting = 1;
     195
     196    for( ii = RB_MIN( allclients, &gl_clients ); NULL != ii; ii = next )
     197    {
     198        next = RB_NEXT( allclients, &gl_clients, ii );
     199        byebye( ii->ev, EVBUFFER_EOF, NULL );
     200    }
     201}
     202
     203void
    189204newclient( int fd, short event UNUSED, void * arg )
    190205{
     
    561576         void * arg UNUSED )
    562577{
    563     struct client * ii, * next;
    564 
    565     torrent_exit( 0 );
    566     gl_exiting = 1;
    567 
    568     for( ii = RB_MIN( allclients, &gl_clients ); NULL != ii; ii = next )
    569     {
    570         next = RB_NEXT( allclients, &gl_clients, ii );
    571         byebye( ii->ev, EVBUFFER_EOF, NULL );
    572     }
     578    server_quit();
    573579}
    574580
  • trunk/daemon/server.h

    r1806 r2818  
    3131void server_debug( int );
    3232int  server_listen( int );
     33void server_quit( void );
    3334
    3435#endif /* TR_DAEMON_SERVER_H */
Note: See TracChangeset for help on using the changeset viewer.