GNOME Bugzilla – Bug 331224
networking bug on windows
Last modified: 2006-05-31 20:18:51 UTC
Please describe the problem: The networking code needs to be changed to work properly on windows. It needs to read all the data from the buffer before returning from the watch function. A change like the following should work. nntp.c: function nntp_read GIOStatus stat; while((stat=g_io_channel_read_line_string (channel, g, NULL, &err))!=G_IO_STATUS_AGAIN) switch (stat) { Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
what's the Windows behavior without the patch?
Pan stops receiving data from the socket. The problem with the patch is that it will freeze the ui while reading from the network. There is a glib bug open on this but the source of the problem hasn't been found yet. http://bugzilla.gnome.org/show_bug.cgi?id=331214 It's interesting that pan receives more data than the test case in that bug.
In case it still matters, the most efficient solution I came up with was to have a do nothing idle function running while a socket was being watched. Sinc only one idle function is needed at a time something like this would work: namespace { guint idle=0,ref=0;; gint idle() {return 1;} // or was it 0 to stay running? void ref_idle() { if(++ref==1) idle=g_idle_add } void unref_idle() { if(--ref==0) g_source_remove(idle) ? } } Then just ref_idle when adding a watch, and unref when ending a watch. Hopefully the real fix will make it into glib 2.12. At least this version shouldn't degrade the ui performance.
Is this still an issue with the rewrite? The reason I ask is that I use the Windows version periodically (with the glib 2.10 runtime from the gipm) without problems.
I haven't had any problems since the rewrite. So it looks like this bug can be closed.