[Date Prev][Date Next]
(ITS#6197) ldap_err2string()/ldap_perror() strangeness
Full_Name: Hallvard B Furuseth
Version: HEAD, RE24
Submission from: (NULL) (220.127.116.11)
Submitted by: hallvard
ldap_err2string() and ldap_perror() use ldap_int_error(), which walks an
array looking for the result code. That's silly, I'll replace it with a
macroized switch statement unless someone protests. Compilers will
usually turn that into a binary search or better. A prebuilt hash would
be better, but would complicate source code maintenance. I might do
that someday if anyone cares.
Also don't see why ldap_perror() outputs a less informative error string
than ldap_err2string() for unknown result codes. ldap_perror says
"unknown result code" (with lowercase initial), while err2string says
"Unknown <API error/(extension) error/(private extension) error/error".
Looks like ldap_perror() could be improved by calling ldap_err2string().
(Yes I know ldap_perror is deprecated. See if I care, I like it.)