Skip to content

Commit 8066527

Browse files
mcpaddydaverigby
authored andcommitted
MB-29412 Use sendall instead of send
The Python socket.send() will not send the whole payload in some situations, which will create a malformed packet. Using sendall() will ensure the whole payload is sent. Change-Id: Ib51b5b8ef33d764e600f73cf15bd9a1e9c155d22 Reviewed-on: http://review.couchbase.org/93608 Reviewed-by: Trond Norbye <[email protected]> Tested-by: Patrick Varley <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent aa9be74 commit 8066527

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

engines/ep/management/mc_bin_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def _sendMsg(self, cmd, key, val, opaque, extraHeader='', cas=0,
196196
msg=struct.pack(fmt, magic,
197197
cmd, len(key), len(extraHeader), dtype, vbucketId,
198198
len(key) + len(extraHeader) + len(val), opaque, cas)
199-
self.s.send(msg + extraHeader + key + val)
199+
self.s.sendall(msg + extraHeader + key + val)
200200

201201
def _socketRecv(self, amount):
202202
ready = select.select([self.s], [], [], 30)

0 commit comments

Comments
 (0)