mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-25 22:22:11 +00:00
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.
This commit is contained in:
parent
f6dcbce53e
commit
80bd837aaf
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user