summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2020-07-21 23:08:23 +0300
committerRoman Arutyunyan <arut@nginx.com>2020-07-21 23:08:23 +0300
commit3073ad1381c4d8f8aae4501d66497164167b2081 (patch)
treecf64dcd8cd09652aa887a727c860f67555796091
parent36f2873f6b0d8512c053935614fcc6ae9d969858 (diff)
downloadnginx-3073ad1381c4d8f8aae4501d66497164167b2081.tar.gz
nginx-3073ad1381c4d8f8aae4501d66497164167b2081.tar.bz2
QUIC: eliminated connection handler argument in ngx_quic_run().
Now c->listening->handler() is called instead.
Diffstat (limited to '')
-rw-r--r--src/event/ngx_event_quic.c15
-rw-r--r--src/event/ngx_event_quic.h3
-rw-r--r--src/http/ngx_http_request.c2
-rw-r--r--src/stream/ngx_stream_handler.c2
4 files changed, 8 insertions, 14 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c
index 16035bfb5..202c0082a 100644
--- a/src/event/ngx_event_quic.c
+++ b/src/event/ngx_event_quic.c
@@ -36,7 +36,6 @@
typedef struct {
ngx_rbtree_t tree;
ngx_rbtree_node_t sentinel;
- ngx_connection_handler_pt handler;
ngx_uint_t id_counter;
@@ -162,8 +161,7 @@ static int ngx_quic_send_alert(ngx_ssl_conn_t *ssl_conn,
static ngx_int_t ngx_quic_new_connection(ngx_connection_t *c, ngx_ssl_t *ssl,
- ngx_quic_conf_t *conf, ngx_quic_header_t *pkt,
- ngx_connection_handler_pt handler);
+ ngx_quic_conf_t *conf, ngx_quic_header_t *pkt);
static ngx_int_t ngx_quic_new_dcid(ngx_connection_t *c, ngx_str_t *odcid);
static ngx_int_t ngx_quic_retry(ngx_connection_t *c);
static ngx_int_t ngx_quic_new_token(ngx_connection_t *c, ngx_str_t *token);
@@ -587,8 +585,7 @@ ngx_quic_send_alert(ngx_ssl_conn_t *ssl_conn, enum ssl_encryption_level_t level,
void
-ngx_quic_run(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_conf_t *conf,
- ngx_connection_handler_pt handler)
+ngx_quic_run(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_conf_t *conf)
{
ngx_buf_t *b;
ngx_quic_header_t pkt;
@@ -606,7 +603,7 @@ ngx_quic_run(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_conf_t *conf,
pkt.data = b->start;
pkt.len = b->last - b->start;
- if (ngx_quic_new_connection(c, ssl, conf, &pkt, handler) != NGX_OK) {
+ if (ngx_quic_new_connection(c, ssl, conf, &pkt) != NGX_OK) {
ngx_quic_close_connection(c, NGX_ERROR);
return;
}
@@ -622,8 +619,7 @@ ngx_quic_run(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_conf_t *conf,
static ngx_int_t
ngx_quic_new_connection(ngx_connection_t *c, ngx_ssl_t *ssl,
- ngx_quic_conf_t *conf, ngx_quic_header_t *pkt,
- ngx_connection_handler_pt handler)
+ ngx_quic_conf_t *conf, ngx_quic_header_t *pkt)
{
ngx_int_t rc;
ngx_uint_t i;
@@ -708,7 +704,6 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_ssl_t *ssl,
qc->ssl = ssl;
qc->conf = conf;
qc->tp = conf->tp;
- qc->streams.handler = handler;
ctp = &qc->ctp;
ctp->max_udp_payload_size = ngx_quic_max_udp_payload(c);
@@ -2949,7 +2944,7 @@ ngx_quic_handle_stream_frame(ngx_connection_t *c, ngx_quic_header_t *pkt,
ngx_quic_handle_max_streams(c);
}
- qc->streams.handler(sn->c);
+ sn->c->listening->handler(sn->c);
if (f->offset == 0) {
return NGX_OK;
diff --git a/src/event/ngx_event_quic.h b/src/event/ngx_event_quic.h
index 151e15cc5..a56ead272 100644
--- a/src/event/ngx_event_quic.h
+++ b/src/event/ngx_event_quic.h
@@ -112,8 +112,7 @@ struct ngx_quic_stream_s {
};
-void ngx_quic_run(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_conf_t *conf,
- ngx_connection_handler_pt handler);
+void ngx_quic_run(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_conf_t *conf);
ngx_connection_t *ngx_quic_create_uni_stream(ngx_connection_t *c);
void ngx_quic_finalize_connection(ngx_connection_t *c, ngx_uint_t err,
const char *reason);
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index bfa8e11c5..9b6d461e0 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -336,7 +336,7 @@ ngx_http_init_connection(ngx_connection_t *c)
sscf = ngx_http_get_module_srv_conf(hc->conf_ctx,
ngx_http_ssl_module);
- ngx_quic_run(c, &sscf->ssl, qcf, ngx_http_init_connection);
+ ngx_quic_run(c, &sscf->ssl, qcf);
return;
}
}
diff --git a/src/stream/ngx_stream_handler.c b/src/stream/ngx_stream_handler.c
index 672de85ac..2b0848a67 100644
--- a/src/stream/ngx_stream_handler.c
+++ b/src/stream/ngx_stream_handler.c
@@ -129,7 +129,7 @@ ngx_stream_init_connection(ngx_connection_t *c)
scf = ngx_stream_get_module_srv_conf(addr_conf->ctx,
ngx_stream_ssl_module);
- ngx_quic_run(c, &scf->ssl, qcf, ngx_stream_init_connection);
+ ngx_quic_run(c, &scf->ssl, qcf);
return;
}
}