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 */
- int (*rcv_buf)(struct conn_stream *cs, struct buffer *buf, int count); /* Called from the upper layer to get data */
+ size_t (*rcv_buf)(struct conn_stream *cs, struct buffer *buf, size_t count); /* 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 */
* caller is responsible for never asking for more data than what is available
* in the buffer.
*/
-static int h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, int count)
+static size_t h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count)
{
struct h2s *h2s = cs->ctx;
struct h2c *h2c = h2s->h2c;
- int ret = 0;
+ size_t ret = 0;
if (h2c->st0 != H2_CS_FRAME_P)
return 0; // no pre-parsed frame yet
/*
* Called from the upper layer, to get more data
*/
-static int mux_pt_rcv_buf(struct conn_stream *cs, struct buffer *buf, int count)
+static size_t mux_pt_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count)
{
- int ret;
+ size_t ret;
ret = cs->conn->xprt->rcv_buf(cs->conn, buf, count);
if (conn_xprt_read0_pending(cs->conn))
cs->flags |= CS_FL_EOS;
if (cs->conn->flags & CO_FL_ERROR)
cs->flags |= CS_FL_ERROR;
- return (ret);
+ return ret;
}
/* Called from the upper layer, to send data */