Changeset bd9b00f


Ignore:
Timestamp:
2006-01-19T17:07:47Z (19 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
5424c76
Parents:
2face62
Message:

Fixes for single-process daemon mode, changed value of USTATUS_SHUTDOWN. If
this still causes problems, shutting down should be an extra flag instead of
a status code.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ipc.c

    r2face62 rbd9b00f  
    3636        struct bitlbee_child *child = (void*) data;
    3737       
    38         child->host = g_strdup( cmd[1] );
    39         child->nick = g_strdup( cmd[2] );
    40         child->realname = g_strdup( cmd[3] );
     38        if( child )
     39        {
     40                child->host = g_strdup( cmd[1] );
     41                child->nick = g_strdup( cmd[2] );
     42                child->realname = g_strdup( cmd[3] );
     43        }
    4144       
    4245        ipc_to_children_str( "OPERMSG :Client connecting (PID=%d): %s@%s (%s)\r\n",
    43                              child->pid, child->nick, child->host, child->realname );
     46                             child ? child->pid : -1, cmd[2], cmd[1], cmd[3] );
    4447       
    4548        return 1;
     
    308311        else if( global.conf->runmode == RUNMODE_DAEMON )
    309312        {
    310                 char **cmd;
     313                char **cmd, *s;
     314               
     315                if( ( s = strchr( msg_buf, '\r' ) ) )
     316                        *s = 0;
    311317               
    312318                cmd = irc_parse_line( msg_buf );
     
    361367        else if( global.conf->runmode == RUNMODE_DAEMON )
    362368        {
    363                 char **cmd;
     369                char **cmd, *s;
     370               
     371                if( ( s = strchr( msg_buf, '\r' ) ) )
     372                        *s = 0;
    364373               
    365374                cmd = irc_parse_line( msg_buf );
  • irc.c

    r2face62 rbd9b00f  
    188188                        irc_usermsg( irc, "Error while saving settings!" );
    189189       
     190        closesocket( irc->fd );
     191       
    190192        if( irc->ping_source_id > 0 )
    191193                g_source_remove( irc->ping_source_id );
     
    694696        irc_usermsg( irc, "Welcome to the BitlBee gateway!\n\nIf you've never used BitlBee before, please do read the help information using the \x02help\x02 command. Lots of FAQ's are answered there." );
    695697       
    696         if( global.conf->runmode == RUNMODE_FORKDAEMON )
     698        if( global.conf->runmode == RUNMODE_FORKDAEMON || global.conf->runmode == RUNMODE_DAEMON )
    697699                ipc_to_master_str( "CLIENT %s %s :%s\r\n", irc->host, irc->nick, irc->realname );
    698700       
  • irc.h

    r2face62 rbd9b00f  
    4141typedef enum
    4242{
    43         USTATUS_OFFLINE,
     43        USTATUS_OFFLINE = 0,
    4444        USTATUS_AUTHORIZED,
    4545        USTATUS_LOGGED_IN,
    4646        USTATUS_IDENTIFIED,
    47         USTATUS_SHUTDOWN
     47        USTATUS_SHUTDOWN = -1
    4848} irc_status_t;
    4949
Note: See TracChangeset for help on using the changeset viewer.