Mercurial > hg > nginx-quic
comparison src/core/ngx_connection.c @ 8597:486c6a9be111 quic
QUIC: store QUIC connection fd in stream fake connection.
Previously it had -1 as fd. This fixes proxying, which relies on downstream
connection having a real fd. Also, this reduces diff to the default branch for
ngx_close_connection().
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Mon, 06 Sep 2021 16:59:00 +0300 |
parents | 6674a50cbb6c |
children | c2f5d79cde64 |
comparison
equal
deleted
inserted
replaced
8596:1f7f98638dc2 | 8597:486c6a9be111 |
---|---|
1183 { | 1183 { |
1184 ngx_err_t err; | 1184 ngx_err_t err; |
1185 ngx_uint_t log_error, level; | 1185 ngx_uint_t log_error, level; |
1186 ngx_socket_t fd; | 1186 ngx_socket_t fd; |
1187 | 1187 |
1188 if (c->fd == (ngx_socket_t) -1) { | |
1189 ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed"); | |
1190 return; | |
1191 } | |
1192 | |
1188 if (c->read->timer_set) { | 1193 if (c->read->timer_set) { |
1189 ngx_del_timer(c->read); | 1194 ngx_del_timer(c->read); |
1190 } | 1195 } |
1191 | 1196 |
1192 if (c->write->timer_set) { | 1197 if (c->write->timer_set) { |
1193 ngx_del_timer(c->write); | 1198 ngx_del_timer(c->write); |
1194 } | 1199 } |
1195 | 1200 |
1196 if (!c->shared && c->fd != (ngx_socket_t) -1) { | 1201 if (!c->shared) { |
1197 if (ngx_del_conn) { | 1202 if (ngx_del_conn) { |
1198 ngx_del_conn(c, NGX_CLOSE_EVENT); | 1203 ngx_del_conn(c, NGX_CLOSE_EVENT); |
1199 | 1204 |
1200 } else { | 1205 } else { |
1201 if (c->read->active || c->read->disabled) { | 1206 if (c->read->active || c->read->disabled) { |
1222 ngx_reusable_connection(c, 0); | 1227 ngx_reusable_connection(c, 0); |
1223 | 1228 |
1224 log_error = c->log_error; | 1229 log_error = c->log_error; |
1225 | 1230 |
1226 ngx_free_connection(c); | 1231 ngx_free_connection(c); |
1227 | |
1228 if (c->fd == (ngx_socket_t) -1) { | |
1229 ngx_log_debug0(NGX_LOG_DEBUG_CORE, c->log, 0, "connection has no fd"); | |
1230 return; | |
1231 } | |
1232 | 1232 |
1233 fd = c->fd; | 1233 fd = c->fd; |
1234 c->fd = (ngx_socket_t) -1; | 1234 c->fd = (ngx_socket_t) -1; |
1235 | 1235 |
1236 if (c->shared) { | 1236 if (c->shared) { |