When a H1 message is parsed, if the parser state is switched to TUNNEL mode
just after the header parsing, the BODYLESS flag is set on the HTX
start-line. By transitivity, the corresponding flag is set on the message in
HTTP analysers. Thus it is possible to rely on it to not wait for the
request body.
else
flags |= HTX_SL_F_BODYLESS;
}
+ if (h1m->state == H1_MSG_TUNNEL)
+ flags |= HTX_SL_F_BODYLESS;
return flags;
}
if (htx->flags & HTX_FL_PROCESSING_ERROR)
goto return_int_err;
- /* CONNECT requests have no body */
- if (txn->meth == HTTP_METH_CONNECT)
+ /* Do nothing for bodyless and CONNECT requests */
+ if (txn->meth == HTTP_METH_CONNECT || (msg->flags & HTTP_MSGF_BODYLESS))
goto http_end;
/* We have to parse the HTTP request body to find any required data.