*/
int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *msgf, unsigned long long *body_len, int relaxed)
{
+ struct htx_blk *tailblk = htx_get_tail_blk(htx);
struct ist phdr_val[H2_PHDR_NUM_ENTRIES];
uint32_t fields; /* bit mask of H2_PHDR_FND_* */
uint32_t idx;
return ret;
fail:
+ htx_truncate_blk(htx, tailblk);
return -1;
}
*/
int h2_make_htx_response(struct http_hdr *list, struct htx *htx, unsigned int *msgf, unsigned long long *body_len, char *upgrade_protocol)
{
+ struct htx_blk *tailblk = htx_get_tail_blk(htx);
struct ist phdr_val[H2_PHDR_NUM_ENTRIES];
uint32_t fields; /* bit mask of H2_PHDR_FND_* */
uint32_t idx;
return ret;
fail:
+ htx_truncate_blk(htx, tailblk);
return -1;
}
*/
int h2_make_htx_trailers(struct http_hdr *list, struct htx *htx)
{
+ struct htx_blk *tailblk = htx_get_tail_blk(htx);
const char *ctl;
struct ist v;
uint32_t idx;
return 1;
fail:
+ htx_truncate_blk(htx, tailblk);
return -1;
}
struct buffer *tmp = get_trash_chunk();
struct htx *htx = NULL;
struct htx_sl *sl;
+ struct htx_blk *tailblk = NULL;
struct http_hdr list[global.tune.max_http_hdr * 2];
unsigned int flags = HTX_SL_F_NONE;
struct ist status = IST_NULL;
}
BUG_ON(!b_size(appbuf)); /* TODO */
htx = htx_from_buf(appbuf);
-
+ tailblk = htx_get_tail_blk(htx);
/* Only handle one HEADERS frame at a time. Thus if HTX buffer is too
* small, it happens solely from a single frame and the only option is
* to close the stream.
}
out:
- if (appbuf)
+ if (appbuf) {
+ if ((ssize_t)len < 0)
+ htx_truncate_blk(htx, tailblk);
htx_to_buf(htx, appbuf);
+ }
TRACE_LEAVE(H3_EV_RX_FRAME|H3_EV_RX_HDR, qcs->qcc->conn, qcs);
return len;
struct buffer *appbuf = NULL;
struct htx *htx = NULL;
struct htx_sl *sl;
+ struct htx_blk *tailblk = NULL;
struct http_hdr list[global.tune.max_http_hdr * 2];
int hdr_idx, ret;
const char *ctl;
}
BUG_ON(!b_size(appbuf)); /* TODO */
htx = htx_from_buf(appbuf);
+ tailblk = htx_get_tail_blk(htx);
if (!h3s->data_len) {
/* Notify that no body is present. This can only happens if
out:
/* HTX may be non NULL if error before previous htx_to_buf(). */
- if (appbuf)
+ if (appbuf) {
+ if ((ssize_t)len < 0)
+ htx_truncate_blk(htx, tailblk);
htx_to_buf(htx, appbuf);
+ }
TRACE_LEAVE(H3_EV_RX_FRAME|H3_EV_RX_HDR, qcs->qcc->conn, qcs);
return len;