Changeset c0082a6a9aa74f9b1733a8778c56d9e119363135

Show
Ignore:
Timestamp:
10/02/08 12:50:55 (8 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1202644255 +0000
git-parent:

[b1c5d1c0d4019a13bf26410084ffaa64da3143f0]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1202644255 +0000
Message:

Remove arbitrary timer in net_Write()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/network/io.c

    rbd26b5f rc0082a6  
    393393{ 
    394394    size_t i_total = 0; 
     395    struct pollfd ufd[2] = { 
     396        { .fd = fd,                           .events = POLLOUT }, 
     397        { .fd = vlc_object_waitpipe (p_this), .events = POLLIN  }, 
     398    }; 
     399 
     400    if (ufd[1].fd == -1) 
     401        return -1; 
    395402 
    396403    while( i_data > 0 ) 
    397404    { 
    398         if( p_this->b_die ) 
    399             break; 
    400  
    401         struct pollfd ufd[1]; 
    402         memset (ufd, 0, sizeof (ufd)); 
    403         ufd[0].fd = fd; 
    404         ufd[0].events = POLLOUT; 
    405  
    406         int val = poll (ufd, 1, 500); 
    407         switch (val) 
    408         { 
    409             case -1: 
    410                msg_Err (p_this, "Write error: %m"); 
    411                goto out; 
    412  
    413             case 0: 
    414                 continue; 
     405        ssize_t val; 
     406 
     407        ufd[0].revents = ufd[1].revents = 0; 
     408 
     409        if (poll (ufd, 1, -1) == -1) 
     410        { 
     411            if (errno != EINTR) 
     412            { 
     413                msg_Err (p_this, "Write error: %m"); 
     414                goto out; 
     415            } 
     416            continue; 
    415417        } 
    416418 
    417419        if ((ufd[0].revents & (POLLERR|POLLNVAL|POLLHUP)) && (i_total > 0)) 
    418             return i_total; // error will be dequeued separately on next call 
     420            break; // error will be dequeued separately on next call 
    419421 
    420422        if (p_vs != NULL)