Conversation
Rename 'accel' to 'gateway' and fix documentation to match. Update documentation and code references to accel mode to gateway mode. Add explicit mode flag and accessor test for forward-proxy mode. Split option parsing to enforce [mode] parameter as first and treat mode names as invalid options when used late. This simplifies the validation that mode is only specified once and incompatible modes cannot be configured together on one port.
rousskov
left a comment
There was a problem hiding this comment.
I support adding an explicit way to configure a forward proxy mode for ports. I have not reviewed the whole PR but flagged a few problems to facilitate progress. I plan to come back to this PR after the backlog is dealt with.
| bool isIntercepted() const { return natIntercept||tproxyIntercept ;} | ||
|
|
||
| /// \returns true if the traffic is in any way intercepted | ||
| bool isForwardProxy() const { return forwardProxy || (!gatewaySurrogate && !isIntercepted()); } |
There was a problem hiding this comment.
I see no reason to imply that there is some other (unnamed) mode that has the same "forward proxy" meaning as forwardProxy mode. If we add a forwardProxy data member, it should be mutually exclusive with the other port modes (even if this new mode does not have to be explicitly set in squid.conf).
| bool isForwardProxy() const { return forwardProxy || (!gatewaySurrogate && !isIntercepted()); } | |
| bool isForwardProxy() const { return forwardProxy; } |
Edit: GitHub duplicated an earlier version of this change request while I was writing my review. I have deleted that earlier variation after spotting it in the posted review version.
There was a problem hiding this comment.
This method needs to return true when neither accel/gateway nor intercept/tproxy mode has been set. For backward compatibility with existing configurations before "proxy" mode existed as a setting.
Co-authored-by: Alex Rousskov <[email protected]>
Rename mode 'accel' to 'gateway' and fix documentation to match
RFC 9110 definitions.
Add explicit 'proxy' mode flag and accessor test for forward
proxy mode matching RFC 9110 and to simplify detection of
conflicting port modes.
Split option parsing to enforce [mode] parameter as first and
treat mode names as invalid options when used late. This
simplifies the validation that mode is only specified once and
incompatible modes cannot be configured together on one port.