aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2007-04-06 10:35:13 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2007-04-06 10:35:13 +0000
commitbabdde4fa43215713f5b27ef71036ea7bd24ed9e (patch)
treeedf353318dbd35777e49384db9486110f5b42096
parentf5fc27746335d9c0da9f86de20f2b795306089d8 (diff)
downloadstrongswan-babdde4fa43215713f5b27ef71036ea7bd24ed9e.tar.bz2
strongswan-babdde4fa43215713f5b27ef71036ea7bd24ed9e.tar.xz
cosmetics in debug output
-rw-r--r--src/libstrongswan/crypto/ca.c4
-rw-r--r--src/libstrongswan/utils/fetcher.c39
2 files changed, 27 insertions, 16 deletions
diff --git a/src/libstrongswan/crypto/ca.c b/src/libstrongswan/crypto/ca.c
index 9633c77be..1f566a098 100644
--- a/src/libstrongswan/crypto/ca.c
+++ b/src/libstrongswan/crypto/ca.c
@@ -196,7 +196,7 @@ static void add_crl(private_ca_info_t *this, crl_t *crl)
else
{
crl->destroy(crl);
- DBG1(" this crl is older - existing crl retained");
+ DBG1(" this crl is not newer - existing crl retained");
}
}
else
@@ -505,7 +505,7 @@ static cert_status_t verify_by_crl(private_ca_info_t* this, certinfo_t *certinfo
else
{
crl->destroy(crl);
- DBG1("this crl is older - existing crl retained");
+ DBG1("this crl is not newer - existing crl retained");
continue;
}
if (crl->is_valid(crl))
diff --git a/src/libstrongswan/utils/fetcher.c b/src/libstrongswan/utils/fetcher.c
index d728f0d00..6165cc1e1 100644
--- a/src/libstrongswan/utils/fetcher.c
+++ b/src/libstrongswan/utils/fetcher.c
@@ -83,7 +83,7 @@ static size_t curl_write_buffer(void *ptr, size_t size, size_t nmemb, void *data
}
/**
- * Implements fetcher_t.get for http[s] and file URIs
+ * Implements fetcher_t.get for curl methods
*/
static chunk_t curl_get(private_fetcher_t *this)
{
@@ -114,8 +114,7 @@ static chunk_t curl_get(private_fetcher_t *this)
}
else
{
- DBG1("curl request to '%s' failed: %s",
- this->uri, curl_error_buffer);
+ DBG1("curl request failed: %s", curl_error_buffer);
}
curl_free(curl_response.ptr);
}
@@ -167,8 +166,7 @@ static chunk_t http_post(private_fetcher_t *this, const char *request_type, chun
}
else
{
- DBG1("http post request to '%s' using libcurl failed: %s",
- this->uri, curl_error_buffer);
+ DBG1("http post request using libcurl failed: %s", curl_error_buffer);
}
curl_slist_free_all(headers);
curl_free(curl_response.ptr);
@@ -181,13 +179,15 @@ static chunk_t http_post(private_fetcher_t *this, const char *request_type, chun
#ifdef LIBLDAP
/**
- * parses the result returned by an ldap query
+ * Parses the result returned by an ldap query
*/
static chunk_t ldap_parse(LDAP *ldap, LDAPMessage *result)
{
chunk_t response = chunk_empty;
+ err_t ugh = NULL;
LDAPMessage *entry = ldap_first_entry(ldap, result);
+
if (entry != NULL)
{
BerElement *ber = NULL;
@@ -206,39 +206,44 @@ static chunk_t ldap_parse(LDAP *ldap, LDAPMessage *result)
response.len = values[0]->bv_len;
response.ptr = malloc(response.len);
memcpy(response.ptr, values[0]->bv_val, response.len);
+
if (values[1] != NULL)
{
- DBG1("ldap: more than one value was fetched from LDAP URL");
+ ugh = "more than one value was fetched - first selected";
}
}
else
{
- DBG1("ldap: no values in attribute");
+ ugh = "no values in attribute";
}
ldap_value_free_len(values);
}
else
{
- DBG1("ldap: %s", ldap_err2string(ldap_result2error(ldap, entry, 0)));
+ ugh = ldap_err2string(ldap_result2error(ldap, entry, 0));
}
ldap_memfree(attr);
}
else
{
- DBG1("ldap: %s", ldap_err2string(ldap_result2error(ldap, entry, 0)));
+ ugh = ldap_err2string(ldap_result2error(ldap, entry, 0));
}
ber_free(ber, 0);
}
else
{
- DBG1("ldap: %s", ldap_err2string(ldap_result2error(ldap, result, 0)));
+ ugh = ldap_err2string(ldap_result2error(ldap, result, 0));
+ }
+ if (ugh)
+ {
+ DBG1("ldap request failed: %s", ugh);
}
return response;
}
#endif /* LIBLDAP */
/**
- * fetches a binary blob from an ldap url
+ * Implements fetcher_t.get for curl methods
*/
static chunk_t ldap_get(private_fetcher_t *this)
{
@@ -247,6 +252,7 @@ static chunk_t ldap_get(private_fetcher_t *this)
#ifdef LIBLDAP
if (this->ldap)
{
+ err_t ugh = NULL;
int rc;
int ldap_version = LDAP_VERSION3;
@@ -285,14 +291,19 @@ static chunk_t ldap_get(private_fetcher_t *this)
}
else
{
- DBG1("ldap: %s", ldap_err2string(rc));
+ ugh = ldap_err2string(rc);
}
}
else
{
- DBG1("ldap: %s", ldap_err2string(rc));
+ ugh = ldap_err2string(rc);
}
ldap_unbind_s(this->ldap);
+
+ if (ugh)
+ {
+ DBG1("ldap request failed: %s", ugh);
+ }
}
#else /* !LIBLDAP */
DBG1("warning: libldap fetching not compiled in");