cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURL and LDAP

From: Jean-Christophe Dubois <jcd_at_one.com>
Date: Wed, 30 May 2001 21:49:02 -0400

Hello,

I am new to CURL (7.7.3) and I tried to access and LDAP server
(openldap 2.0.8) using the libcurl library. I was trying to retrieve a
big chunk of data (1.6MB) and using the tools that come with openldap
(ldapsearch) I have no problem doing it.

Then I tried to use CURL to do the same thing and I got the following
problem:

1) Build time: I am compiling on Solaris 2.6 using GNU 2.95.2, openssl
0.9.6 and openldap 2.0.8. Using "configure" I didn't found a way to
enable HAVE_DLOPEN or HAVE_LIBDL in config .h. dlopen is detected by
configure but it is not then "defined" in config .h. I worked around it
(I am not a "configure" expert) by defining these 2 flags in
CFLAGS before running "configure". Is there a "better" way to do it
(there must be one).

2) Run time: "curl" (the binary) seems to retrieve only the begining of
the file and it will then block for ever on fread().

The comand is as follow:
/cm/openSoftware/curl/7.7.3/SPARC_SOLARIS2.6_GNU2.95.2/Ocurl/reloc/bin/curl
-B -u "cn=Manager,dc=one,dc=com:secret" --max-time 15
ldap://argus.one.com/cn=TestEntry,dc=one,dc=com?testfile

The output is bellow and the process hangs forever:
"TestEntry, one, com" Testfile: # PaCkAgE DaTaStReAm
ONESmartA 1 3216
# end of header

The backtrace is as follow Which seems to be strange as I would expect
it to be in some Curl_ldap_xxx function:
(gdb) where
#0 0xef3b93b8 in _read () from /usr/lib/libc.so.1
#1 0xef3e5a84 in _filbuf () from /usr/lib/libc.so.1
#2 0xef3e8f78 in fread () from /usr/lib/libc.so.1
#3 0xef786c60 in Transfer ()
   from
/cm/openSoftware/curl/7.7.3/SPARC_SOLARIS2.6_GNU2.95.2/Ocurl/reloc/bin/../lib/libcurl.so.2

#4 0xef7872ec in Curl_perform ()
   from
/cm/openSoftware/curl/7.7.3/SPARC_SOLARIS2.6_GNU2.95.2/Ocurl/reloc/bin/../lib/libcurl.so.2

#5 0xef787d28 in curl_easy_perform ()
   from
/cm/openSoftware/curl/7.7.3/SPARC_SOLARIS2.6_GNU2.95.2/Ocurl/reloc/bin/../lib/libcurl.so.2

#6 0x161d0 in ?? ()
#7 0x1650c in ?? ()
(gdb)

Any clue?

3) Code comment/question: For LDAP, libcurl is loading (dlopen) and
unloading (dlclose) the LDAP library for each call. It seems that it is
a bit inneficient if you plan to access mainly LDAP using CURL. Why is
it this "special" way with LDAP?

Thanks for you help.

JC

_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-05-31