return 0;
htx = htxbuf(rxbuf);
-
- /* Nothing must be added in a message already ended. For a tunneled
- * stream, the end of the HTTP message is reported just after the
- * headers. So tunneled data must be stored in a separate buffer to
- * never mix HTTP data and tunneled data.
- */
- if (htx_msg_ended(htx))
- return 0;
-
return !!htx_free_data_space(htx);
}
htx_to_buf(h2s_htx, rxbuf);
goto end;
}
- buf_htx = htx_from_buf(buf);
-
- /* Nothing must be added in a message already ended. For a tunneled
- * stream, the end of the HTTP message is reported just after the
- * headers while tunneled data are stored in a separate buffer. So
- * these data must be transferred only once the upper layer has
- * consumed the HTTP part.
- */
- if (htx_msg_ended(buf_htx)) {
- htx_to_buf(buf_htx, buf);
- htx_to_buf(h2s_htx, rxbuf);
- goto end;
- }
-
ret += h2s_htx->data;
+ buf_htx = htx_from_buf(buf);
/* <buf> is empty and the message is small enough, swap the
* buffers. */