GNOME Bugzilla – Bug 650439
Race when proxy is enabled
Last modified: 2011-05-18 15:05:58 UTC
I have a program that tries to create three TLS connections at approximately the same time each from separate thread. Each thread is using a GSocketClient. The result is that it always seem to fail for two of the connections (sometimes only one) while one of them works (almost always the first one). It fails with this error Proxy protocol 'http' is not supported. (g-io-error-quark, 15) I captured a stack trace when it fails, see [1]. I wondered why it was trying to use a HTTP proxy and then I realized that it could be because I have my proxy settings set to Mode: Automatic Configuration URL: http://wpad/wpad.dat If I disable the HTTP proxy then things work just fine. As you can see, each socket client is trying to connect to host_and_port=0x638530 "imap.gmail.com" default_port=993 and I've also set the GSocketClient:tls property to TRUE. See http://cgit.freedesktop.org/~david/goa/tree/src/goabackend/goaimapclient.c#n217 for the actual code in question. So this must be a bug with how proxying is handled. Thoughts? [1] : (gdb) thread [Current thread is 5 (Thread 0x7ffff5b03700 (LWP 24667))] (gdb) print protocol $1 = (const gchar *) 0x7fffe00047a0 "http"
+ Trace 227163
Btw, why are we trying to use the proxy server at all for this kind of connection?
Created attachment 188029 [details] [review] Saw this potential optimization in passing
Created attachment 188030 [details] [review] Add locking Just locking around the settings fixes the problem for me.
Created attachment 188033 [details] [review] Add locking v2 Fix typo (s/lock/unlock)
Comment on attachment 188029 [details] [review] Saw this potential optimization in passing as mentioned on irc, good except for the spaces-vs-tabs
(In reply to comment #5) > (From update of attachment 188029 [details] [review]) > as mentioned on irc, good except for the spaces-vs-tabs This patch is already using tabs not spaces, no?
Thanks for the review, committed both patches!