Closed vansante closed 3 years ago
Hmmm, let me check.
You are correct. Thanks a ton for reporting. Fixing it now!
Can you, please, help test #75?
I tested #76 and I got the same results with version github.com/pires/go-proxyproto@v0.6.1-0.20210713120647-bab7dd263f97
in my go.mod
.
Additionally, #74 is lacking in picking a suitable default. Considering the reason for that change's existence, it really should include a default timeout. If people really want to have no timeout at all, a negative value could be defined as "no timeout".
@jefferai what do you think a sane default should be? One second?
Also, can you please help review #76? I think I fixed it in that PR but the reporter can't seem to reproduce successfully so more eyes/minds would help.
The fix was released as https://github.com/pires/go-proxyproto/releases/tag/v0.6.1
I think this setting is supposed to timeout connections that are not sending the headers and terminate them after this amount of time. However, I set the setting to 5 seconds, and the result is that all connections are terminated after 5 seconds, even if they correctly sent the headers. The connection starts up, but is then abruptly ended after the 5 seconds are passed.
I think what is missing in #74 is a call to
SetReadDeadline
to reset the timeout after the proxy header was sent successfully.