- The function exits and returns codes of 0, -1 and -2 if the
- connection was closed, there was a read error, or if it could not
- write to the output stream, respectively. */
+ TOREAD is the amount of data expected to arrive, normally only used
+ by the progress gauge.
+
+ STARTPOS is the position from which the download starts, used by
+ the progress gauge. If QTYREAD is non-NULL, the value it points to
+ is incremented by the amount of data read from the network. If
+ QTYWRITTEN is non-NULL, the value it points to is incremented by
+ the amount of data written to disk. The time it took to download
+ the data (in milliseconds) is stored to ELAPSED.
+
+ The function exits and returns the amount of data read. In case of
+ error while reading data, -1 is returned. In case of error while
+ writing data, -2 is returned. */