mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Make recv_data less greedy so it doesn't eat other packets
This commit is contained in:
parent
8923a5b0d9
commit
fa80a17aa3
2 changed files with 4 additions and 4 deletions
|
@ -138,7 +138,7 @@ class Connection(object):
|
|||
try:
|
||||
vvvv("%s: in recv_data(), waiting for the header" % self.host)
|
||||
while len(data) < header_len:
|
||||
d = self.conn.recv(1024)
|
||||
d = self.conn.recv(header_len - len(data))
|
||||
if not d:
|
||||
vvvv("%s: received nothing, bailing out" % self.host)
|
||||
return None
|
||||
|
@ -148,7 +148,7 @@ class Connection(object):
|
|||
data = data[header_len:]
|
||||
vvvv("%s: data received so far (expecting %d): %d" % (self.host,data_len,len(data)))
|
||||
while len(data) < data_len:
|
||||
d = self.conn.recv(1024)
|
||||
d = self.conn.recv(data_len - len(data))
|
||||
if not d:
|
||||
vvvv("%s: received nothing, bailing out" % self.host)
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue