On 31/12/03 8:26 pm, D.Kreft <[EMAIL PROTECTED]> wrote:

> On Tue, 16 Dec 2003, Chris Ridd did scribble:
> 
>> I can't really recall the details of the original problem, except I think
>> the ASN.1 got screwed up somehow so we were sending rubbish (legal BER, but
>> the wrong ASN.1) to the server. I can't remember when it was broken or what
>> version fixed it :-(
> 
> Okay, so here at home, I've gotten myself all set-up with the latest and
> greatest Bundle::Net::LDAP and all its merry prerequisites...and I'm running
> into a very interesting problem--modify() isn't returning a
> Net::LDAP::Message object (or a subclass thereof)--it's returning an integer
> value!
> 
> Here's the code:
> 
>   _debugf("Executing $method() on new ldap object");
>   $message = $new_ldap->$method(@{$args});
>   warn "Message returned: $message\n";
> 
> And here is what I'm given in return:
> 
>   + Executing modify() on new ldap object
>   Message returned: 81
> 
> I thought that these methods were always supposed to return a valid
> Net::LDAP::Message (or subclass thereof) object. Why am I getting an integer
> back?

There's at least one way where these methods return a non-object. Mostly
they call _error() to set an error code in a message object, but this isn't
always true - if $ldap->socket fails the integer LDAP_SERVER_DOWN is
returned (NB this is 81, so seems to be what you're getting)

This is probably not right, as it is inconsistent.

I suspect the socket failure case in _sendmesg() should be something like:

    my $socket = $ldap->socket
        or return _error($ldap, $mesg, LDAP_SERVER_DOWN, "$!");

Cheers,

Chris

Reply via email to