{
struct quic_frame frm;
const unsigned char *pos, *end;
- int fast_retrans = 0, ret = 0;
+ int fast_retrans = 0;
TRACE_ENTER(QUIC_EV_CONN_PRSHPKT, qc);
/* Skip the AAD */
* a single QUIC packet and cannot span multiple packets.
*/
quic_set_connection_close(qc, quic_err_transport(QC_ERR_PROTOCOL_VIOLATION));
- goto leave;
+ goto err;
}
while (pos < end) {
if (!qc_parse_frm(&frm, pkt, &pos, end, qc)) {
// trace already emitted by function above
- goto leave;
+ goto err;
}
switch (frm.type) {
if (!qc_parse_ack_frm(qc, &frm, qel, &rtt_sample, &pos, end)) {
// trace already emitted by function above
- goto leave;
+ goto err;
}
if (rtt_sample != UINT_MAX) {
if (qcc_recv_stop_sending(qc->qcc, ss_frm->id,
ss_frm->app_error_code)) {
TRACE_ERROR("qcc_recv_stop_sending() failed", QUIC_EV_CONN_PRSHPKT, qc);
- goto leave;
+ goto err;
}
}
break;
}
case QUIC_FT_CRYPTO:
if (!qc_handle_crypto_frm(qc, &frm.crypto, pkt, qel, &fast_retrans))
- goto leave;
+ goto err;
break;
case QUIC_FT_NEW_TOKEN:
/* TODO */
if (!qc_h3_request_reject(qc, strm_frm->id)) {
TRACE_ERROR("error on request rejection", QUIC_EV_CONN_PRSHPKT, qc);
/* This packet will not be acknowledged */
- goto leave;
+ goto err;
}
}
else {
/* This packet will not be acknowledged */
- goto leave;
+ goto err;
}
}
if (!qc_handle_strm_frm(pkt, strm_frm, qc, fin)) {
TRACE_ERROR("qc_handle_strm_frm() failed", QUIC_EV_CONN_PRSHPKT, qc);
- goto leave;
+ goto err;
}
break;
if (qcc_recv_max_stream_data(qc->qcc, msd_frm->id,
msd_frm->max_stream_data)) {
TRACE_ERROR("qcc_recv_max_stream_data() failed", QUIC_EV_CONN_PRSHPKT, qc);
- goto leave;
+ goto err;
}
}
break;
struct quic_connection_id *conn_id = NULL;
if (!qc_handle_retire_connection_id_frm(qc, &frm, &pkt->dcid, &conn_id))
- goto leave;
+ goto err;
if (!conn_id)
break;
* error of type PROTOCOL_VIOLATION.
*/
quic_set_connection_close(qc, quic_err_transport(QC_ERR_PROTOCOL_VIOLATION));
- goto leave;
+ goto err;
}
qc->state = QUIC_HS_ST_CONFIRMED;
}
}
- ret = 1;
- leave:
TRACE_LEAVE(QUIC_EV_CONN_PRSHPKT, qc);
- return ret;
+ return 1;
+
+ err:
+ TRACE_DEVEL("leaving on error", QUIC_EV_CONN_PRSHPKT, qc);
+ return 0;
}
/* Detect the value of the spin bit to be used. */