-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Use sync pipeline operations to add NIOSSLClientHandler #152
Conversation
43b6b35
to
0e0caf4
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.
LGTM. Will let @gwynne have the final say. Changed to patch update since there are no public API additions
@0xTim Agree there are no api changes in Postgres, but we bump or dependencies, that we in part reexport (like NIO) in a minor way. Therefor this needs IMO a minor release. |
Oh FFS why is PostgresNIO exporting everything! * sigh * you're right I'll change it back. I can't wait to get rid of all these exports! |
We'll it's not so much export everything. But in this case EventLoopFuture is enough. 😎 |
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!
@@ -215,17 +215,16 @@ final class PSQLConnection { | |||
.channelInitializer { channel in | |||
let decoder = ByteToMessageHandler(PSQLBackendMessage.Decoder()) | |||
|
|||
var enableSSLCallback: ((Channel) -> EventLoopFuture<Void>)? = nil | |||
var enableSSLCallback: ((Channel) throws -> ())? = nil |
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.
Super nit but this might be clearer as configureSSLCallback
}.flatMap { sslHandler in | ||
channel.pipeline.addHandler(sslHandler, position: .before(decoder)) | ||
} | ||
channel.eventLoop.preconditionInEventLoop() |
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.
FWIW the sync operations will do this check for you; keeping this (and potentially degrading it to an assertion) is a useful as an indicator to whoever looks at this code though.
0e0caf4
to
707b9e7
Compare
Renamed |
PSQLChannelHandler
'senableSSLCallback
to a synchronous APIchannel.pipeline.syncOperations
to add theNIOSSLClientHandler
after it was verified that SSL is supported on this connectiontestEstablishSSLCallbackIsCalledIfSSLIsSupported
to ensure startup is send after SSL connection is established.