openldap: several minor improvements

- Early check proper LDAP URL syntax. Reject URLs with a userinfo part.
- Use dynamic memory for ldap_init_fd() URL rather than a
  stack-allocated buffer.
- Never chase referrals: supporting it would require additional parallel
  connections and alternate authentication credentials.
- Do not wait 1 microsecond while polling/reading query response data.
- Store last received server code for retrieval with CURLINFO_RESPONSE_CODE.

Closes #8140
This commit is contained in:
Patrick Monnerat 2021-12-14 15:42:47 +01:00 committed by Daniel Stenberg
parent 39406280bb
commit cdc1da9120
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 108 additions and 87 deletions

View file

@ -30,15 +30,14 @@ CURLINFO_RESPONSE_CODE \- get the last response code
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RESPONSE_CODE, long *codep);
.fi
.SH DESCRIPTION
Pass a pointer to a long to receive the last received HTTP, FTP or SMTP
response code. This option was previously known as CURLINFO_HTTP_CODE in
libcurl 7.10.7 and earlier. The stored value will be zero if no server
response code has been received. Note that a proxy's CONNECT response should
Pass a pointer to a long to receive the last received HTTP, FTP, SMTP or
LDAP (openldap only) response code. This option was previously known as
CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier.
The stored value will be zero if no server response code has been received.
Note that a proxy's CONNECT response should
be read with \fICURLINFO_HTTP_CONNECTCODE(3)\fP and not this.
Support for SMTP responses added in 7.25.0.
.SH PROTOCOLS
HTTP, FTP and SMTP
HTTP, FTP, SMTP and LDAP
.SH EXAMPLE
.nf
CURL *curl = curl_easy_init();
@ -55,6 +54,7 @@ if(curl) {
.fi
.SH AVAILABILITY
Added in 7.10.8. CURLINFO_HTTP_CODE was added in 7.4.1.
Support for SMTP responses added in 7.25.0, for OpenLDAP in 7.81.0.
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
.SH "SEE ALSO"