GNOME Bugzilla – Bug 615494
Connction timeouts produce partially invalid error messages
Last modified: 2010-04-27 13:04:55 UTC
Created attachment 158462 [details] Sample program to trigger invalid error message When trying to connect to a server with the function g_socket_client_connect_to_host, the error message produced is only valid for the first 146 bytes at which point garbage characters appear: "Error connecting: A connection attempt failed because the connected party did not properly respond after a period of time, or established connecti\xb9\xadCg" This has happened in 2.20 as well as 2.24, however I've only tested it with the connect_to_host function and its asynchronous counterpart. It happens consistently and without any apparent interference from other things. I've attached a sample program to show how this error is triggered, using google.com, which lets the connections time out on the non-standard ports. Compile it with: gcc `pkg-config gio-2.0 --cflags` -o connecterr network.c `pkg-config gio-2.0 --libs`
Hmm, this is on Windows, so I might want to have a look eventually. On the other hand, I didn't write the code in question, so I don't want this to fall off the radar of those who feel responsible for the code in question by setting component to "win32". I wonder what would be the best way to keep it both on my radar (I currently use a search that looks for bugs assigned to gtk-win32-maint when looking for "my" bugs) *and* on the "GIO radar".
Created attachment 158489 [details] [review] GSocket: fix garbled error messages on windows not sure about the general problem of marking bugs both win32 and gio... maybe we could cc: gtk-win32-maint? anyway, this one is pretty easy; the code was trying to make g_win32_error_message() behave more like strerror(), and failing. Patch is untested; I tested that making the unix version work the same way did the right thing there, so it's probably right, but...
Comment on attachment 158462 [details] Sample program to trigger invalid error message Fixed the MIME Type of the attachment
I don't think you are going to get much testing by just waiting. Just commit and push, I'd say...
ok. (i tried testing it this weekend, but non-blocking connects weren't working right in wine; the test program was failing-to-fail because wine was claiming that the connect() succeeded.) Attachment 158489 [details] pushed as 5046dfc - GSocket: fix garbled error messages on windows