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
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,