@@ -89,6 +89,20 @@ cdef class BaseProtocol:
8989 self ._write_buf._transport = None
9090 transport.disconnect()
9191
92+ cdef int _post_connect(self , BaseThinConnImpl conn_impl,
93+ AuthMessage auth_message) except - 1 :
94+ """ "
95+ Performs activities after the connection has completed. The protocol
96+ must be marked to indicate that the connect is no longer in progress,
97+ which allows the normal break/reset mechanism to fire. The session must
98+ also be marked as not needing to be closed since for listener redirects
99+ the packet may indicate EOF for the initial connection that is
100+ established.
101+ """
102+ conn_impl.warning = auth_message.warning
103+ self ._read_buf._session_needs_to_be_closed = False
104+ self ._in_connect = False
105+
92106 cdef int _release_drcp_session(self , BaseThinConnImpl conn_impl,
93107 uint32_t release_mode) except - 1 :
94108 """
@@ -297,14 +311,8 @@ cdef class Protocol(BaseProtocol):
297311 if auth_message.resend:
298312 self ._process_message(auth_message)
299313
300- # mark protocol to indicate that connect is no longer in progress; this
301- # allows the normal break/reset mechanism to fire; also mark the
302- # session as not needing to be closed since for listener redirects
303- # the packet may indicate EOF for the initial connection that is
304- # established
305- conn_impl.warning = auth_message.warning
306- self ._read_buf._session_needs_to_be_closed = False
307- self ._in_connect = False
314+ # perform post connect activities
315+ self ._post_connect(conn_impl, auth_message)
308316
309317 cdef int _connect_tcp(self , ConnectParamsImpl params,
310318 Description description, Address address, str host,
@@ -648,10 +656,9 @@ cdef class BaseAsyncProtocol(BaseProtocol):
648656 if auth_message.resend:
649657 await self ._process_message(auth_message)
650658
651- # mark protocol to indicate that connect is no longer in progress; this
652- # allows the normal break/reset mechanism to fire
653- conn_impl.warning = auth_message.warning
654- self ._in_connect = False
659+ # perform post connect activities
660+ self ._post_connect(conn_impl, auth_message)
661+
655662
656663 async def _connect_tcp(self , ConnectParamsImpl params,
657664 Description description, Address address, str host,
0 commit comments