Do not close a client connection too early!
@@ -3792,8 +3792,16 @@ int picoquic_prepare_next_packet(picoquic_quic_t* quic,
fflush(cnx->f_binlog);
}
+ if (cnx->client_mode) {
+ /* Do not unilaterally delete the connection context, as it was set by the application */
+ picoquic_reinsert_by_wake_time(cnx->quic, cnx, UINT64_MAX);
+ SET_LAST_WAKE(cnx->quic, PICOQUIC_SENDER);
+
+ }
+ else {
picoquic_delete_cnx(cnx);
}
+ }
else {
if (*if_index == -1) {
*if_index = picoquic_get_local_if_index(cnx);
