Skip to content

Commit

Permalink
Drop replyReadyRead callback
Browse files Browse the repository at this point in the history
It interferes badly with streamed downloads and is unnecessary for
normal operations.
  • Loading branch information
EvaSDK committed Dec 27, 2016
1 parent a6a7739 commit 0a1da28
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions ghost/ghost.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,6 @@ def __init__(self, session, reply, content):
self._reply = reply


def replyReadyRead(reply):
if not hasattr(reply, 'data'):
reply.data = ''

reply.data += reply.peek(reply.bytesAvailable())


class NetworkAccessManager(QNetworkAccessManager):
"""Subclass QNetworkAccessManager to always cache the reply content
Expand Down Expand Up @@ -254,7 +247,6 @@ def createRequest(self, operation, request, data):
request,
data
)
reply.readyRead.connect(lambda reply=reply: replyReadyRead(reply))

reply.downloadProgress.connect(
lambda received, total:
Expand Down Expand Up @@ -1332,6 +1324,8 @@ def _request_ended(self, reply):
except AttributeError:
content = reply.readAll()

self.logger.debug('[%s] len %d', str(reply.url()), len(content))

self.http_resources.append(HttpResource(
self,
reply,
Expand Down

0 comments on commit 0a1da28

Please sign in to comment.