stopProducing in reflector client file_sender when uploading is done

this fixes exceptions.ValueError: I/O operation on closed file in
twisted.protocols.basic.ResumeProducing
This commit is contained in:
Jack Robison 2017-02-07 14:27:05 -05:00
parent df40c7fb76
commit a58a81a841

View file

@ -145,9 +145,11 @@ class EncryptedFileReflectorClient(Protocol):
def set_not_uploading(self): def set_not_uploading(self):
if self.next_blob_to_send is not None: if self.next_blob_to_send is not None:
log.debug("Close %s", self.next_blob_to_send)
self.next_blob_to_send.close_read_handle(self.read_handle) self.next_blob_to_send.close_read_handle(self.read_handle)
self.read_handle = None self.read_handle = None
self.next_blob_to_send = None self.next_blob_to_send = None
self.file_sender.stopProducing()
self.file_sender = None self.file_sender = None
return defer.succeed(None) return defer.succeed(None)