On Thursday 10 June 2004 16:18, Graham Barr wrote:Thanks. I have been distracted as I am getting ready for a 2 week business trip to Dallas.
You're welcome.
I did not commit the patch before because I did not know whether you agreed
to it or not.
And also because I was not sure about the meaning/purpose of the callbacks
used in the various $ldap->add/modify/delete/moddn() calls inside
$entry->update().
I guess it is to set the entry's changtype to modify in case the $ldap action
succeeded (and only in that case).
Is this guess correct ?
yes.
If it is, shouldn't we try to achieve the same effect without the callback
to allow callbacks in OPTIONS i.e. $entry->update($ldap, callback => ....)
You cannot. If the $ldap object happens to be in async mode, the $mesg object does not have the response code in it. trying to call $mesg->code will for the operation to be sync'd
I may be mistaken, but I think with the actual code a user giving a callback
option will prevent the entry's changetype from being set.
Yes. We probably need something like
my %opt = @_; my $user_cb = delete $opt{callback}; my $cb = sub { ...; $user_cb->(@_) if $user_cb };
Then add %opt instead of @_ to the method calls
I notice you have been making many submits. If I have access while I am
away I will do a release. unless you have more to come ?
Only the one above and maybe the two for which I wanted your approval this week: - $ldif->code() i.e. code() method for Net::LDAP::LDIF - $entry->update($ldif) i.e. Net::LDAP::Entry->update can take either a NET::LDAP or a Net::LDAP::LDIF object as it's CLIENT argument
The latter one might be more complicated sicne it needs changes even in Net::LDAP::Message. So maybe that one can wait until after the release.
I still do not understand what it is you are trying todo with this second one, so I would like to see some sample code before it is applied.
To me it does not make any sense to update an ldif object, there is nothing to update. It is a stream of entries, so the file would be modified by calling $ldif->write
Graham.
But the $ldif->code() would be nice, and the one above might be necessary.
What do you think ?
Peter
-- Peter Marschall eMail: [EMAIL PROTECTED]