pkgsrc-WIP-discuss archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kopete (KDE 4.3.0) and Yahoo (fixed)



Hi,

It appears that not many use kopete with Yahoo, but for those who do and have 
connection problems, the following patch (to kdelibs4) may help.

The connection failure that I am seeing happens because the Yahoo connection 
socket has its mode set to read-only.  Kopete is therefore unable to send any 
data to Yahoo. 

Analysis:

When the socket is set up (by KBufferedSocket), the default mode is read-only.  
Later the method "connect" is called with the hostname and port.  At this 
point, the KBufferedSocket instance is changed to read-write but the internal 
socket device (returned by the socketDevice() call) is still read-only.  The 
reason for that is that the call to KSocketDevice::connect follows the path

if (kde_connect(m_sockfd, address.address(), address.length()) == -1)
     {
       if (errno == EISCONN)
         return true;  <--- we end up here!!!

bypassing the open call (at the bottom of the function) that sets the mode to 
read-write.

The patch corrects this.

Regards,
Sverre
--- kdecore/network/k3socketdevice.cpp.orig     2009-09-24 09:21:38.000000000 
-0600
+++ kdecore/network/k3socketdevice.cpp  2009-09-24 09:23:15.000000000 -0600
@@ -352,9 +352,13 @@ bool KSocketDevice::connect(const KResol
   if (kde_connect(m_sockfd, address.address(), address.length()) == -1)
     {
       if (errno == EISCONN)
-       return true;            // we're already connected
+       {
+         KActiveSocketBase::open(Unbuffered | mode);
+         return true;          // we're already connected
+       }
       else if (errno == EALREADY || errno == EINPROGRESS)
        {
+         KActiveSocketBase::open(Unbuffered | mode);
          setError(InProgress);
          return true;
        }
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss


Home | Main Index | Thread Index | Old Index