mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-24 20:08:01 +00:00
MINOR: quic: handle CONNECTION_CLOSE frame
On receiving CONNECTION_CLOSE frame, the mux is flagged for immediate connection close. A stream is closed even if there is data not ACKed left if CONNECTION_CLOSE has been received.
This commit is contained in:
parent
1e308ffc79
commit
493bb1db10
@ -77,6 +77,8 @@
|
|||||||
/* other flags */
|
/* other flags */
|
||||||
#define QC_CF_IS_BACK 0x00008000 // this is an outgoing connection
|
#define QC_CF_IS_BACK 0x00008000 // this is an outgoing connection
|
||||||
|
|
||||||
|
#define QC_CF_CC_RECV 0x00010000 // CONNECTION_CLOSE received
|
||||||
|
|
||||||
extern struct pool_head *pool_head_qcs;
|
extern struct pool_head *pool_head_qcs;
|
||||||
|
|
||||||
/* Stream types */
|
/* Stream types */
|
||||||
|
@ -1498,14 +1498,18 @@ static void qc_detach(struct conn_stream *cs)
|
|||||||
struct qcc *qcc = qcs->qcc;
|
struct qcc *qcc = qcs->qcc;
|
||||||
|
|
||||||
TRACE_ENTER(QC_EV_STRM_END, qcs ? qcs->qcc->conn : NULL, qcs);
|
TRACE_ENTER(QC_EV_STRM_END, qcs ? qcs->qcc->conn : NULL, qcs);
|
||||||
if (b_data(&qcs->tx.buf) || b_data(&qcs->tx.xprt_buf)) {
|
if (b_data(&qcs->tx.buf) ||
|
||||||
|
(b_data(&qcs->tx.xprt_buf) && !(qcc->flags & QC_CF_CC_RECV))) {
|
||||||
qcs->flags |= QC_SF_DETACH;
|
qcs->flags |= QC_SF_DETACH;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
qcs_destroy(qcs);
|
qcs_destroy(qcs);
|
||||||
if (qcc_is_dead(qcc))
|
if (qcc_is_dead(qcc)) {
|
||||||
qc_release(qcc);
|
qc_release(qcc);
|
||||||
|
TRACE_LEAVE(QC_EV_STRM_END, NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
TRACE_LEAVE(QC_EV_STRM_END, qcs ? qcs->qcc->conn : NULL);
|
TRACE_LEAVE(QC_EV_STRM_END, qcs ? qcs->qcc->conn : NULL);
|
||||||
|
@ -2040,6 +2040,7 @@ static int qc_parse_pkt_frms(struct quic_rx_packet *pkt, struct ssl_sock_ctx *ct
|
|||||||
break;
|
break;
|
||||||
case QUIC_FT_CONNECTION_CLOSE:
|
case QUIC_FT_CONNECTION_CLOSE:
|
||||||
case QUIC_FT_CONNECTION_CLOSE_APP:
|
case QUIC_FT_CONNECTION_CLOSE_APP:
|
||||||
|
conn->qcc->flags |= QC_CF_CC_RECV;
|
||||||
break;
|
break;
|
||||||
case QUIC_FT_HANDSHAKE_DONE:
|
case QUIC_FT_HANDSHAKE_DONE:
|
||||||
if (objt_listener(ctx->conn->target))
|
if (objt_listener(ctx->conn->target))
|
||||||
|
Loading…
Reference in New Issue
Block a user