On Fri, Aug 10, 2007 at 10:46:49AM +0200, Yves Martin wrote:
> On Fri, 2007-08-10 at 09:44 +0100, Joe Orton wrote:
> 
> > Not sure why that would happen, but since the function isn't used 
> > outside the SSPI code can you just add it (with the static qualifier) 
> > inside ne_sspi.c?
> 
> Good idea.
> 
> The "ne_canonicalize" requires many conditional includes that are
> already set in ne_socket.c but not in ne_sspi.c. My first idea was to
> reduce the changes in ne_sspi.c.

Ah.  Of course, I forgot this needs extra help from the resolver code, 
sorry.

I've added ne_iaddr_reverse() on the SVN trunk which should be all 
that's needed from ne_socket.[ch].  So the canonicalisation should now 
be as simple as something like:

static char *canonical_dns(const char *hostname) 
{
   ne_sock_addr *addr = ne_addr_resolve(hostname, 0);
   char canon[256], *result;

   if (!addr) {
       return ne_strdup(hostname);
   }
   
   if (ne_iaddr_reverse(ne_addr_first(addr), canon, sizeof canon) == 0) {
       result = ne_strdup(canon);
   }
   else {
       result = ne_strdup(hostname);
   }

   ne_addr_destroy(addr);
 
   return result;
}

_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to