[Pidgin] #5057: libpurple doesn't connect through proxy
Pidgin
trac at pidgin.im
Mon Mar 3 17:28:11 EST 2008
#5057: libpurple doesn't connect through proxy
-----------------------+----------------------------------------------------
Reporter: dasvo | Type: patch
Status: new | Priority: minor
Component: libpurple | Version: 2.3.1
Keywords: | Pending: 0
-----------------------+----------------------------------------------------
I have a problem connecting through proxy to Microsoft messenger account.
Once upon a time I tried to report this problem through Adium X project,
but the connection still doesn't work. So I decided finally to look to the
code.
I found the problem in '''proxy.c'''. There in function
'''proxy_connect_http''' after call to connect when connect returns either
EINPROGRESS or EINTR (meaning connection is still in progress) and port is
80 the "connection succeeded" callback is calleb even though the
connection is still in progress, creating the race condition. The
subsequent call to write in "connection succeded" callback tries to write
to the filedescriptor but returns with errno=ENOTCONN (57), which means
that socket is not connected yet.
The solution to this problem would be replace (in function
proxy_connect_http in proxy.c):
purple_debug_info("proxy", "HTTP proxy
connection established\n");
purple_proxy_connect_data_connected(connect_data);
by:
connect_data->inpa =
purple_input_add(connect_data->fd,
PURPLE_INPUT_WRITE,
socket_ready_cb, connect_data);
the socket_ready_cb makes sure that the socket is REALLY connected and can
be used for writing.
The code was tested using libpurple 2.3.1, confirmed that it works as
expected using AdiumX project and confirmed that it is still not fixed in
2.4 of pidgin.
Thanks,
Daniel
--
Ticket URL: <http://developer.pidgin.im/ticket/5057>
Pidgin <http://pidgin.im>
Pidgin
More information about the Tracker
mailing list