summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/network/access/qhttpthreaddelegate_p.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h
index c105ca2..49bdf81 100644
--- a/src/network/access/qhttpthreaddelegate_p.h
+++ b/src/network/access/qhttpthreaddelegate_p.h
@@ -207,18 +207,21 @@ public:
const char* readPointer(qint64 maximumLength, qint64 &len)
{
- if (m_amount == 0 && wantDataPending == false) {
+ if (m_amount > 0) {
+ len = m_amount;
+ return m_data;
+ }
+
+ if (m_atEnd) {
+ len = -1;
+ } else if (!wantDataPending) {
len = 0;
wantDataPending = true;
emit wantData(maximumLength);
- } else if (m_amount == 0 && wantDataPending == true) {
+ } else {
// Do nothing, we already sent a wantData signal and wait for results
len = 0;
- } else if (m_amount > 0) {
- len = m_amount;
- return m_data;
}
- // cannot happen
return 0;
}