MINOR: mux-quic: simplify return path of qc_send()

Remove the unnecessary err label for qc_send(). Anyway, this label
cannot be used once some frames are sent because there is no cleanup
part for it.

This should be backported up to 2.7.
This commit is contained in:
Amaury Denoyelle 2023-05-10 11:59:10 +02:00
parent b35e32e43b
commit 2ad41b8629

View File

@ -1701,7 +1701,7 @@ static int qc_send_frames(struct qcc *qcc, struct list *frms)
return 0; return 0;
err: err:
TRACE_LEAVE(QMUX_EV_QCC_SEND, qcc->conn); TRACE_DEVEL("leaving on error", QMUX_EV_QCC_SEND, qcc->conn);
return 1; return 1;
} }
@ -1904,14 +1904,13 @@ static int qc_send(struct qcc *qcc)
quic_set_connection_close(qcc->conn->handle.qc, qcc->err); quic_set_connection_close(qcc->conn->handle.qc, qcc->err);
qcc->flags |= QC_CF_ERRL_DONE; qcc->flags |= QC_CF_ERRL_DONE;
} }
TRACE_DEVEL("connection on error", QMUX_EV_QCC_SEND, qcc->conn); goto out;
goto err;
} }
if (qcc->conn->flags & CO_FL_SOCK_WR_SH) { if (qcc->conn->flags & CO_FL_SOCK_WR_SH) {
qcc->conn->flags |= CO_FL_ERROR; qcc->conn->flags |= CO_FL_ERROR;
TRACE_DEVEL("connection on error", QMUX_EV_QCC_SEND, qcc->conn); TRACE_DEVEL("connection on error", QMUX_EV_QCC_SEND, qcc->conn);
goto err; goto out;
} }
if (!LIST_ISEMPTY(&qcc->lfctl.frms)) { if (!LIST_ISEMPTY(&qcc->lfctl.frms)) {
@ -1922,7 +1921,7 @@ static int qc_send(struct qcc *qcc)
} }
if (qcc->flags & QC_CF_BLK_MFCTL) if (qcc->flags & QC_CF_BLK_MFCTL)
goto err; goto out;
/* Send STREAM/STOP_SENDING/RESET_STREAM data for registered streams. */ /* Send STREAM/STOP_SENDING/RESET_STREAM data for registered streams. */
list_for_each_entry_safe(qcs, qcs_tmp, &qcc->send_list, el_send) { list_for_each_entry_safe(qcs, qcs_tmp, &qcc->send_list, el_send) {
@ -1941,7 +1940,7 @@ static int qc_send(struct qcc *qcc)
*/ */
if (qcs->flags & QC_SF_TO_STOP_SENDING) { if (qcs->flags & QC_SF_TO_STOP_SENDING) {
if (qcs_send_stop_sending(qcs)) if (qcs_send_stop_sending(qcs))
goto out; goto sent_done;
/* Remove stream from send_list if it had only STOP_SENDING /* Remove stream from send_list if it had only STOP_SENDING
* to send. * to send.
@ -1954,7 +1953,7 @@ static int qc_send(struct qcc *qcc)
if (qcs->flags & QC_SF_TO_RESET) { if (qcs->flags & QC_SF_TO_RESET) {
if (qcs_send_reset(qcs)) if (qcs_send_reset(qcs))
goto out; goto sent_done;
/* RFC 9000 3.3. Permitted Frame Types /* RFC 9000 3.3. Permitted Frame Types
* *
@ -2015,7 +2014,7 @@ static int qc_send(struct qcc *qcc)
} }
} }
out: sent_done:
/* Deallocate frames that the transport layer has rejected. */ /* Deallocate frames that the transport layer has rejected. */
if (!LIST_ISEMPTY(&frms)) { if (!LIST_ISEMPTY(&frms)) {
struct quic_frame *frm, *frm2; struct quic_frame *frm, *frm2;
@ -2035,12 +2034,9 @@ static int qc_send(struct qcc *qcc)
tasklet_wakeup(qcc->wait_event.tasklet); tasklet_wakeup(qcc->wait_event.tasklet);
} }
out:
TRACE_LEAVE(QMUX_EV_QCC_SEND, qcc->conn); TRACE_LEAVE(QMUX_EV_QCC_SEND, qcc->conn);
return total; return total;
err:
TRACE_LEAVE(QMUX_EV_QCC_SEND, qcc->conn);
return 0;
} }
/* Proceed on receiving. Loop through all streams from <qcc> and use decode_qcs /* Proceed on receiving. Loop through all streams from <qcc> and use decode_qcs