Skip to content

Commit

Permalink
Fix one-off issue
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Dec 23, 2018
1 parent 68c1168 commit 29ffa1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyxcp/master/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ def unlock(self, length, key):
def fetch(self, length, limitPayload = None): ## TODO: pull
if limitPayload and limitPayload < 8:
raise ValueError("Payload must be at least 8 bytes - given: {}".format(limitPayload))
payload = min(limitPayload, self.maxCto) if limitPayload else self.maxCto
chunkSize = payload - 1
maxPayload = self.maxCto - 1
payload = min(limitPayload, maxPayload) if limitPayload else maxPayload
chunkSize = payload
chunks = range(length // chunkSize)
remaining = length % chunkSize
result = []
Expand Down

0 comments on commit 29ffa1f

Please sign in to comment.