node = eb64_next(node);
if (qcs->flags & QC_SF_DETACH) {
- 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_destroy(qcs);
release = 1;
}
fprintf(stderr, "%s: leaving with tx.buf.data=%lu, tx.xprt_buf.data=%lu\n",
__func__, b_data(&qcs->tx.buf), b_data(&qcs->tx.xprt_buf));
- 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;
return;
}
break;
case QUIC_FT_CONNECTION_CLOSE:
case QUIC_FT_CONNECTION_CLOSE_APP:
- /* TODO warn the mux to close the connection */
+ /* warn the mux to close the connection */
+ conn->qcc->flags |= QC_CF_CC_RECV;
+ tasklet_wakeup(conn->qcc->wait_event.tasklet);
break;
case QUIC_FT_HANDSHAKE_DONE:
if (objt_listener(ctx->conn->target))