Skip to content

Commit e528773

Browse files
committed
Fixes
1 parent 9aa51c5 commit e528773

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

pymongo/asynchronous/pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,8 +1045,8 @@ async def connect(self, handler: Optional[_MongoClientErrorHandler] = None) -> A
10451045
if self.handshake:
10461046
await conn.hello()
10471047
self.is_writable = conn.is_writable
1048-
# if handler:
1049-
# handler.contribute_socket(conn, completed_handshake=False)
1048+
if handler:
1049+
handler.contribute_socket(conn, completed_handshake=False)
10501050

10511051
await conn.authenticate()
10521052
# Catch KeyboardInterrupt, CancelledError, etc. and cleanup.

pymongo/network_layer.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -529,19 +529,11 @@ async def read(
529529
self._debug = debug
530530
self._max_message_size = max_message_size
531531
self._request_id = request_id
532-
(
533-
self._length,
534-
self._overflow_length,
535-
self._body_length,
536-
self._op_code,
537-
self._overflow,
538-
) = (
539-
0,
540-
0,
541-
0,
542-
None, # type: ignore[assignment]
543-
None,
544-
)
532+
self._length = 0
533+
self._overflow_length = 0
534+
self._body_length = 0
535+
self._op_code = None # type: ignore[assignment]
536+
self._overflow = None
545537
if self.transport.is_closing():
546538
raise OSError("Connection is closed")
547539
read_waiter = asyncio.get_running_loop().create_future()

pymongo/synchronous/pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,8 @@ def connect(self, handler: Optional[_MongoClientErrorHandler] = None) -> Connect
10411041
if self.handshake:
10421042
conn.hello()
10431043
self.is_writable = conn.is_writable
1044-
# if handler:
1045-
# handler.contribute_socket(conn, completed_handshake=False)
1044+
if handler:
1045+
handler.contribute_socket(conn, completed_handshake=False)
10461046

10471047
conn.authenticate()
10481048
# Catch KeyboardInterrupt, CancelledError, etc. and cleanup.

0 commit comments

Comments
 (0)