aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Transports/http/httpstreamreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Transports/http/httpstreamreader.cpp')
-rw-r--r--src/plugins/Transports/http/httpstreamreader.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/Transports/http/httpstreamreader.cpp b/src/plugins/Transports/http/httpstreamreader.cpp
index 82a5e2f29..717276964 100644
--- a/src/plugins/Transports/http/httpstreamreader.cpp
+++ b/src/plugins/Transports/http/httpstreamreader.cpp
@@ -274,6 +274,7 @@ void HttpStreamReader::abort()
curl_easy_cleanup(m_handle);
m_handle = 0;
}
+ QIODevice::close();
}
qint64 HttpStreamReader::bytesAvailable() const
@@ -285,6 +286,7 @@ void HttpStreamReader::run()
{
qDebug("HttpStreamReader: starting download thread");
char errorBuffer[CURL_ERROR_SIZE];
+ memset(errorBuffer, 0, sizeof(errorBuffer));
m_handle = curl_easy_init();
//proxy
if (QmmpSettings::instance()->isProxyEnabled())
@@ -351,8 +353,8 @@ void HttpStreamReader::run()
{
setErrorString(errorBuffer);
emit error();
+ QIODevice::close();
}
- QIODevice::close();
}
qint64 HttpStreamReader::readBuffer(char* data, qint64 maxlen)