After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 361941 - Slow download / Download corrupted in 0.116, fix included
Slow download / Download corrupted in 0.116, fix included
Status: RESOLVED FIXED
Product: Pan
Classification: Other
Component: general
pre-1.0 betas
Other Linux
: Normal critical
: 1.0
Assigned To: Charles Kerr
Pan QA Team
: 361384 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-10-13 14:44 UTC by Stéphane BERTHELOT
Modified: 2006-11-05 09:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stéphane BERTHELOT 2006-10-13 14:44:21 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
Comment 1 Charles Kerr 2006-10-13 15:29:44 UTC
Thanks!!
Comment 2 Charles Kerr 2006-10-13 15:31:07 UTC
*** Bug 361384 has been marked as a duplicate of this bug. ***
Comment 3 Adrian Yee 2006-11-05 09:58:53 UTC
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.