Attachment 'varnishd.diff'
Download 1 --- varnish-3.0.0/bin/varnishd/cache_acceptor.c 2011-06-16 14:24:54.000000000 +0300
2 +++ varnish-3.0.0-uto/bin/varnishd/cache_acceptor.c 2011-08-16 20:22:59.000000000 +0300
3 @@ -35,10 +35,12 @@
4 #include <poll.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include <unistd.h>
8
9 +#include <netinet/in.h>
10 +#include <netinet/tcp.h>
11 #include <sys/uio.h>
12 #include <sys/types.h>
13 #include <sys/socket.h>
14
15 #include "vcli.h"
16 @@ -245,21 +247,30 @@
17 SO_SNDTIMEO,
18 &tv_sndtimeo, sizeof tv_sndtimeo));
19 }
20 }
21 #endif
22 -#ifdef SO_RCVTIMEO_WORKS
23 +#if defined(SO_RCVTIMEO_WORKS) || defined(TCP_SNDUTO_TIMEOUT)
24 if (params->sess_timeout != sess_timeout) {
25 need_test = 1;
26 sess_timeout = params->sess_timeout;
27 tv_rcvtimeo = TIM_timeval(sess_timeout);
28 VTAILQ_FOREACH(ls, &heritage.socks, list) {
29 if (ls->sock < 0)
30 continue;
31 +#ifdef SO_RCVTIMEO_WORKS
32 AZ(setsockopt(ls->sock, SOL_SOCKET,
33 SO_RCVTIMEO,
34 &tv_rcvtimeo, sizeof tv_rcvtimeo));
35 +#endif
36 +#ifdef TCP_SNDUTO_TIMEOUT
37 + int optval = (int)sess_timeout;
38 + AZ(setsockopt(ls->sock, IPPROTO_TCP,
39 + TCP_SNDUTO_TIMEOUT,
40 + &optval, sizeof optval));
41 +#endif
42 +
43 }
44 }
45 #endif
46 /* Bound the pacing delay by parameter */
47 if (pace > params->acceptor_sleep_max)
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.