Extends HTTP/0.9 layer to be able to deal with incomplete requests.
Instead of an error, 0 is returned. Thus, instead of a stream closure.
QUIC-MUX may retry rcv_buf operation later if more data is received,
similarly to HTTP/3 layer.
Note that HTTP/0.9 is only used for testing and interop purpose. As
such, this limitation is not considered as a bug. It is probably not
worth to backport it.
/* hq-interop parser does not support buffer wrapping. */
BUG_ON(b_data(b) != b_contig_data(b, 0));
- /* hq-interop parser is only done once full message is received. */
- if (!fin)
- return 0;
-
b_alloc(&htx_buf, DB_MUX_RX);
htx = htx_from_buf(&htx_buf);
if (!data || !HTTP_IS_SPHT(*ptr)) {
fprintf(stderr, "truncated stream\n");
- return -1;
+ return 0;
}
ptr++;
if (!--data) {
fprintf(stderr, "truncated stream\n");
- return -1;
+ return 0;
}
if (HTTP_IS_LWS(*ptr)) {
if (!data) {
fprintf(stderr, "truncated stream\n");
- return -1;
+ return 0;
}
path.len = ptr - path.ptr;