* and the other ones are used to setup and release the transport layer.
*/
struct xprt_ops {
- size_t (*rcv_buf)(struct connection *conn, struct buffer *buf, size_t count); /* recv callback */
+ size_t (*rcv_buf)(struct connection *conn, struct buffer *buf, size_t count, int flags); /* recv callback */
size_t (*snd_buf)(struct connection *conn, const struct buffer *buf, size_t count, int flags); /* send callback */
int (*rcv_pipe)(struct connection *conn, struct pipe *pipe, unsigned int count); /* recv-to-pipe callback */
int (*snd_pipe)(struct connection *conn, struct pipe *pipe); /* send-to-pipe callback */
void (*send)(struct connection *conn); /* mux-layer send callback */
int (*wake)(struct connection *conn); /* mux-layer callback to report activity, mandatory */
void (*update_poll)(struct conn_stream *cs); /* commit cs flags to mux/conn */
- size_t (*rcv_buf)(struct conn_stream *cs, struct buffer *buf, size_t count); /* Called from the upper layer to get data */
+ size_t (*rcv_buf)(struct conn_stream *cs, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to get data */
size_t (*snd_buf)(struct conn_stream *cs, const struct buffer *buf, size_t count, int flags); /* Called from the upper layer to send data */
int (*rcv_pipe)(struct conn_stream *cs, struct pipe *pipe, unsigned int count); /* recv-to-pipe callback */
int (*snd_pipe)(struct conn_stream *cs, struct pipe *pipe); /* send-to-pipe callback */
done = 0;
- conn->mux->rcv_buf(cs, check->bi, check->bi->size);
+ conn->mux->rcv_buf(cs, check->bi, check->bi->size, 0);
if (conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH) || cs->flags & CS_FL_ERROR) {
done = 1;
if ((conn->flags & CO_FL_ERROR || cs->flags & CS_FL_ERROR) && !check->bi->i) {
goto out_end_tcpcheck;
__cs_want_recv(cs);
- if (conn->mux->rcv_buf(cs, check->bi, check->bi->size) <= 0) {
+ if (conn->mux->rcv_buf(cs, check->bi, check->bi->size, 0) <= 0) {
if (conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH) || cs->flags & CS_FL_ERROR) {
done = 1;
if ((conn->flags & CO_FL_ERROR || cs->flags & CS_FL_ERROR) && !check->bi->i) {
/* note: buf->o == 0 */
max = buf->size - buf->i;
if (max)
- conn->xprt->rcv_buf(conn, buf, max);
+ conn->xprt->rcv_buf(conn, buf, max, 0);
if (!buf->i) {
h2_release_buf(h2c, &h2c->dbuf);
* caller is responsible for never asking for more data than what is available
* in the buffer.
*/
-static size_t h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count)
+static size_t h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
{
struct h2s *h2s = cs->ctx;
struct h2c *h2c = h2s->h2c;
/*
* Called from the upper layer, to get more data
*/
-static size_t mux_pt_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count)
+static size_t mux_pt_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
{
size_t ret;
- ret = cs->conn->xprt->rcv_buf(cs->conn, buf, count);
+ ret = cs->conn->xprt->rcv_buf(cs->conn, buf, count, flags);
if (conn_xprt_read0_pending(cs->conn))
cs->flags |= CS_FL_EOS;
if (cs->conn->flags & CO_FL_ERROR)
* errno is cleared before starting so that the caller knows that if it spots an
* error without errno, it's pending and can be retrieved via getsockopt(SO_ERROR).
*/
-static size_t raw_sock_to_buf(struct connection *conn, struct buffer *buf, size_t count)
+static size_t raw_sock_to_buf(struct connection *conn, struct buffer *buf, size_t count, int flags)
{
ssize_t ret;
size_t try, done = 0;
* avoiding the call if inappropriate. The function does not call the
* connection's polling update function, so the caller is responsible for this.
*/
-static size_t ssl_sock_to_buf(struct connection *conn, struct buffer *buf, size_t count)
+static size_t ssl_sock_to_buf(struct connection *conn, struct buffer *buf, size_t count, int flags)
{
ssize_t ret;
size_t try, done = 0;
break;
}
- ret = conn->mux->rcv_buf(cs, ic->buf, max);
+ ret = conn->mux->rcv_buf(cs, ic->buf, max, 0);
if (cs->flags & CS_FL_RCV_MORE)
si->flags |= SI_FL_WAIT_ROOM;