GNOME Bugzilla – Bug 669306
Gio async networking request doesn't work
Last modified: 2013-02-27 10:53:30 UTC
Created attachment 206681 [details] Test code (async) I'm trying to use Gio for a WebSocket client library, and I've found that the Gio.OutputStream.write_async() doesn't work properly. If I send this header: GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n It only sends the following (checked with wireshark): TP/1.1\r\nHost: www.google.com\r\n\r\n And, obviously, I get a 400 Bad Request error. Writing the same example with the synchronous methods, works perfectly. I attach some test code, doing the same request sync and asynchronously.
Created attachment 206682 [details] Test code (sync)
The problem is that python is GC'ing the string after passing it to g_output_stream_write_async(). Hm... I don't think there's currently any way to correctly annotate g_output_stream_write_async(). I'm going to file a g-i bug and make this depend on it.
Verified the async test code now works.