• Poul-Henning Kamp's avatar
    Be more consistent about sockets and blocking/non-blocking mode: · 9aff164d
    Poul-Henning Kamp authored
    Accept sockets are non-blocking, to avoid races where the client closes
    before we get to accept it.  (Spotted by: "chen xiaoyong")
    
    Unfortunately, that means that session sockets inherit non-blocking mode,
    which is the opposite of what we want in the worker thread but correct
    for the acceptor thread.
    
    We prefer to have the extra syscalls in the worker thread, that complicates
    things a little bit.
    
    Use ioctl(FIONBIO) instead of fcntl(2) which is surprisingly expensive.
    
    
    git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2639 d4fa192b-c00b-0410-8231-f00ffab90ce4
    9aff164d
cache_acceptor.c 7.36 KB