From: Amaury Denoyelle Date: Wed, 9 Feb 2022 14:39:35 +0000 (+0100) Subject: MINOR: quic: remove unused xprt rcv_buf operation X-Git-Tag: v2.6-dev2~186 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80bd837aafbf0ce7d0c297b23122407de0d6dc07;p=thirdparty%2Fhaproxy.git MINOR: quic: remove unused xprt rcv_buf operation 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. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index eee9bae516..7ad4382a2a 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -5143,61 +5143,6 @@ static struct quic_tx_packet *qc_build_pkt(unsigned char **pos, return NULL; } -/* Copy up to bytes from connection internal stream storage into buffer . - * 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 pending bytes from buffer to connection 's * socket. 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,