* =0 : not enough data available. <blk*> are left undefined.
* The buffer is left unaffected. Unused buffers are left in an undefined state.
*/
-static inline size_t b_getblk_nc(struct buffer *buf, char **blk1, int *len1, char **blk2, int *len2, size_t ofs, size_t max)
+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)
{
size_t l1;
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, char **blk1, int *len1, char **blk2, int *len2);
-int co_getblk_nc(const struct channel *chn, char **blk1, int *len1, char **blk2, int *len2);
+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);
/* returns a pointer to the stream the channel belongs to */
* 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, char **blk1, int *len1, char **blk2, int *len2)
+int co_getblk_nc(const struct channel *chn, const char **blk1, int *len1, const char **blk2, int *len2)
{
if (unlikely(chn->buf->o == 0)) {
if (chn->flags & CF_SHUTW)
* the '\n'. Unused buffers are left in an undefined state.
*/
int co_getline_nc(const struct channel *chn,
- char **blk1, int *len1,
- char **blk2, int *len2)
+ const char **blk1, int *len1,
+ const char **blk2, int *len2)
{
int retcode;
int l;
struct appctx *appctx;
int len;
int nblk;
- char *blk1;
+ const char *blk1;
int len1;
- char *blk2;
+ const char *blk2;
int len2;
int skip_at_end = 0;
struct channel *oc;
struct hlua_appctx *appctx = MAY_LJMP(hlua_checkapplet_tcp(L, 1));
struct stream_interface *si = appctx->appctx->owner;
int ret;
- char *blk1;
+ const char *blk1;
int len1;
- char *blk2;
+ const char *blk2;
int len2;
/* Read the maximum amount of data avalaible. */
struct stream_interface *si = appctx->appctx->owner;
int len = MAY_LJMP(luaL_checkinteger(L, 2));
int ret;
- char *blk1;
+ const char *blk1;
int len1;
- char *blk2;
+ const char *blk2;
int len2;
/* Read the maximum amount of data avalaible. */
struct stream_interface *si = appctx->appctx->owner;
struct channel *chn = si_ic(si);
int ret;
- char *blk1;
+ const char *blk1;
int len1;
- char *blk2;
+ const char *blk2;
int len2;
/* Maybe we cant send a 100-continue ? */
int len = MAY_LJMP(luaL_checkinteger(L, 2));
struct channel *chn = si_ic(si);
int ret;
- char *blk1;
+ const char *blk1;
int len1;
- char *blk2;
+ const char *blk2;
int len2;
/* Maybe we cant send a 100-continue ? */
struct act_rule *rule = ctx->rule;
struct proxy *px = strm->be;
struct hlua *hlua = ctx->ctx.hlua_apphttp.hlua;
- char *blk1;
+ const char *blk1;
int len1;
- char *blk2;
+ const char *blk2;
int len2;
int ret;
* number of bytes sent. The caller must check the stream's status to detect
* any error which might have happened subsequently to a successful send.
*/
-static size_t h2s_frt_make_resp_headers(struct h2s *h2s, struct buffer *buf, size_t ofs, size_t max)
+static size_t h2s_frt_make_resp_headers(struct h2s *h2s, const struct buffer *buf, size_t ofs, size_t max)
{
struct http_hdr list[MAX_HTTP_HDR];
struct h2c *h2c = h2s->h2c;
* the number of bytes sent. The caller must check the stream's status to
* detect any error which might have happened subsequently to a successful send.
*/
-static size_t h2s_frt_make_resp_data(struct h2s *h2s, struct buffer *buf, size_t ofs, size_t max)
+static size_t h2s_frt_make_resp_data(struct h2s *h2s, const struct buffer *buf, size_t ofs, size_t max)
{
struct h2c *h2c = h2s->h2c;
struct h1m *h1m = &h2s->res;
size_t total = 0;
int es_now = 0;
int size = 0;
- char *blk1, *blk2;
+ const char *blk1, *blk2;
int len1, len2;
if (h2c_mux_busy(h2c, h2s)) {