mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
HTTP UDP layer, QUIC support autotest.
This commit is contained in:
parent
84510c9f1f
commit
e92cb24f40
@ -140,3 +140,12 @@ END
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ngx_feature="OpenSSL QUIC support"
|
||||||
|
ngx_feature_name="NGX_OPENSSL_QUIC"
|
||||||
|
ngx_feature_run=no
|
||||||
|
ngx_feature_incs="#include <openssl/ssl.h>"
|
||||||
|
ngx_feature_path=
|
||||||
|
ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL"
|
||||||
|
ngx_feature_test="SSL_CTX_set_quic_method(NULL, NULL)"
|
||||||
|
. auto/feature
|
||||||
|
@ -1163,7 +1163,10 @@ ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
|
|||||||
port = cmcf->ports->elts;
|
port = cmcf->ports->elts;
|
||||||
for (i = 0; i < cmcf->ports->nelts; i++) {
|
for (i = 0; i < cmcf->ports->nelts; i++) {
|
||||||
|
|
||||||
if (p != port[i].port || sa->sa_family != port[i].family) {
|
if (p != port[i].port
|
||||||
|
|| lsopt->type != port[i].type
|
||||||
|
|| sa->sa_family != port[i].family)
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1180,6 +1183,7 @@ ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
port->family = sa->sa_family;
|
port->family = sa->sa_family;
|
||||||
|
port->type = lsopt->type;
|
||||||
port->port = p;
|
port->port = p;
|
||||||
port->addrs.elts = NULL;
|
port->addrs.elts = NULL;
|
||||||
|
|
||||||
@ -1735,6 +1739,7 @@ ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ls->type = addr->opt.type;
|
||||||
ls->backlog = addr->opt.backlog;
|
ls->backlog = addr->opt.backlog;
|
||||||
ls->rcvbuf = addr->opt.rcvbuf;
|
ls->rcvbuf = addr->opt.rcvbuf;
|
||||||
ls->sndbuf = addr->opt.sndbuf;
|
ls->sndbuf = addr->opt.sndbuf;
|
||||||
|
@ -3800,6 +3800,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
ngx_memzero(&lsopt, sizeof(ngx_http_listen_opt_t));
|
ngx_memzero(&lsopt, sizeof(ngx_http_listen_opt_t));
|
||||||
|
|
||||||
lsopt.backlog = NGX_LISTEN_BACKLOG;
|
lsopt.backlog = NGX_LISTEN_BACKLOG;
|
||||||
|
lsopt.type = SOCK_STREAM;
|
||||||
lsopt.rcvbuf = -1;
|
lsopt.rcvbuf = -1;
|
||||||
lsopt.sndbuf = -1;
|
lsopt.sndbuf = -1;
|
||||||
#if (NGX_HAVE_SETFIB)
|
#if (NGX_HAVE_SETFIB)
|
||||||
@ -3821,6 +3822,11 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ngx_strcmp(value[n].data, "quic") == 0) {
|
||||||
|
lsopt.type = SOCK_DGRAM;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (ngx_strcmp(value[n].data, "bind") == 0) {
|
if (ngx_strcmp(value[n].data, "bind") == 0) {
|
||||||
lsopt.set = 1;
|
lsopt.set = 1;
|
||||||
lsopt.bind = 1;
|
lsopt.bind = 1;
|
||||||
|
@ -86,6 +86,7 @@ typedef struct {
|
|||||||
int backlog;
|
int backlog;
|
||||||
int rcvbuf;
|
int rcvbuf;
|
||||||
int sndbuf;
|
int sndbuf;
|
||||||
|
int type;
|
||||||
#if (NGX_HAVE_SETFIB)
|
#if (NGX_HAVE_SETFIB)
|
||||||
int setfib;
|
int setfib;
|
||||||
#endif
|
#endif
|
||||||
@ -266,6 +267,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ngx_int_t family;
|
ngx_int_t family;
|
||||||
|
ngx_int_t type;
|
||||||
in_port_t port;
|
in_port_t port;
|
||||||
ngx_array_t addrs; /* array of ngx_http_conf_addr_t */
|
ngx_array_t addrs; /* array of ngx_http_conf_addr_t */
|
||||||
} ngx_http_conf_port_t;
|
} ngx_http_conf_port_t;
|
||||||
|
@ -324,6 +324,10 @@ ngx_http_init_connection(ngx_connection_t *c)
|
|||||||
rev->handler = ngx_http_wait_request_handler;
|
rev->handler = ngx_http_wait_request_handler;
|
||||||
c->write->handler = ngx_http_empty_handler;
|
c->write->handler = ngx_http_empty_handler;
|
||||||
|
|
||||||
|
if (c->shared) {
|
||||||
|
rev->ready = 1;
|
||||||
|
}
|
||||||
|
|
||||||
#if (NGX_HTTP_V2)
|
#if (NGX_HTTP_V2)
|
||||||
if (hc->addr_conf->http2) {
|
if (hc->addr_conf->http2) {
|
||||||
rev->handler = ngx_http_v2_init;
|
rev->handler = ngx_http_v2_init;
|
||||||
@ -386,6 +390,10 @@ ngx_http_wait_request_handler(ngx_event_t *rev)
|
|||||||
|
|
||||||
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http wait request handler");
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http wait request handler");
|
||||||
|
|
||||||
|
if (c->shared) {
|
||||||
|
goto request;
|
||||||
|
}
|
||||||
|
|
||||||
if (rev->timedout) {
|
if (rev->timedout) {
|
||||||
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
|
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
|
||||||
ngx_http_close_connection(c);
|
ngx_http_close_connection(c);
|
||||||
@ -486,6 +494,8 @@ ngx_http_wait_request_handler(ngx_event_t *rev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
request:
|
||||||
|
|
||||||
c->log->action = "reading client request line";
|
c->log->action = "reading client request line";
|
||||||
|
|
||||||
ngx_reusable_connection(c, 0);
|
ngx_reusable_connection(c, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user