]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: remove unused xprt rcv_buf operation
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 9 Feb 2022 14:39:35 +0000 (15:39 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 9 Feb 2022 14:57:41 +0000 (15:57 +0100)
rcv_buf and the implement quic_conn_to_buf is not used. recvfrom instead
is called on the listener polling task via quic_sock_fd_iocb.

src/xprt_quic.c

index eee9bae516f00cbd04e07afd0b384d940ef3069b..7ad4382a2a3d7e22b27c455a620f9281633cdac8 100644 (file)
@@ -5143,61 +5143,6 @@ static struct quic_tx_packet *qc_build_pkt(unsigned char **pos,
        return NULL;
 }
 
-/* Copy up to <count> bytes from connection <conn> internal stream storage into buffer <buf>.
- * Return the number of bytes which have been copied.
- */
-static size_t quic_conn_to_buf(struct connection *conn, void *xprt_ctx,
-                               struct buffer *buf, size_t count, int flags)
-{
-       size_t try, done = 0;
-
-       if (!conn_ctrl_ready(conn))
-               return 0;
-
-       if (!fd_recv_ready(conn->handle.fd))
-               return 0;
-
-       conn->flags &= ~CO_FL_WAIT_ROOM;
-
-       /* read the largest possible block. For this, we perform only one call
-        * to recv() unless the buffer wraps and we exactly fill the first hunk,
-        * in which case we accept to do it once again.
-        */
-       while (count > 0) {
-               try = b_contig_space(buf);
-               if (!try)
-                       break;
-
-               if (try > count)
-                       try = count;
-
-               b_add(buf, try);
-               done += try;
-               count -= try;
-       }
-
-       if (unlikely(conn->flags & CO_FL_WAIT_L4_CONN) && done)
-               conn->flags &= ~CO_FL_WAIT_L4_CONN;
-
- leave:
-       return done;
-
- read0:
-       conn_sock_read0(conn);
-       conn->flags &= ~CO_FL_WAIT_L4_CONN;
-
-       /* Now a final check for a possible asynchronous low-level error
-        * report. This can happen when a connection receives a reset
-        * after a shutdown, both POLL_HUP and POLL_ERR are queued, and
-        * we might have come from there by just checking POLL_HUP instead
-        * of recv()'s return value 0, so we have no way to tell there was
-        * an error without checking.
-        */
-       if (unlikely(fdtab[conn->handle.fd].state & FD_POLL_ERR))
-               conn->flags |= CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_SOCK_WR_SH;
-       goto leave;
-}
-
 
 /* Send up to <count> pending bytes from buffer <buf> to connection <conn>'s
  * socket. <flags> may contain some CO_SFL_* flags to hint the system about
@@ -5337,7 +5282,6 @@ static int qc_xprt_start(struct connection *conn, void *ctx)
 static struct xprt_ops ssl_quic = {
        .close    = quic_close,
        .snd_buf  = quic_conn_from_buf,
-       .rcv_buf  = quic_conn_to_buf,
        .subscribe = quic_conn_subscribe,
        .unsubscribe = quic_conn_unsubscribe,
        .init     = qc_conn_init,