mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 17:18:48 -05:00
openldap: white space changes, fixed up the copyright years
This commit is contained in:
parent
9889db0433
commit
1f8e813919
@ -5,8 +5,8 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010, 2017, Howard Chu, <hyc@openldap.org>
|
* Copyright (C) 2010, Howard Chu, <hyc@openldap.org>
|
||||||
* Copyright (C) 2011 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 2011 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -221,7 +221,7 @@ static CURLcode ldap_connect(struct connectdata *conn, bool *done)
|
|||||||
if(conn->handler->flags & PROTOPT_SSL)
|
if(conn->handler->flags & PROTOPT_SSL)
|
||||||
*ptr++ = 's';
|
*ptr++ = 's';
|
||||||
snprintf(ptr, sizeof(hosturl)-(ptr-hosturl), "://%s:%d",
|
snprintf(ptr, sizeof(hosturl)-(ptr-hosturl), "://%s:%d",
|
||||||
conn->host.name, conn->remote_port);
|
conn->host.name, conn->remote_port);
|
||||||
|
|
||||||
#ifdef CURL_OPENLDAP_DEBUG
|
#ifdef CURL_OPENLDAP_DEBUG
|
||||||
static int do_trace = 0;
|
static int do_trace = 0;
|
||||||
@ -286,7 +286,7 @@ static CURLcode ldap_connecting(struct connectdata *conn, bool *done)
|
|||||||
|
|
||||||
tvp = &tv;
|
tvp = &tv;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
if(!li->didbind) {
|
if(!li->didbind) {
|
||||||
char *binddn;
|
char *binddn;
|
||||||
struct berval passwd;
|
struct berval passwd;
|
||||||
@ -472,7 +472,7 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
for(ent = ldap_first_message(li->ld, msg); ent;
|
for(ent = ldap_first_message(li->ld, msg); ent;
|
||||||
ent = ldap_next_message(li->ld, ent)) {
|
ent = ldap_next_message(li->ld, ent)) {
|
||||||
struct berval bv, *bvals;
|
struct berval bv, *bvals;
|
||||||
int binary = 0, msgtype;
|
int binary = 0, msgtype;
|
||||||
CURLcode writeerr;
|
CURLcode writeerr;
|
||||||
@ -540,7 +540,8 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf,
|
|||||||
rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, &bvals)) {
|
rc = ldap_get_attribute_ber(li->ld, ent, ber, &bv, &bvals)) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(bv.bv_val == NULL) break;
|
if(bv.bv_val == NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
if(bv.bv_len > 7 && !strncmp(bv.bv_val + bv.bv_len - 7, ";binary", 7))
|
if(bv.bv_len > 7 && !strncmp(bv.bv_val + bv.bv_len - 7, ";binary", 7))
|
||||||
binary = 1;
|
binary = 1;
|
||||||
@ -555,24 +556,24 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)bv.bv_val,
|
writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)bv.bv_val,
|
||||||
bv.bv_len);
|
bv.bv_len);
|
||||||
if(writeerr) {
|
if(writeerr) {
|
||||||
*err = writeerr;
|
*err = writeerr;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)":", 1);
|
writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)":", 1);
|
||||||
if(writeerr) {
|
if(writeerr) {
|
||||||
*err = writeerr;
|
*err = writeerr;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
data->req.bytecount += bv.bv_len + 2;
|
data->req.bytecount += bv.bv_len + 2;
|
||||||
|
|
||||||
if(!binary) {
|
if(!binary) {
|
||||||
/* check for leading or trailing whitespace */
|
/* check for leading or trailing whitespace */
|
||||||
if(ISSPACE(bvals[i].bv_val[0]) ||
|
if(ISSPACE(bvals[i].bv_val[0]) ||
|
||||||
ISSPACE(bvals[i].bv_val[bvals[i].bv_len-1]))
|
ISSPACE(bvals[i].bv_val[bvals[i].bv_len-1]))
|
||||||
binval = 1;
|
binval = 1;
|
||||||
else {
|
else {
|
||||||
/* check for unprintable characters */
|
/* check for unprintable characters */
|
||||||
@ -610,7 +611,7 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf,
|
|||||||
data->req.bytecount += 2;
|
data->req.bytecount += 2;
|
||||||
if(val_b64_sz > 0) {
|
if(val_b64_sz > 0) {
|
||||||
writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, val_b64,
|
writeerr = Curl_client_write(conn, CLIENTWRITE_BODY, val_b64,
|
||||||
val_b64_sz);
|
val_b64_sz);
|
||||||
if(writeerr) {
|
if(writeerr) {
|
||||||
*err = writeerr;
|
*err = writeerr;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user