Branch: Tag:

2008-10-29

2008-10-29 14:19:08 by Martin Stjernholm <mast@lysator.liu.se>

Improved reporting of socket errors.

Rev: lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1.117
Rev: lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike:1.23

2:      // LDAP client protocol implementation for Pike.   // - // $Id: client.pike,v 1.116 2008/09/07 22:48:58 mast Exp $ + // $Id: client.pike,v 1.117 2008/10/29 14:19:08 mast Exp $   //   // Honza Petrous, hop@unibase.cz   //
701: Inside #if undefined(PARSE_RFCS) and #if constant(SSL.Cipher.CipherAlgorithm)
   });    }   #endif +  +  Stdio.File low_fd = Stdio.File(); +     if(!(low_fd->connect(lauth->host, lauth->port))) {    //errno = ldapfd->errno(); -  seterr (LDAP_SERVER_DOWN); -  DWRITE("client.create: ERROR: can't open socket.\n"); +  seterr (LDAP_SERVER_DOWN, strerror (low_fd->errno()));    //ldapfd->destroy();    //ldap=0;    //ok = 0;    //if(con_fail)    // con_fail(this, @extra_args); -  THROW(({"Failed to connect to LDAP server.\n",backtrace()})); +  ERROR ("Failed to connect to LDAP server: %s\n", ldap_rem_errstr);    }      #if constant(SSL.Cipher.CipherAlgorithm)