Commit b2f9011f authored by Harald Sitter's avatar Harald Sitter 🏳🌈
Browse files

Do not indicate an error when 0 bytes were read. Patch by Kamil Klimek.

Indeed we must not indicate an error when 0 bytes were received as this is a perfectly valid scenario (e.g. when the abstractstreamer is waiting for data to arrive, like in the case of a QIODevice's read function).

REVIEW: 100701
parent fd9d417a
......@@ -82,7 +82,9 @@ bool StreamReader::read(quint64 pos, int *length, char *buffer)
if (oldSize == currentBufferSize()) {
// We didn't get any more data
*length = oldSize;
ret = false;
// If we have some data to return, why tell to reader that we failed?
// Remember that length argument is more like maxSize not requiredSize
ret = *length > 0;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment