const QUIC_TERMINATE_CAUSE *tcause,
int force_immediate)
{
+ /* No point sending anything if we haven't sent anything yet. */
+ if (!ch->have_sent_any_pkt)
+ force_immediate = 1;
+
switch (ch->state) {
default:
case QUIC_CHANNEL_STATE_IDLE:
const char *ft_str = NULL;
const char *ft_str_pfx = " (", *ft_str_sfx = ")";
+ if (ch->protocol_error)
+ /* Only the first call to this function matters. */
+ return;
+
if (err_str == NULL) {
err_str = "";
err_str_pfx = "";
tcause.reason = reason;
tcause.reason_len = strlen(reason);
+ ch->protocol_error = 1;
ch_start_terminating(ch, &tcause, 0);
}
/* Permanent net error encountered */
unsigned int net_error : 1;
+ /*
+ * Protocol error encountered. Note that you should refer to the state field
+ * rather than this. This is only used so we can ignore protocol errors
+ * after the first protocol error, but still record the first protocol error
+ * if it happens during the TERMINATING state.
+ */
+ unsigned int protocol_error : 1;
+
/* Inhibit tick for testing purposes? */
unsigned int inhibit_tick : 1;