mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Merge 90f6d08939
into ecb809305e
This commit is contained in:
commit
956a8d29df
@ -65,7 +65,7 @@ syn match ngxListenComment '#.*$'
|
||||
\ contained
|
||||
\ nextgroup=@ngxListenParams skipwhite skipempty
|
||||
syn keyword ngxListenOptions contained
|
||||
\ default_server ssl quic proxy_protocol
|
||||
\ default_server ssl quic proxy_protocol multipath
|
||||
\ setfib fastopen backlog rcvbuf sndbuf accept_filter deferred bind
|
||||
\ ipv6only reuseport so_keepalive
|
||||
\ nextgroup=@ngxListenParams skipwhite skipempty
|
||||
|
@ -487,7 +487,8 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
|
||||
continue;
|
||||
}
|
||||
|
||||
s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type, 0);
|
||||
s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type,
|
||||
+ ls[i].protocol);
|
||||
|
||||
if (s == (ngx_socket_t) -1) {
|
||||
ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
|
||||
|
@ -24,6 +24,7 @@ struct ngx_listening_s {
|
||||
ngx_str_t addr_text;
|
||||
|
||||
int type;
|
||||
int protocol;
|
||||
|
||||
int backlog;
|
||||
int rcvbuf;
|
||||
|
@ -1845,6 +1845,7 @@ ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
|
||||
#endif
|
||||
|
||||
ls->type = addr->opt.type;
|
||||
ls->protocol = addr->opt.protocol;
|
||||
ls->backlog = addr->opt.backlog;
|
||||
ls->rcvbuf = addr->opt.rcvbuf;
|
||||
ls->sndbuf = addr->opt.sndbuf;
|
||||
|
@ -4059,6 +4059,13 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef IPPROTO_MPTCP
|
||||
if (ngx_strcmp(value[n].data, "multipath") == 0) {
|
||||
lsopt.protocol = IPPROTO_MPTCP;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ngx_strncmp(value[n].data, "backlog=", 8) == 0) {
|
||||
lsopt.backlog = ngx_atoi(value[n].data + 8, value[n].len - 8);
|
||||
lsopt.set = 1;
|
||||
@ -4348,6 +4355,12 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef IPPROTO_MPTCP
|
||||
if (lsopt.protocol == IPPROTO_MPTCP) {
|
||||
return "\"multipath\" parameter is incompatible with \"quic\"";
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (NGX_HTTP_V2)
|
||||
if (lsopt.http2) {
|
||||
return "\"http2\" parameter is incompatible with \"quic\"";
|
||||
|
@ -88,6 +88,7 @@ typedef struct {
|
||||
int rcvbuf;
|
||||
int sndbuf;
|
||||
int type;
|
||||
int protocol;
|
||||
#if (NGX_HAVE_SETFIB)
|
||||
int setfib;
|
||||
#endif
|
||||
|
@ -332,6 +332,7 @@ ngx_mail_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
|
||||
ls->log.data = &ls->addr_text;
|
||||
ls->log.handler = ngx_accept_log_error;
|
||||
|
||||
ls->protocol = addr[i].opt.protocol;
|
||||
ls->backlog = addr[i].opt.backlog;
|
||||
ls->rcvbuf = addr[i].opt.rcvbuf;
|
||||
ls->sndbuf = addr[i].opt.sndbuf;
|
||||
|
@ -47,6 +47,7 @@ typedef struct {
|
||||
int tcp_keepintvl;
|
||||
int tcp_keepcnt;
|
||||
#endif
|
||||
int protocol;
|
||||
int backlog;
|
||||
int rcvbuf;
|
||||
int sndbuf;
|
||||
|
@ -468,6 +468,13 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef IPPROTO_MPTCP
|
||||
if (ngx_strcmp(value[i].data, "multipath") == 0) {
|
||||
ls->protocol = IPPROTO_MPTCP;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ngx_strncmp(value[i].data, "so_keepalive=", 13) == 0) {
|
||||
|
||||
if (ngx_strcmp(&value[i].data[13], "on") == 0) {
|
||||
|
@ -1010,6 +1010,7 @@ ngx_stream_add_listening(ngx_conf_t *cf, ngx_stream_conf_addr_t *addr)
|
||||
ls->log.handler = ngx_accept_log_error;
|
||||
|
||||
ls->type = addr->opt.type;
|
||||
ls->protocol = addr[i].opt.protocol;
|
||||
ls->backlog = addr->opt.backlog;
|
||||
ls->rcvbuf = addr->opt.rcvbuf;
|
||||
ls->sndbuf = addr->opt.sndbuf;
|
||||
|
@ -62,6 +62,7 @@ typedef struct {
|
||||
int rcvbuf;
|
||||
int sndbuf;
|
||||
int type;
|
||||
int protocol;
|
||||
#if (NGX_HAVE_SETFIB)
|
||||
int setfib;
|
||||
#endif
|
||||
|
@ -984,6 +984,13 @@ ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef IPPROTO_MPTCP
|
||||
if (ngx_strcmp(value[i].data, "multipath") == 0) {
|
||||
lsopt.protocol = IPPROTO_MPTCP;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ngx_strncmp(value[i].data, "backlog=", 8) == 0) {
|
||||
lsopt.backlog = ngx_atoi(value[i].data + 8, value[i].len - 8);
|
||||
lsopt.set = 1;
|
||||
@ -1252,6 +1259,12 @@ ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef IPPROTO_MPTCP
|
||||
if (lsopt.protocol == IPPROTO_MPTCP) {
|
||||
return "\"multipath\" parameter is incompatible with \"udp\"";
|
||||
}
|
||||
#endif
|
||||
|
||||
for (n = 0; n < u.naddrs; n++) {
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user