diff --git a/include/common/buf.h b/include/common/buf.h index 488c4064f..b7a5df317 100644 --- a/include/common/buf.h +++ b/include/common/buf.h @@ -352,7 +352,7 @@ static inline size_t b_getblk(const struct buffer *buf, char *blk, size_t len, s * =0 : not enough data available. are left undefined. * The buffer is left unaffected. Unused buffers are left in an undefined state. */ -static inline size_t b_getblk_nc(const struct buffer *buf, const char **blk1, int *len1, const char **blk2, int *len2, size_t ofs, size_t max) +static inline size_t b_getblk_nc(const struct buffer *buf, const char **blk1, size_t *len1, const char **blk2, size_t *len2, size_t ofs, size_t max) { size_t l1; diff --git a/include/proto/channel.h b/include/proto/channel.h index eedeaaea9..026574f51 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -48,13 +48,13 @@ unsigned long long __channel_forward(struct channel *chn, unsigned long long byt int ci_putblk(struct channel *chn, const char *str, int len); struct buffer *ci_swpbuf(struct channel *chn, struct buffer *buf); int ci_putchr(struct channel *chn, char c); -int ci_getline_nc(const struct channel *chn, char **blk1, int *len1, char **blk2, int *len2); -int ci_getblk_nc(const struct channel *chn, char **blk1, int *len1, char **blk2, int *len2); +int ci_getline_nc(const struct channel *chn, char **blk1, size_t *len1, char **blk2, size_t *len2); +int ci_getblk_nc(const struct channel *chn, char **blk1, size_t *len1, char **blk2, size_t *len2); int co_inject(struct channel *chn, const char *msg, int len); int co_getline(const struct channel *chn, char *str, int len); int co_getblk(const struct channel *chn, char *blk, int len, int offset); -int co_getline_nc(const struct channel *chn, const char **blk1, int *len1, const char **blk2, int *len2); -int co_getblk_nc(const struct channel *chn, const char **blk1, int *len1, const char **blk2, int *len2); +int co_getline_nc(const struct channel *chn, const char **blk1, size_t *len1, const char **blk2, size_t *len2); +int co_getblk_nc(const struct channel *chn, const char **blk1, size_t *len1, const char **blk2, size_t *len2); /* returns a pointer to the stream the channel belongs to */ diff --git a/src/channel.c b/src/channel.c index 3b0592f50..b3382a763 100644 --- a/src/channel.c +++ b/src/channel.c @@ -312,7 +312,7 @@ int co_getblk(const struct channel *chn, char *blk, int len, int offset) * The channel status is not changed. The caller must call co_skip() to * update it. Unused buffers are left in an undefined state. */ -int co_getblk_nc(const struct channel *chn, const char **blk1, int *len1, const char **blk2, int *len2) +int co_getblk_nc(const struct channel *chn, const char **blk1, size_t *len1, const char **blk2, size_t *len2) { if (unlikely(chn->buf->o == 0)) { if (chn->flags & CF_SHUTW) @@ -333,8 +333,8 @@ int co_getblk_nc(const struct channel *chn, const char **blk1, int *len1, const * the '\n'. Unused buffers are left in an undefined state. */ int co_getline_nc(const struct channel *chn, - const char **blk1, int *len1, - const char **blk2, int *len2) + const char **blk1, size_t *len1, + const char **blk2, size_t *len2) { int retcode; int l; @@ -377,8 +377,8 @@ int co_getline_nc(const struct channel *chn, * <0 : no more bytes readable because input is shut. */ int ci_getblk_nc(const struct channel *chn, - char **blk1, int *len1, - char **blk2, int *len2) + char **blk1, size_t *len1, + char **blk2, size_t *len2) { if (unlikely(chn->buf->i == 0)) { if (chn->flags & CF_SHUTR) @@ -409,8 +409,8 @@ int ci_getblk_nc(const struct channel *chn, * the '\n'. Unused buffers are left in an undefined state. */ int ci_getline_nc(const struct channel *chn, - char **blk1, int *len1, - char **blk2, int *len2) + char **blk1, size_t *len1, + char **blk2, size_t *len2) { int retcode; int l; diff --git a/src/hlua.c b/src/hlua.c index eb27ebc7e..7976242d5 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -1736,12 +1736,12 @@ __LJMP static int hlua_socket_receive_yield(struct lua_State *L, int status, lua int wanted = lua_tointeger(L, 2); struct hlua *hlua = hlua_gethlua(L); struct appctx *appctx; - int len; + size_t len; int nblk; const char *blk1; - int len1; + size_t len1; const char *blk2; - int len2; + size_t len2; int skip_at_end = 0; struct channel *oc; struct stream_interface *si; @@ -2774,8 +2774,8 @@ static inline int _hlua_channel_dup(struct channel *chn, lua_State *L) { char *blk1; char *blk2; - int len1; - int len2; + size_t len1; + size_t len2; int ret; luaL_Buffer b; @@ -2862,9 +2862,9 @@ __LJMP static int hlua_channel_getline_yield(lua_State *L, int status, lua_KCont { char *blk1; char *blk2; - int len1; - int len2; - int len; + size_t len1; + size_t len2; + size_t len; struct channel *chn; int ret; luaL_Buffer b; @@ -3634,9 +3634,9 @@ __LJMP static int hlua_applet_tcp_getline_yield(lua_State *L, int status, lua_KC struct stream_interface *si = appctx->appctx->owner; int ret; const char *blk1; - int len1; + size_t len1; const char *blk2; - int len2; + size_t len2; /* Read the maximum amount of data avalaible. */ ret = co_getline_nc(si_oc(si), &blk1, &len1, &blk2, &len2); @@ -3686,12 +3686,12 @@ __LJMP static int hlua_applet_tcp_recv_yield(lua_State *L, int status, lua_KCont { struct hlua_appctx *appctx = MAY_LJMP(hlua_checkapplet_tcp(L, 1)); struct stream_interface *si = appctx->appctx->owner; - int len = MAY_LJMP(luaL_checkinteger(L, 2)); + size_t len = MAY_LJMP(luaL_checkinteger(L, 2)); int ret; const char *blk1; - int len1; + size_t len1; const char *blk2; - int len2; + size_t len2; /* Read the maximum amount of data avalaible. */ ret = co_getblk_nc(si_oc(si), &blk1, &len1, &blk2, &len2); @@ -4097,9 +4097,9 @@ __LJMP static int hlua_applet_http_getline_yield(lua_State *L, int status, lua_K struct channel *chn = si_ic(si); int ret; const char *blk1; - int len1; + size_t len1; const char *blk2; - int len2; + size_t len2; /* Maybe we cant send a 100-continue ? */ if (appctx->appctx->ctx.hlua_apphttp.flags & APPLET_100C) { @@ -4183,9 +4183,9 @@ __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KCon struct channel *chn = si_ic(si); int ret; const char *blk1; - int len1; + size_t len1; const char *blk2; - int len2; + size_t len2; /* Maybe we cant send a 100-continue ? */ if (appctx->appctx->ctx.hlua_apphttp.flags & APPLET_100C) { @@ -6627,9 +6627,9 @@ static void hlua_applet_http_fct(struct appctx *ctx) struct proxy *px = strm->be; struct hlua *hlua = ctx->ctx.hlua_apphttp.hlua; const char *blk1; - int len1; + size_t len1; const char *blk2; - int len2; + size_t len2; int ret; /* If the stream is disconnect or closed, ldo nothing. */ diff --git a/src/mux_h2.c b/src/mux_h2.c index ec5554b17..e36ca8f5f 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -3128,7 +3128,7 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, const struct buffer *buf, int es_now = 0; int size = 0; const char *blk1, *blk2; - int len1, len2; + size_t len1, len2; if (h2c_mux_busy(h2c, h2s)) { h2s->flags |= H2_SF_BLK_MBUSY;