Mercurial > hg > nginx
comparison src/core/ngx_connection.c @ 3676:4430d110293e
listen setfib=X
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 05 Jul 2010 13:49:16 +0000 |
parents | d2848db4d98e |
children | e3cb8e27e413 |
comparison
equal
deleted
inserted
replaced
3675:08d7165b6be1 | 3676:4430d110293e |
---|---|
71 ls->type = SOCK_STREAM; | 71 ls->type = SOCK_STREAM; |
72 | 72 |
73 ls->backlog = NGX_LISTEN_BACKLOG; | 73 ls->backlog = NGX_LISTEN_BACKLOG; |
74 ls->rcvbuf = -1; | 74 ls->rcvbuf = -1; |
75 ls->sndbuf = -1; | 75 ls->sndbuf = -1; |
76 | |
77 #if (NGX_HAVE_SETFIB) | |
78 ls->setfib = -1; | |
79 #endif | |
76 | 80 |
77 return ls; | 81 return ls; |
78 } | 82 } |
79 | 83 |
80 | 84 |
177 &ls[i].addr_text); | 181 &ls[i].addr_text); |
178 | 182 |
179 ls[i].sndbuf = -1; | 183 ls[i].sndbuf = -1; |
180 } | 184 } |
181 | 185 |
186 #if 0 | |
187 /* SO_SETFIB is currently a set only option */ | |
188 | |
189 #if (NGX_HAVE_SETFIB) | |
190 | |
191 if (getsockopt(ls[i].setfib, SOL_SOCKET, SO_SETFIB, | |
192 (void *) &ls[i].setfib, &olen) | |
193 == -1) | |
194 { | |
195 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno, | |
196 "getsockopt(SO_SETFIB) %V failed, ignored", | |
197 &ls[i].addr_text); | |
198 | |
199 ls[i].setfib = -1; | |
200 } | |
201 | |
202 #endif | |
203 #endif | |
204 | |
182 #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) | 205 #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) |
183 | 206 |
184 ngx_memzero(&af, sizeof(struct accept_filter_arg)); | 207 ngx_memzero(&af, sizeof(struct accept_filter_arg)); |
185 olen = sizeof(struct accept_filter_arg); | 208 olen = sizeof(struct accept_filter_arg); |
186 | 209 |
470 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno, | 493 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno, |
471 "setsockopt(SO_SNDBUF, %d) %V failed, ignored", | 494 "setsockopt(SO_SNDBUF, %d) %V failed, ignored", |
472 ls[i].sndbuf, &ls[i].addr_text); | 495 ls[i].sndbuf, &ls[i].addr_text); |
473 } | 496 } |
474 } | 497 } |
498 | |
499 #if (NGX_HAVE_SETFIB) | |
500 if (ls[i].setfib != -1) { | |
501 if (setsockopt(ls[i].fd, SOL_SOCKET, SO_SETFIB, | |
502 (const void *) &ls[i].setfib, sizeof(int)) | |
503 == -1) | |
504 { | |
505 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno, | |
506 "setsockopt(SO_SETFIB, %d) %V failed, ignored", | |
507 ls[i].setfib, &ls[i].addr_text); | |
508 } | |
509 } | |
510 #endif | |
475 | 511 |
476 #if 0 | 512 #if 0 |
477 if (1) { | 513 if (1) { |
478 int tcp_nodelay = 1; | 514 int tcp_nodelay = 1; |
479 | 515 |