mirror of
https://github.com/nginx/nginx.git
synced 2025-06-24 23:43:06 +08:00
QUIC: ngx_quic_send_alert() callback moved to its place.
This commit is contained in:
parent
ac851d7f69
commit
a981efe6e8
@ -837,32 +837,6 @@ ngx_quic_negotiate_version(ngx_connection_t *c, ngx_quic_header_t *inpkt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
ngx_quic_send_alert(ngx_ssl_conn_t *ssl_conn, enum ssl_encryption_level_t level,
|
|
||||||
uint8_t alert)
|
|
||||||
{
|
|
||||||
ngx_connection_t *c;
|
|
||||||
ngx_quic_connection_t *qc;
|
|
||||||
|
|
||||||
c = ngx_ssl_get_connection((ngx_ssl_conn_t *) ssl_conn);
|
|
||||||
|
|
||||||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
|
||||||
"quic ngx_quic_send_alert() level:%s alert:%d",
|
|
||||||
ngx_quic_level_name(level), (int) alert);
|
|
||||||
|
|
||||||
/* already closed on regular shutdown */
|
|
||||||
|
|
||||||
qc = ngx_quic_get_connection(c);
|
|
||||||
if (qc == NULL) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
qc->error = NGX_QUIC_ERR_CRYPTO(alert);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ngx_int_t
|
ngx_int_t
|
||||||
ngx_quic_send_stateless_reset(ngx_connection_t *c, ngx_quic_conf_t *conf,
|
ngx_quic_send_stateless_reset(ngx_connection_t *c, ngx_quic_conf_t *conf,
|
||||||
ngx_quic_header_t *pkt)
|
ngx_quic_header_t *pkt)
|
||||||
|
@ -19,9 +19,6 @@ ngx_int_t ngx_quic_output(ngx_connection_t *c);
|
|||||||
ngx_int_t ngx_quic_negotiate_version(ngx_connection_t *c,
|
ngx_int_t ngx_quic_negotiate_version(ngx_connection_t *c,
|
||||||
ngx_quic_header_t *inpkt);
|
ngx_quic_header_t *inpkt);
|
||||||
|
|
||||||
int ngx_quic_send_alert(ngx_ssl_conn_t *ssl_conn,
|
|
||||||
enum ssl_encryption_level_t level, uint8_t alert);
|
|
||||||
|
|
||||||
ngx_int_t ngx_quic_send_stateless_reset(ngx_connection_t *c,
|
ngx_int_t ngx_quic_send_stateless_reset(ngx_connection_t *c,
|
||||||
ngx_quic_conf_t *conf, ngx_quic_header_t *pkt);
|
ngx_quic_conf_t *conf, ngx_quic_header_t *pkt);
|
||||||
ngx_int_t ngx_quic_send_cc(ngx_connection_t *c);
|
ngx_int_t ngx_quic_send_cc(ngx_connection_t *c);
|
||||||
|
@ -34,6 +34,8 @@ static int ngx_quic_set_encryption_secrets(ngx_ssl_conn_t *ssl_conn,
|
|||||||
static int ngx_quic_add_handshake_data(ngx_ssl_conn_t *ssl_conn,
|
static int ngx_quic_add_handshake_data(ngx_ssl_conn_t *ssl_conn,
|
||||||
enum ssl_encryption_level_t level, const uint8_t *data, size_t len);
|
enum ssl_encryption_level_t level, const uint8_t *data, size_t len);
|
||||||
static int ngx_quic_flush_flight(ngx_ssl_conn_t *ssl_conn);
|
static int ngx_quic_flush_flight(ngx_ssl_conn_t *ssl_conn);
|
||||||
|
static int ngx_quic_send_alert(ngx_ssl_conn_t *ssl_conn,
|
||||||
|
enum ssl_encryption_level_t level, uint8_t alert);
|
||||||
static ngx_int_t ngx_quic_crypto_input(ngx_connection_t *c, ngx_chain_t *data);
|
static ngx_int_t ngx_quic_crypto_input(ngx_connection_t *c, ngx_chain_t *data);
|
||||||
|
|
||||||
|
|
||||||
@ -287,6 +289,32 @@ ngx_quic_flush_flight(ngx_ssl_conn_t *ssl_conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
ngx_quic_send_alert(ngx_ssl_conn_t *ssl_conn, enum ssl_encryption_level_t level,
|
||||||
|
uint8_t alert)
|
||||||
|
{
|
||||||
|
ngx_connection_t *c;
|
||||||
|
ngx_quic_connection_t *qc;
|
||||||
|
|
||||||
|
c = ngx_ssl_get_connection((ngx_ssl_conn_t *) ssl_conn);
|
||||||
|
|
||||||
|
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
||||||
|
"quic ngx_quic_send_alert() level:%s alert:%d",
|
||||||
|
ngx_quic_level_name(level), (int) alert);
|
||||||
|
|
||||||
|
/* already closed on regular shutdown */
|
||||||
|
|
||||||
|
qc = ngx_quic_get_connection(c);
|
||||||
|
if (qc == NULL) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
qc->error = NGX_QUIC_ERR_CRYPTO(alert);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ngx_int_t
|
ngx_int_t
|
||||||
ngx_quic_handle_crypto_frame(ngx_connection_t *c, ngx_quic_header_t *pkt,
|
ngx_quic_handle_crypto_frame(ngx_connection_t *c, ngx_quic_header_t *pkt,
|
||||||
ngx_quic_frame_t *frame)
|
ngx_quic_frame_t *frame)
|
||||||
|
Loading…
Reference in New Issue
Block a user