-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate http1 proxy connect handler #185
Migrate http1 proxy connect handler #185
Conversation
Can one of the admins verify this patch? |
5 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of nits but looks good otherwise
@swift-server-bot add to allowlist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the changed generate_linux_tests.rb
script and its associated changes to a new PR? They add loads of noise to this one, and they are unrelated.
5b34b99
to
6c4d28a
Compare
Motivation: Moving the HTTP1ProxyConnectHandler into swift-nio-extras will make the code which is generally useful when dealing with HTTP1 proxies available more easily to a wider audience. Modifications: The code and tests are copied over from https://github.com/swift-server/async-http-client/blob/0b5bec741bfcf941e208d937de2ec29affe750a7/Sources/AsyncHTTPClient/ConnectionPool/ChannelHandler/HTTP1ProxyConnectHandler.swift. Result: HTTP1ProxyConnectHandler will be surfaced via the NIOExtras library
- Add missing `context.fireChannelActive()`,`context.fireChannelInactive()` to pass along events down the pipeline. - Make some members private
- include responseHEAD in invalid response errors - remove precondition in favor of error in event of an unexpected proxy response
cdf4d91
to
060c06d
Compare
060c06d
to
a2da342
Compare
- writes issued whilst the CONNECT is ongoing are now buffered rather than triggering a failure - Error is restructured to do away with `Kind` - failure logic is consolidated in `failWithError`
da3ea0c
to
b34607e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm more or less happy with this once https://github.com/apple/swift-nio-extras/pull/185/files#r1039437675 has been addressed.
HTTP1ProxyConnectHandler now errors rather than fails a precondition if it becomes inactive unexpectedly when in initializing state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @rnro!
18678a6
to
619f10b
Compare
unbuffering writes now flushes correctly if the buffer is flushed during unbuffering
619f10b
to
63473f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broadly looking great! One quick note.
to protect against concurrent modification
Motivation:
Moving the
HTTP1ProxyConnectHandler
intoswift-nio-extras
will make thecode which is generally useful when dealing with HTTP1 proxies available
more easily to a wider audience.
Modifications:
The code and tests are copied over from https://github.com/swift-server/async-http-client/blob/0b5bec741bfcf941e208d937de2ec29affe750a7/Sources/AsyncHTTPClient/ConnectionPool/ChannelHandler/HTTP1ProxyConnectHandler.swift.
The code is slightly modified to allow the specification of arbitrary headers rather than authorisation information.
Result:
HTTP1ProxyConnectHandler
will be surfaced via theNIOExtras
library