]> err.no Git - varnish/commit
Be more consistent about sockets and blocking/non-blocking mode:
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 26 May 2008 10:13:52 +0000 (10:13 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 26 May 2008 10:13:52 +0000 (10:13 +0000)
commitbae89f2509a2ab5d6703b544c7ff643ea25077e5
treece325728c0185410a0abae74d324f43017af6b4f
parente8c965d3a36530f5045d317b82ea416d4bead158
Be more consistent about sockets and blocking/non-blocking mode:

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: svn+ssh://projects.linpro.no/svn/varnish/trunk@2639 d4fa192b-c00b-0410-8231-f00ffab90ce4
varnish-cache/bin/varnishd/cache_acceptor.c
varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishd/mgt_child.c
varnish-cache/bin/varnishd/tcp.c