From a9b45572cc0343ee3f83353bf92d3cacc7dfcfb7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 12 Oct 2016 14:50:58 +0200 Subject: [PATCH] PostReply is now always reset correctly CURA-2630 --- NetworkPrinterOutputDevice.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NetworkPrinterOutputDevice.py b/NetworkPrinterOutputDevice.py index a1bb52c514..2fd433775f 100644 --- a/NetworkPrinterOutputDevice.py +++ b/NetworkPrinterOutputDevice.py @@ -631,6 +631,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self._compressing_print = False if self._post_reply: self._post_reply.abort() + self._post_reply = None Application.getInstance().showPrintMonitor.emit(False) ## Attempt to start a new print. @@ -747,6 +748,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self._post_reply.abort() self._post_reply.uploadProgress.disconnect(self._onUploadProgress) Logger.log("d", "Uploading of print failed after %s", time() - self._send_gcode_start) + self._post_reply = None self._progress_message.hide() self.setConnectionState(ConnectionState.error) @@ -901,6 +903,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): elif "print_job" in reply_url: reply.uploadProgress.disconnect(self._onUploadProgress) Logger.log("d", "Uploading of print succeeded after %s", time() - self._send_gcode_start) + # Only reset the _post_reply if it was the same one. + if reply == self._post_reply: + self._post_reply = None self._progress_message.hide() elif reply.operation() == QNetworkAccessManager.PutOperation: