Do not close immediatly the connection if there is no bidirectional
stream opened. Schedule instead the mux timeout when this condition is
verified. On the timer expiration, the mux/connection can be freed.
qc_send(qcc);
if (qc_release_detached_streams(qcc)) {
- if (qcc_is_dead(qcc)) {
- qc_release(qcc);
- return NULL;
+ /* Schedule the mux timeout if no bidirectional streams left. */
+ if (qcc_may_expire(qcc)) {
+ qcc->task->expire = tick_add(now_ms, qcc->timeout);
+ task_queue(qcc->task);
}
}
}
qcs_destroy(qcs);
- if (qcc_is_dead(qcc)) {
- qc_release(qcc);
- return;
+
+ /* Schedule the mux timeout if no bidirectional streams left. */
+ if (qcc_may_expire(qcc)) {
+ qcc->task->expire = tick_add(now_ms, qcc->timeout);
+ task_queue(qcc->task);
}
}