return (htx->head != -1);
}
+static inline void htx_skip_msg_payload(struct htx *htx)
+{
+ struct htx_blk *blk = htx_get_first_blk(htx);
+
+ while (blk) {
+ enum htx_blk_type type = htx_get_blk_type(blk);
+
+ blk = ((type > HTX_BLK_EOH && type < HTX_BLK_EOM)
+ ? htx_remove_blk(htx, blk)
+ : htx_get_next_blk(htx, blk));
+ }
+}
+
/* Returns the number of used blocks in the HTX message <htx>. Note that it is
* illegal to call this function with htx == NULL. Note also blocks of type
* HTX_BLK_UNUSED are part of used blocks.
FLT_STRM_CB(s, flt_http_reply(s, s->txn->status, msg));
htx = htx_from_buf(&chn->buf);
if (channel_htx_copy_msg(chn, htx, msg)) {
+ if (s->txn->meth == HTTP_METH_HEAD)
+ htx_skip_msg_payload(htx);
htx->flags |= HTX_FL_PROXY_RESP;
data = htx->data - co_data(chn);
c_adv(chn, data);
FLT_STRM_CB(s, flt_http_reply(s, s->txn->status, msg));
htx = htx_from_buf(&chn->buf);
if (channel_htx_copy_msg(chn, htx, msg)) {
+ if (s->txn->meth == HTTP_METH_HEAD)
+ htx_skip_msg_payload(htx);
htx->flags |= HTX_FL_PROXY_RESP;
data = htx->data - co_data(chn);
c_adv(chn, data);
if (!htx_add_endof(htx, HTX_BLK_EOH))
goto fail;
+ if (s->txn->meth == HTTP_METH_HEAD)
+ body.len = 0;
+
while (body.len) {
size_t sent = htx_add_data(htx, body);
if (!sent)