lkml.org 
[lkml]   [2003]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: POLLRDONCE optimisation for epoll users (was: epoll and half closed TCP connections)
    Davide Libenzi wrote:
    > > To be more precise, using the POLLRDHUP patch as-is, if someone sends
    > > your program some data, then an URGent segment, then a FIN with
    > > optional data in between, your program won't notice the second data or
    > > FIN and will fail to clean up the socket.
    >
    > And why ? To me it looks fairly simple. When the FIN is received a wakeup
    > is done on the poll wait list and the following f_op->poll will fetch the
    > RDHUP flag. Then the next epoll_wait() will fetch the event and will have
    > all the info it needs to do things correctly.

    Burp.
    You're right.

    The loop failure comes when user sends URG and more data _without_ FIN.

    Then RDHUP is not set, and your loop will read up to before the URG
    and no further.

    (Normal behaviour would be to skip the URG segment and continue
    reading data after it, or to include the URG segmenet if OOBINLINE is
    set.)

    Ahem,
    -- Jamie
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:46    [W:5.816 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site