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 122291 - GIOChannel loses data when sending large block in buffered mode
GIOChannel loses data when sending large block in buffered mode
Status: RESOLVED INCOMPLETE
Product: glib
Classification: Platform
Component: general
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 119285
 
 
Reported: 2003-09-14 21:34 UTC by Christophe Lambin
Modified: 2011-02-18 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
server.c (2.09 KB, text/plain)
2003-09-14 21:35 UTC, Christophe Lambin
Details
client.c (2.61 KB, text/plain)
2003-09-14 21:36 UTC, Christophe Lambin
Details
non-gnet client. Compile w/ -DUNBUFFERED for unbuffered writes (3.49 KB, text/plain)
2003-09-15 22:28 UTC, Christophe Lambin
Details

Description Christophe Lambin 2003-09-14 21:34:52 UTC
In Pan, we use GIOChannel to communicate with the NNTP server. We've
noticed that, when sending a large post, GIOChannel loses data when it's in
buffered mode (see bug #119285).

The workaround is to switch to non-buffered mode when sending, though I'd
like to understand whether this behaviour isn't a glib bug and if not, why
we're seeing this.

I'll attach two programs that reproduce this problem. server.c is a pure
libc-based server and client.c is a glib-based client, implementing both
buffered and non-buffered sending.  The client uses gnet to establish the
connection, though that's easily changed, if you do not have gnet installed.

The protocol is NNTP-like:

--> DATA <n>     (number of bytes to expect)
<-- OK <n>       (number of bytes to expect)
--> XXXX...X     (n bytes of data)
<-- OK <n>       (number of bytes received)

This works OK over loopback (lo), but going over an ADSL line, the server
will not receive all data most of the time.

Compile as:
$ cc -g -Wall -o server server.c
$ cc -g -Wall `pkg-config --cflags gnet-2.0` -o ../bin/glib client.c
`pkg-config --libs gnet-2.0`
$ cc -g -Wall `pkg-config --cflags gnet-2.0` -o ../bin/glib-unbuf client.c
`pkg-config --libs gnet-2.0` -DUNBUFFERED
Comment 1 Christophe Lambin 2003-09-14 21:35:44 UTC
Created attachment 19928 [details]
server.c
Comment 2 Christophe Lambin 2003-09-14 21:36:12 UTC
Created attachment 19929 [details]
client.c
Comment 3 Owen Taylor 2003-09-15 16:32:58 UTC
Yes, we need a non-GNET-based test case. (Installing GNET
is one issue. Another is verifying that it isn't the actual
cause of the problem.)
Comment 4 Christophe Lambin 2003-09-15 22:28:45 UTC
Created attachment 19965 [details]
non-gnet client.  Compile w/ -DUNBUFFERED for unbuffered writes
Comment 5 Christophe Lambin 2003-11-13 22:23:56 UTC
owen: ping?  :)
Comment 6 Owen Taylor 2004-03-14 04:42:04 UTC
My comment above was just a comment about what was needed in
general in order there to be any chance that a GLib developer
would be able to look at the bug; not saying "if you
provide such a test case, I'll debug it".

I'm going to spend about 10 minutes looking at this now; if
that doesn't turn anything up, well, we'd really appreciate
getting help in looking into this...
Comment 7 Owen Taylor 2004-03-14 04:51:11 UTC
I can't reproduce any problems with the connection round tripped
over an ADSL line with 30ms of latency each way. All 20000
bytes are sent succesfully every time.
Comment 8 Christophe Lambin 2004-03-16 21:54:51 UTC
owen: apologies. didn't mean to push. :)  We had a release due, so
wanted to check for progress.

We've got a workaround for this in Pan, so the urgency's gone. Since I
no longer have a suitable test environment, feel free to close / mark
as needinfo.