Priority: Not Evaluated
Affects Version/s: 4.6.0
Fix Version/s: None
When a HTTP POST request is created using QNetworkAccessManager::post and a sequential QIODevice, the data is buffered. The operation is finished when iodevice returns -1. In case of return 0, buffering stops but nothing is sent yet. Is this intended behavior?
qnetworkreplyimpl.cpp, lines 181-206:
Reads up to maxSize bytes from the device into data, and returns the number of bytes read or -1 if an error occurred. If there are no bytes to be read, this function should return -1 if there can never be more bytes available (for example: socket closed, pipe closed, sub-process finished).
0 is returned when no more data is available for reading. However, reading past the end of the stream is considered an error, so this function returns -1 in those cases (that is, reading on a closed socket or after a process has died).