@@ -20,7 +20,7 @@ final class PostgresChannelHandler: ChannelDuplexHandler {
20
20
private var decoder : NIOSingleStepByteToMessageProcessor < PostgresBackendMessageDecoder >
21
21
private var encoder : PostgresFrontendMessageEncoder !
22
22
private let configuration : PostgresConnection . InternalConfiguration
23
- private let configureSSLCallback : ( ( Channel ) throws -> Void ) ?
23
+ private let configureSSLCallback : ( ( Channel , PostgresChannelHandler ) throws -> Void ) ?
24
24
25
25
private var listenState = ListenStateMachine ( )
26
26
private var preparedStatementState = PreparedStatementStateMachine ( )
@@ -29,7 +29,7 @@ final class PostgresChannelHandler: ChannelDuplexHandler {
29
29
configuration: PostgresConnection . InternalConfiguration ,
30
30
eventLoop: EventLoop ,
31
31
logger: Logger ,
32
- configureSSLCallback: ( ( Channel ) throws -> Void ) ?
32
+ configureSSLCallback: ( ( Channel , PostgresChannelHandler ) throws -> Void ) ?
33
33
) {
34
34
self . state = ConnectionStateMachine ( requireBackendKeyData: configuration. options. requireBackendKeyData)
35
35
self . eventLoop = eventLoop
@@ -46,7 +46,7 @@ final class PostgresChannelHandler: ChannelDuplexHandler {
46
46
eventLoop: EventLoop ,
47
47
state: ConnectionStateMachine = . init( . initialized) ,
48
48
logger: Logger = . psqlNoOpLogger,
49
- configureSSLCallback: ( ( Channel ) throws -> Void ) ?
49
+ configureSSLCallback: ( ( Channel , PostgresChannelHandler ) throws -> Void ) ?
50
50
) {
51
51
self . state = state
52
52
self . eventLoop = eventLoop
@@ -439,7 +439,7 @@ final class PostgresChannelHandler: ChannelDuplexHandler {
439
439
// This method must only be called, if we signalized the StateMachine before that we are
440
440
// able to setup a SSL connection.
441
441
do {
442
- try self . configureSSLCallback!( context. channel)
442
+ try self . configureSSLCallback!( context. channel, self )
443
443
let action = self . state. sslHandlerAdded ( )
444
444
self . run ( action, with: context)
445
445
} catch {
0 commit comments