Skip to content

Commit

Permalink
BuffWrite.write(): clear data[] on error
Browse files Browse the repository at this point in the history
  • Loading branch information
bubbleboy14 committed Apr 26, 2024
1 parent c103a07 commit eb6be88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rel/buff.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def write(self):
try:
self.sender(self.sock, self.data[0])
except Exception as e:
return self.error(e)
self.data = []
return self.error("write error: %s"%(e,))
self.data.pop(0)
self.data or self.log("write complete")
return self.data
Expand Down

0 comments on commit eb6be88

Please sign in to comment.