mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
MINOR: hq-interop: properly handle incomplete request
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.
This commit is contained in:
parent
0aa35289b3
commit
3cc095a011
1 changed files with 3 additions and 7 deletions
|
|
@ -23,10 +23,6 @@ static ssize_t hq_interop_rcv_buf(struct qcs *qcs, struct buffer *b, int fin)
|
|||
/* 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);
|
||||
|
||||
|
|
@ -38,13 +34,13 @@ static ssize_t hq_interop_rcv_buf(struct qcs *qcs, struct buffer *b, int fin)
|
|||
|
||||
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)) {
|
||||
|
|
@ -61,7 +57,7 @@ static ssize_t hq_interop_rcv_buf(struct qcs *qcs, struct buffer *b, int fin)
|
|||
|
||||
if (!data) {
|
||||
fprintf(stderr, "truncated stream\n");
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
path.len = ptr - path.ptr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue