Changeset 1fb89e3 for skype/skype.c


Ignore:
Timestamp:
2007-08-20T22:56:56Z (17 years ago)
Author:
VMiklos <vmiklos@…>
Branches:
master
Children:
d3cbd17
Parents:
09be265
Message:

move the poll() usage to skype_write()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skype/skype.c

    r09be265 r1fb89e3  
    5858{
    5959        struct skype_data *sd = ic->proto_data;
    60 
     60        struct pollfd pfd[1];
     61
     62        pfd[0].fd = sd->fd;
     63        pfd[0].events = POLLOUT;
     64
     65        poll(pfd, 1, 1000);
     66        if(pfd[0].revents & POLLHUP)
     67        {
     68                imcb_error( ic, "Could not connect to server" );
     69                imc_logout( ic, TRUE );
     70                return FALSE;
     71        }
    6172        printf("write(): %s", buf);
    6273        write( sd->fd, buf, len );
     
    185196        int st;
    186197
     198        if(!sd)
     199                return FALSE;
     200
    187201        if( sd->r_inpa <= 0 )
    188202                sd->r_inpa = b_input_add( sd->fd, GAIM_INPUT_READ, skype_read_callback, ic );
     
    201215{
    202216        struct im_connection *ic = data;
    203         struct skype_data *sd = ic->proto_data;
    204         struct pollfd pfd[1];
    205 
    206         pfd[0].fd = sd->fd;
    207         pfd[0].events = POLLOUT;
    208 
    209         poll(pfd, 1, 1000);
    210         if(pfd[0].revents & POLLHUP)
    211         {
    212                 imcb_error( ic, "Could not connect to server" );
    213                 imc_logout( ic, TRUE );
    214                 return FALSE;
    215         }
    216217        imcb_connected(ic);
    217218        return skype_start_stream(ic);
Note: See TracChangeset for help on using the changeset viewer.