QSocket problem with transconnect (proxy)?
Michael Goffioul
goffioul at imec.be
Wed Jun 19 10:15:59 BST 2002
Hi,
I found a weird behavior in QSocket but I don't know if it's a bug
or not. I found the problem when using QSocket along with transconnect,
a utility that redirect "connect" calls to a HTTP proxy by preloading
a dynamic library.
The problem appeared when trying to make a connection on localhost:631.
I traced the process inside QSocket and here's what's happening (more
or less):
1) perform a host lookup
2) tried to connect on the first address found (127.0.0.1)
3) in my case the connection is established immediately, that is
d->socket->connect() returns true. The write socket notifier
is enabled.
4) the notifier fires an event on QSocket -> QSocket::tryConnection()
5) tries AGAIN to connect but this time using d->addr and d->port,
however d->addr == 0.0.0.0. I looked into qsocket.cpp and this is
the only place where d->addr is used, so I don't know if d->addr
can be different from 0.0.0.0, and where it might be set to something
different.
I found it because when you use transconnect, each connect is analyzed
by this utility: the first address 127.0.0.1 is usually covered and
considered as local such that no proxy is used. However the second
one 0.0.0.0 is not covered as local address and the utility tries to
use the proxy and just fails.
Bye.
Michael.
--
------------------------------------------------------------------
Michael Goffioul IMEC-DESICS-MIRA
e-mail: goffioul at imec.be (Mixed-Signal and RF Applications)
Tel: +32/16/28-8510 Kapeldreef, 75
Fax: +32/16/28-1515 3001 HEVERLEE, BELGIUM
------------------------------------------------------------------
More information about the kde-core-devel
mailing list