gap-dev-discuss
[Top][All Lists]
Advanced

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

Re: [Gap-dev-discuss] GNUMail doesn't connect to IMAP Server


From: Sebastian Reitenbach
Subject: Re: [Gap-dev-discuss] GNUMail doesn't connect to IMAP Server
Date: Tue, 07 Aug 2012 19:18:05 +0200
User-agent: SOGoMail 1.3.17

 
On Tuesday, August 7, 2012 14:38 CEST, Riccardo Mottola <address@hidden> wrote: 
 
> Hi Sebastian,
> 
> Sebastian Reitenbach wrote:
> > Hi,
> >
> > sending this to the GAP list, since the gnustep-nonfsf doesn't have a m/l.
> >
> > With the Pantomime/GNUMail from GNUstep-nonfsf I always had the problem that
> > I was unable to connect to IMAP Server. It did not even tried to establish 
> > a connection
> > to the IMAP Server. I was looking into it, and found it was trying to find 
> > get the IP of
> > the IMAP Server in the CSDNSManager. While parsing the resolv.conf file, and
> > trying to initialize DNS structure, it did not succeed, and therefore, in 
> > CSTCPConnection
> > it then did not tried to connect to the server.
> >
> > I've seen Riccardo did a lot of things there, but I don't really understand 
> > what
> > he is trying to do. The ChangeLog entry tells me:
> >          Use res_ninit() on NetBSD to fix long-standing incompatibility
> >
> > So, reverting the CWDNSManager.[h|m] and the CWTCPConnection.[h|m] to the
> > files from Pantomime-1.2.0pre3 makes my GNUMail connect to my IMAP Server.
> > But this may or may not break things again for Riccardo on NetBSD.
> >
> > As always, I'm on OpenBSD.
> >
> > Any objections to go back to the older versions, and restart looking into 
> > the
> > NetBSD issue again?
> >
> Yes, lots of objections :) My changes are much much smaller, you are 
> comparing too many versions together, with many changes by Ludovic 
> perhaps.. I did the changes to the butlast version, already present in 
> non-fsf and in the past pre-releases. My changes are restriceted to one 
> method and the goal is to use res_ninit() which is thread-safe instead 
> of res_init(). There is the possibility to enable it for one or the 
> other platform. For me it works on Linux and NetBSD if yo udo not 
> require password authentication (see numerous threads on the gnustep ML 
> where I called for help). I Am pretty sure I dod no harm on OpenBSD 
> either. At least, no harm compared to the previous version of the file.
> 
> Check:
> http://svn.gna.org/viewcvs/gnustep-nonfsf/frameworks/pantomime/Framework/Pantomime/CWDNSManager.m?r1=10&r2=66
> 
> and play with  #define HAS_RES_NINIT 1
> 
> As you see, it is enabled only for NetBSD currently. The goal is to test 
> it on other platforms too, since it would be the way to go. As-is my 
> change should not affect other platforms.
> 
> Riccardo
> 
> Riccardo
 
How about this then: This now works for me. I figured, when I explicityl set 
theBOOL to NO, then it worked immediately,
so I looked closer and figured, I have to move the whole if (theBOOL) down, 
because _servers is at that time still
empty, and it doesn't know which servers to query and therefore refuses to get 
back with a name.
With it moved down, after the if (!o) chunk, it perfectly works for me.

Does it still work for you on NetBSD and Linux?

The patch to Framework/Pantomime/io.c is to get rid of a compiler warning, 
implicit declaration of abort()



cheers,
Sebastian


 $OpenBSD$
--- Framework/Pantomime/CWDNSManager.m.orig     Tue Aug  7 19:09:47 2012
+++ Framework/Pantomime/CWDNSManager.m  Tue Aug  7 19:11:20 2012
@@ -261,29 +261,6 @@ void dns_socket_callback(CFSocketRef s, CFSocketCallBa
 
   o = [_cache objectForKey: theName];
   
-  if (theBOOL)
-    {      
-      if (o)
-       {
-         POST_NOTIFICATION(PantomimeDNSResolutionCompleted, self, 
([NSDictionary dictionaryWithObjectsAndKeys: theName, @"Name", [o 
objectAtIndex: 0], @"Address", nil]));
-       }
-      else
-       {
-         CWDNSRequest *aRequest;
-         aRequest = AUTORELEASE([[CWDNSRequest alloc] initWithName: theName]);
-         aRequest->packet_id = _packet_id++;
-         aRequest->servers = [[NSMutableArray alloc] initWithArray: _servers];
-         aRequest->count = 0;
-
-         if ([_servers count])
-           {
-             [self _sendRequest: aRequest];
-           }
-       }
-
-      return nil;
-    }
-
   if (!o)
     {
       struct hostent *host_info;
@@ -334,6 +311,30 @@ void dns_socket_callback(CFSocketRef s, CFSocketCallBa
        {
          o = nil;
        }
+    }
+  if (theBOOL)
+    {      
+      if (o)
+       {
+         POST_NOTIFICATION(PantomimeDNSResolutionCompleted, self, 
+               ([NSDictionary dictionaryWithObjectsAndKeys: theName, @"Name", 
+                       [o objectAtIndex: 0], @"Address", nil]));
+       }
+      else
+       {
+         CWDNSRequest *aRequest;
+         aRequest = AUTORELEASE([[CWDNSRequest alloc] initWithName: theName]);
+         aRequest->packet_id = _packet_id++;
+         aRequest->servers = [[NSMutableArray alloc] initWithArray: _servers];
+         aRequest->count = 0;
+
+         if ([_servers count])
+           {
+             [self _sendRequest: aRequest];
+           }
+       }
+
+      return nil;
     }
   
   return o;
$OpenBSD$
--- Framework/Pantomime/io.c.orig       Tue Aug  7 13:33:26 2012
+++ Framework/Pantomime/io.c    Tue Aug  7 13:34:00 2012
@@ -31,6 +31,7 @@
 #include <sys/socket.h>
 #endif
 
+#include <stdlib.h>    // For abort()
 #include <stdio.h>
 #include <string.h>     // For memset()
 #include <netinet/in.h> // For ntohs() and friends. 

 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]