[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: error handling in async functions



On Sun, Apr 09, 2000 at 09:36:47PM -0700, Kurt D. Zeilenga wrote:
> At 11:36 PM 4/4/00 +0300, Adrian Pavlykevych wrote:
> >Where I can find list of connection related errors reported by asynchronous
> >ldap_search(), and which are handled by ldap_result()?
> 
> If ldap_search() returns an error, it's unlikely that the request
> was sent to the server.  Hence, you'd likely not bother to call ldap_result()
> for response.

Yes, I'm perfectly aware of this, the question is, how I can distinguish ldap_search() failure due to server problems, from that generated because of some local error conditions (malloc() failure, encoding problem, etc.)? I don't wan't to perform bind/unbind on each request, because that inhibits me from using cache on the client side,  but in this case I have to decide whenever reconnecting is necessary/possible upon _every_ error returned by LDAP functions I call in the process.

As last resort I'll read the source of all underlying functions to determine which error codes could be returned by ldap_search() and their meaning. I was asking this question on the list just to be sure that I didn't miss some documentation or description, which could spare me from going through all source code.

The error codes in question are:
LDAP_PROTOCOL_ERROR
LDAP_BUSY
LDAP_UNAVAILABLE
LDAP_UNWILLING_TO_PERFORM
LDAP_CONNECT_ERROR

If someone would be willing to give short comments about conditions to which applies each of thoses error codes, I'd be very gratefull.

> 
> >I need to catch all possible server failures while operating  asyncronously -
> >ldap_result() is in polling mode.
> >
> >I've read RFC1823, but it doesn't cover the topic which errors are reported on
> >which stage folowing execution path:
> >ldap_init()
> >ldap_bind()
> >ldap_search()
> >while(ldap_result()) {
> >        [ ... processing ... ]
> >}
> 
> Since you're toying with devel codes, you should read the ldap-c-api
> I-D in the docs/drafts directory.

Unfortunately it doesn't contail information about subsets of error codes returned by each function.

> 
> >Could someone tell, when connection errors could be reported (e.g. whenever
> >socket operation errors will be reported by ldap_search() or ldap_result()?
> 
> You should avoid worrying about socket
> errors and just deal with LDAP result codes.

What I meant, was whenever it  is  ldap_search() that returns error upon failure to send query to the server, or ldap_result().

Thanks for your patience and will to help,

-- 
Adrian Pavlykevych 			email: 		<pam@polynet.lviv.ua>
System Administrator			phone/fax:	+380 (322) 742041
State University "Lvivska Polytechnica"