diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-23 11:01:28 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-23 11:01:28 +0100 |
commit | 96ec21dc0b6560cb2b86b744393b69b655af655b (patch) | |
tree | e3d03ceb9c021c6e0d67aacc50691eb60ca932e3 /src/core/net/url_request_custom_job_proxy.cpp | |
parent | c67337856dbaf66df813a176379a9f0a6fda2470 (diff) | |
parent | d7d40469b5bfad2cc1693ef663864d2b15d59687 (diff) |
Merge branch '5.14' into 5.15
Change-Id: I1230ec3a854c0798fa4f7960642e988b917f431e
Diffstat (limited to 'src/core/net/url_request_custom_job_proxy.cpp')
-rw-r--r-- | src/core/net/url_request_custom_job_proxy.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/net/url_request_custom_job_proxy.cpp b/src/core/net/url_request_custom_job_proxy.cpp index cd7e173ee..d2df64f2f 100644 --- a/src/core/net/url_request_custom_job_proxy.cpp +++ b/src/core/net/url_request_custom_job_proxy.cpp @@ -96,9 +96,14 @@ void URLRequestCustomJobProxy::reply(std::string mimeType, QIODevice *device) if (m_client->m_device && !m_client->m_device->isReadable()) m_client->m_device->open(QIODevice::ReadOnly); - qint64 size = m_client->m_device ? m_client->m_device->size() : -1; - if (size > 0) - m_client->notifyExpectedContentSize(size); + if (m_client->m_firstBytePosition > 0) + m_client->m_device->seek(m_client->m_firstBytePosition); + + qint64 deviceSize = m_client->m_device ? m_client->m_device->size() : -1; + qint64 remainingBytes = deviceSize - m_client->m_firstBytePosition; + if (remainingBytes > 0) + m_client->notifyExpectedContentSize(remainingBytes); + if (m_client->m_device && m_client->m_device->isReadable()) { m_started = true; m_client->notifyHeadersComplete(); |