]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: quic: Move qc_notify_send() to quic_conn
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 28 Nov 2023 13:02:17 +0000 (14:02 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 28 Nov 2023 14:47:18 +0000 (15:47 +0100)
Move qc_notify_send() from quic_tx.c to quic_conn.c. Note that it was already
exported from both quic_conn.h and quic_tx.h. Modify this latter header
to fix the duplication.

include/haproxy/quic_tx.h
src/quic_conn.c
src/quic_tx.c

index e556cce834ce27b933678c9cece547ecba658971..0659c14e368c97830e9ca60f0050aa2e97a19eef 100644 (file)
@@ -37,7 +37,6 @@ int qc_prep_hpkts(struct quic_conn *qc, struct buffer *buf, struct list *qels);
 int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx);
 int qc_send_app_pkts(struct quic_conn *qc, struct list *frms);
 int qc_dgrams_retransmit(struct quic_conn *qc);
-int qc_notify_send(struct quic_conn *qc);
 void qc_prep_hdshk_fast_retrans(struct quic_conn *qc,
                                 struct list *ifrms, struct list *hfrms);
 int send_retry(int fd, struct sockaddr_storage *addr,
index 9559eb4627145eff8f122a4830aae0b3f33b7c88..b5545976a2ace3e14160462229fe373af8a173d8 100644 (file)
@@ -1725,6 +1725,35 @@ int qc_check_dcid(struct quic_conn *qc, unsigned char *dcid, size_t dcid_len)
        return 0;
 }
 
+/* Wake-up upper layer for sending if all conditions are met :
+ * - room in congestion window or probe packet to sent
+ * - socket FD ready to sent or listener socket used
+ *
+ * Returns 1 if upper layer has been woken up else 0.
+ */
+int qc_notify_send(struct quic_conn *qc)
+{
+       const struct quic_pktns *pktns = qc->apktns;
+
+       if (qc->subs && qc->subs->events & SUB_RETRY_SEND) {
+               /* RFC 9002 7.5. Probe Timeout
+                *
+                * Probe packets MUST NOT be blocked by the congestion controller.
+                */
+               if ((quic_cc_path_prep_data(qc->path) || pktns->tx.pto_probe) &&
+                   (!qc_test_fd(qc) || !fd_send_active(qc->fd))) {
+                       tasklet_wakeup(qc->subs->tasklet);
+                       qc->subs->events &= ~SUB_RETRY_SEND;
+                       if (!qc->subs->events)
+                               qc->subs = NULL;
+
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
 /* Notify upper layer of a fatal error which forces to close the connection. */
 void qc_notify_err(struct quic_conn *qc)
 {
index 4af91b2a84be7b2284522fd9181263f8707b3e21..5ff9764a1878c9d202918cb58e33a130d016a89f 100644 (file)
@@ -2581,36 +2581,6 @@ static struct quic_tx_packet *qc_build_pkt(unsigned char **pos,
        free_quic_tx_packet(qc, pkt);
        goto leave;
 }
-
-/* Wake-up upper layer for sending if all conditions are met :
- * - room in congestion window or probe packet to sent
- * - socket FD ready to sent or listener socket used
- *
- * Returns 1 if upper layer has been woken up else 0.
- */
-int qc_notify_send(struct quic_conn *qc)
-{
-       const struct quic_pktns *pktns = qc->apktns;
-
-       if (qc->subs && qc->subs->events & SUB_RETRY_SEND) {
-               /* RFC 9002 7.5. Probe Timeout
-                *
-                * Probe packets MUST NOT be blocked by the congestion controller.
-                */
-               if ((quic_cc_path_prep_data(qc->path) || pktns->tx.pto_probe) &&
-                   (!qc_test_fd(qc) || !fd_send_active(qc->fd))) {
-                       tasklet_wakeup(qc->subs->tasklet);
-                       qc->subs->events &= ~SUB_RETRY_SEND;
-                       if (!qc->subs->events)
-                               qc->subs = NULL;
-
-                       return 1;
-               }
-       }
-
-       return 0;
-}
-
 /*
  * Local variables:
  *  c-indent-level: 8