Changeset a0d04d6 for irc.c


Ignore:
Timestamp:
2006-05-07T18:07:43Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
ecf8fa8
Parents:
64d1f45
Message:

Got rid of all GLib GIOChannel-related calls outside proxy.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r64d1f45 ra0d04d6  
    5454       
    5555        irc->fd = fd;
    56         irc->io_channel = g_io_channel_unix_new( fd );
    57 #ifdef GLIB2
    58         g_io_channel_set_encoding (irc->io_channel, NULL, NULL);
    59         g_io_channel_set_buffered (irc->io_channel, FALSE);
    60         g_io_channel_set_flags( irc->io_channel, G_IO_FLAG_NONBLOCK, NULL );
    61 #else
    62         fcntl( irc->fd, F_SETFL, O_NONBLOCK);
    63 #endif
    64         irc->r_watch_source_id = g_io_add_watch( irc->io_channel, G_IO_IN | G_IO_ERR | G_IO_HUP, bitlbee_io_current_client_read, irc );
     56        sock_make_nonblocking( irc->fd );
     57       
     58        irc->r_watch_source_id = gaim_input_add( irc->fd, GAIM_INPUT_READ, bitlbee_io_current_client_read, irc );
    6559       
    6660        irc->status = USTATUS_OFFLINE;
     
    229223                g_source_remove( irc->w_watch_source_id );
    230224       
    231         g_io_channel_unref( irc->io_channel );
    232225        irc_connection_list = g_slist_remove( irc_connection_list, irc );
    233226       
     
    600593        strcat( line, "\r\n" );
    601594       
    602         if( irc->sendbuffer != NULL ) {
     595        if( irc->sendbuffer != NULL )
     596        {
    603597                size = strlen( irc->sendbuffer ) + strlen( line );
    604598                irc->sendbuffer = g_renew ( char, irc->sendbuffer, size + 1 );
    605599                strcpy( ( irc->sendbuffer + strlen( irc->sendbuffer ) ), line );
    606600        }
    607         else
    608                 irc->sendbuffer = g_strdup(line);       
     601        else
     602        {
     603                irc->sendbuffer = g_strdup(line);
     604        }
    609605       
    610606        if( irc->w_watch_source_id == 0 )
    611         {
    612                 irc->w_watch_source_id = g_io_add_watch( irc->io_channel, G_IO_OUT, bitlbee_io_current_client_write, irc );
    613         }
     607                irc->w_watch_source_id = gaim_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc );
    614608       
    615609        return;
     
    636630                if( now )
    637631                {
    638                         bitlbee_io_current_client_write( irc->io_channel, G_IO_OUT, irc );
     632                        bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE );
    639633                }
    640634                temp = temp->next;
Note: See TracChangeset for help on using the changeset viewer.