if (req->to_forward) {
if (req->to_forward == CHN_INFINITE_FORWARD) {
- if (req->flags & CF_EOI) {
- msg->msg_state = HTTP_MSG_DONE;
- req->to_forward = 0;
- goto done;
- }
+ if (req->flags & CF_EOI)
+ msg->msg_state = HTTP_MSG_ENDING;
}
else {
/* We can't process the buffer's contents yet */
}
}
- if (msg->msg_state >= HTTP_MSG_DONE)
- goto done;
+ if (msg->msg_state >= HTTP_MSG_ENDING)
+ goto ending;
+
+ if (txn->meth == HTTP_METH_CONNECT) {
+ msg->msg_state = HTTP_MSG_ENDING;
+ goto ending;
+ }
+
/* Forward input data. We get it by removing all outgoing data not
* forwarded yet from HTX data size. If there are some data filters, we
* let them decide the amount of data to forward.
channel_htx_forward_forever(req, htx);
}
- if (txn->meth == HTTP_METH_CONNECT) {
- msg->msg_state = HTTP_MSG_TUNNEL;
- goto done;
- }
-
+ if (htx->data != co_data(req))
+ goto missing_data_or_waiting;
/* Check if the end-of-message is reached and if so, switch the message
* in HTTP_MSG_ENDING state. Then if all data was marked to be
goto missing_data_or_waiting;
msg->msg_state = HTTP_MSG_ENDING;
- if (htx->data != co_data(req))
- goto missing_data_or_waiting;
- msg->msg_state = HTTP_MSG_DONE;
- req->to_forward = 0;
- done:
- /* other states, DONE...TUNNEL */
- /* we don't want to forward closes on DONE except in tunnel mode. */
- if (!(txn->flags & TX_CON_WANT_TUN))
- channel_dont_close(req);
+ ending:
+ /* other states, ENDING...TUNNEL */
+ if (msg->msg_state >= HTTP_MSG_DONE)
+ goto done;
if (HAS_REQ_DATA_FILTERS(s)) {
ret = flt_http_end(s, msg);
}
}
+ if (txn->meth == HTTP_METH_CONNECT)
+ msg->msg_state = HTTP_MSG_TUNNEL;
+ else {
+ msg->msg_state = HTTP_MSG_DONE;
+ req->to_forward = 0;
+ }
+
+ done:
+ /* we don't want to forward closes on DONE except in tunnel mode. */
+ if (!(txn->flags & TX_CON_WANT_TUN))
+ channel_dont_close(req);
+
http_end_request(s);
if (!(req->analysers & an_bit)) {
http_end_response(s);
if (res->to_forward) {
if (res->to_forward == CHN_INFINITE_FORWARD) {
- if (res->flags & CF_EOI) {
- msg->msg_state = HTTP_MSG_DONE;
- res->to_forward = 0;
- goto done;
- }
+ if (res->flags & CF_EOI)
+ msg->msg_state = HTTP_MSG_ENDING;
}
else {
/* We can't process the buffer's contents yet */
}
}
- if (msg->msg_state >= HTTP_MSG_DONE)
- goto done;
+ if (msg->msg_state >= HTTP_MSG_ENDING)
+ goto ending;
+
+ if ((txn->meth == HTTP_METH_CONNECT && txn->status == 200) || txn->status == 101 ||
+ (!(msg->flags & HTTP_MSGF_XFER_LEN) && !HAS_RSP_DATA_FILTERS(s))) {
+ msg->msg_state = HTTP_MSG_ENDING;
+ goto ending;
+ }
/* Forward input data. We get it by removing all outgoing data not
* forwarded yet from HTX data size. If there are some data filters, we
channel_htx_forward_forever(res, htx);
}
- if ((txn->meth == HTTP_METH_CONNECT && txn->status == 200) || txn->status == 101 ||
- (!(msg->flags & HTTP_MSGF_XFER_LEN) && (res->flags & CF_SHUTR || !HAS_RSP_DATA_FILTERS(s)))) {
- msg->msg_state = HTTP_MSG_TUNNEL;
- goto done;
+ if (htx->data != co_data(res))
+ goto missing_data_or_waiting;
+
+ if (!(msg->flags & HTTP_MSGF_XFER_LEN) && res->flags & CF_SHUTR) {
+ msg->msg_state = HTTP_MSG_ENDING;
+ goto ending;
}
/* Check if the end-of-message is reached and if so, switch the message
goto missing_data_or_waiting;
msg->msg_state = HTTP_MSG_ENDING;
- if (htx->data != co_data(res))
- goto missing_data_or_waiting;
- msg->msg_state = HTTP_MSG_DONE;
- res->to_forward = 0;
- done:
- /* other states, DONE...TUNNEL */
- channel_dont_close(res);
+ ending:
+ /* other states, ENDING...TUNNEL */
+ if (msg->msg_state >= HTTP_MSG_DONE)
+ goto done;
if (HAS_RSP_DATA_FILTERS(s)) {
ret = flt_http_end(s, msg);
}
}
+ if ((txn->meth == HTTP_METH_CONNECT && txn->status == 200) || txn->status == 101 ||
+ !(msg->flags & HTTP_MSGF_XFER_LEN)) {
+ msg->msg_state = HTTP_MSG_TUNNEL;
+ goto ending;
+ }
+ else {
+ msg->msg_state = HTTP_MSG_DONE;
+ res->to_forward = 0;
+ }
+
+ done:
+
+ channel_dont_close(res);
+
http_end_response(s);
if (!(res->analysers & an_bit)) {
http_end_request(s);