Skip to content

Commit

Permalink
BuffWriter: simplified write()
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbleboy14 committed Apr 26, 2024
1 parent 335d672 commit 3a0c1c8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions rel/buff.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,8 @@ def error(self, msg="unexpected error"):
self.log("error #%s: %s"%(len(self.errors), msg))

def write(self):
# if self.errors:
# return self.log("aborting write (errors!)")
d = self.data[0]
sent = self.sender(self.sock, d)
if sent == len(d):
self.data.pop(0)
else:
self.data[0] = d[sent:]
self.sender(self.sock, self.data[0])
self.data.pop(0)
self.data or self.log("write complete")
return self.data

Expand Down

0 comments on commit 3a0c1c8

Please sign in to comment.