[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Reports from Brazilian Open Software Conference 2003 (long)
From:       Waldo Bastian <bastian () kde ! org>
Date:       2003-06-12 13:13:25
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 10 June 2003 18:42, Avi wrote:
> On Tue, 10 Jun 2003 15:24:58 +0200, "Thiago Macieira"
>
> <thiagom@wanadoo.fr> said:
> > SOCKS support has been in KDE since release 2.2. It's one global
> > configuration
> > for all KDE applications (that is, those that use the KDE socket classes
> > instead of QSocket).
>
> Yeah, but it doesn't work.... There are many bugreports about it.
> Konqueror sometimes work but makes it do little hangs from 5 to 5
> minutes.

Which socks implementation are you using? I tested with Dante version 1.1.13 
and that one has problems with non-blocking connects, which is what KDE tends 
to use. When configuring it says here:

select:    incorrect select behaviour on unconnected sockets,
           operations on nonblocking sockets might fail on this platform

With the attached KDE patch things should work again more or less work. It 
will make sure to use blocking connects when using dante.

Haven't tested NEC SOCKS yet.

Cheers,
Waldo
- -- 
bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+6Hx1N4pvrENfboIRAqwDAJwMp5b0HUPEKDwvzxlXDOd834frLACdFzZw
T0hJSKQWw0ThqKmbZImf5Lw=
=//fT
-----END PGP SIGNATURE-----

["dante_socks.patch" (text/x-diff)]

Index: kextsock.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kextsock.cpp,v
retrieving revision 1.59
diff -u -r1.59 kextsock.cpp
--- kextsock.cpp	29 May 2003 18:09:04 -0000	1.59
+++ kextsock.cpp	12 Jun 2003 12:59:53 -0000
@@ -1356,7 +1356,7 @@
       d->status = created;
 
       // check if we have to do timeout
-      if (doingtimeout)
+      if (doingtimeout && KSocks::self()->hasWorkingAsyncConnect())
 	{
 	  fd_set rd, wr;
 
@@ -2186,7 +2186,8 @@
 	  cleanError();
 	}
 
-      setBlockingMode(false);
+      if (KSocks::self()->hasWorkingAsyncConnect())
+        setBlockingMode(false);
       if (KSocks::self()->connect(sockfd, p->ai_addr, p->ai_addrlen) == -1)
 	{
 	  if (errno != EWOULDBLOCK && errno != EINPROGRESS)
Index: ksocks.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/ksocks.cpp,v
retrieving revision 1.24
diff -u -r1.24 ksocks.cpp
--- ksocks.cpp	25 May 2003 13:04:37 -0000	1.24
+++ ksocks.cpp	12 Jun 2003 12:59:54 -0000
@@ -89,10 +89,11 @@
    QMap<SymbolKeys,QString>  symbols;
    // The name of this library
    QString                   myname;
+   bool                      hasWorkingAsyncConnect;
 };
 
 
-KSocksTable::KSocksTable() : myname("Unknown") {
+KSocksTable::KSocksTable() : myname("Unknown"), hasWorkingAsyncConnect(true) {
 }
 
 
@@ -162,6 +163,7 @@
 };
 
 KDanteSocksTable::KDanteSocksTable() : KSocksTable() {
+  hasWorkingAsyncConnect = false;
   myname = i18n("Dante SOCKS client");
   symbols.insert(S_SOCKSinit,   "SOCKSinit");
   symbols.insert(S_connect,     "Rconnect");
@@ -406,7 +408,6 @@
    _me = med.setObject(0L);
 }
 
-
 void KSocks::die() {
    if (_me == this) {
       _me = med.setObject(0L);
@@ -450,6 +451,10 @@
       _useSocks = true;
 }
 
+bool KSocks::hasWorkingAsyncConnect()
+{
+   return (_useSocks && _st) ? _st->hasWorkingAsyncConnect : true;
+}
 
 
 /*
Index: ksocks.h
===================================================================
RCS file: /home/kde/kdelibs/kdecore/ksocks.h,v
retrieving revision 1.13
diff -u -r1.13 ksocks.h
--- ksocks.h	25 May 2003 13:04:37 -0000	1.13
+++ ksocks.h	12 Jun 2003 12:59:54 -0000
@@ -81,6 +81,12 @@
     */
    bool hasSocks();
 
+   /**
+    * Returns whether asynchronous connects work with the
+    * selected SOCKS impementation
+    */
+   bool hasWorkingAsyncConnect();
+
    /*
     **     REIMPLEMENTATIONS OF LIBC SOCKET FUNCTIONS
     **/


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic