GNOME Bugzilla – Bug 361941
Slow download / Download corrupted in 0.116, fix included
Last modified: 2006-11-05 09:58:53 UTC
+++ This bug was initially created as a clone of Bug #359197 +++ The bug #359197 was closed and I couldn't reopen it. I saw someone posted something already on downloads corrupted with 0.116 but did not provide enough details and didn't see this bug is related to #359197 In fact, when getting data, sometimes we get very small chunks (shortest than one line) and then go many times in a row with status == G_IO_STATUS_AGAIN (socket-impl-gio.cc around line 376). But in your _partial_line variable you use assign which clears the string and put the new data in. That's where the bug kicks in. At my download speed (around 2MB/s, ~16Mb/s) it happens that the status goes on G_IO_STATUS_AGAIN two times in a row but there is useful data in the buffer. The actual code simply overwrite the whole _partial_line content on second time rather than appending data to it (moreover you use clear() when needed I think) So fixing it is rather simple : pan/tasks/socket-impl-gio.cc:380 - _partial_line.assign (_channel->read_buf->str, _channel->read_buf->len); + _partial_line.append (_channel->read_buf->str, _channel->read_buf->len); Then everything is downloaded fine for me again with this and at full speed. I am not 100% sure that the _partial_line is in all cases cleared when needed, but at least this patch will fix corrupted binary downloads from everyone using 0.116. Stephane
Thanks!!
*** Bug 361384 has been marked as a duplicate of this bug. ***
This patch fixed my stalling/corruption problems in 0.117, but in 0.118 it seems it's doing it again (at least the stalling). It doesn't seem to be happening as often, but it's occurring again.