Skip to content

Commit 680f5ba

Browse files
fix: combine handshake into a single write
Send protocol version and client registration in one write+drain instead of two, matching the Go client's behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e7e05b9 commit 680f5ba

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/dqliteclient/protocol.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,9 @@ async def handshake(self, client_id: int = 0) -> int:
4747
4848
Returns the heartbeat timeout from server.
4949
"""
50-
# Send protocol version
51-
self._writer.write(self._encoder.encode_handshake())
52-
await self._writer.drain()
53-
54-
# Send client registration
50+
# Send protocol version + client registration together
5551
request = ClientRequest(client_id=client_id)
56-
self._writer.write(request.encode())
52+
self._writer.write(self._encoder.encode_handshake() + request.encode())
5753
await self._writer.drain()
5854

5955
# Read welcome response

0 commit comments

Comments
 (0)