be more specific about the reason for a failed PROXYv2 session

We reported any PROXY connection failure as JUNK. Now we report the same
reasons as for failing HTTP1 connections.

Implmentation:

SES_DeleteHS() asserts that the hs argument be negative (one of
JUNK, CLOSE, TIMEOUT, OVERFLOW, EOF).

HTC_RxStuff() may return OVERFLOW, JUNK, COMPLETE, EOF or TIMEOUT (or,
instead of TIMEOUT, IDLE if the callback returned EMPTY).

Because vpx_complete() only returns JUNK, OVERFLOW or MORE, using
the HTC_RxStuff() return value for SES_DeleteHS() is safe if different
from COMPLETE.
parent 2ce73679
......@@ -537,7 +537,7 @@ vpx_new_session(struct worker *wrk, void *arg)
1024); // XXX ?
if (hs != HTC_S_COMPLETE) {
Req_Release(req);
SES_Delete(sp, SC_RX_JUNK, NAN);
SES_DeleteHS(sp, hs, NAN);
return;
}
p = req->htc->rxbuf_b;
......
......@@ -73,6 +73,8 @@ logexpect l1 -v v1 -g raw {
expect * 1013 ProxyGarbage "PROXY2: Ignoring short IPv6 addresses \\(35\\)"
expect * 1016 Proxy "2 1.2.3.4 2314 5.6.7.8 2828"
expect * 1019 Proxy "2 102:304:506::d0e:f10 2314 8182:8384:8586::8d8e:8f80 2828"
expect * 1022 Begin "^sess 0 PROXY"
expect 1 1022 SessClose "^RX_OVERFLOW"
} -start
client c1 {
......@@ -197,4 +199,17 @@ client c1 \
delay .1
client c2 {
# max length with garbage
sendhex "0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a"
# annouce 1025 bytes
sendhex "20 00 04 01"
# 1024 bytes implicit proxy hdr limit
send_n 64 "0123456789abcdef"
timeout 8
expect_close
} -run
delay .1
logexpect l1 -wait
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment