Add debug log to am_cache_env_populate

This commit is contained in:
Benjamin Dauvergne 2012-01-03 10:00:45 +01:00
parent 9b10315fa3
commit b97cdd27ca
1 changed files with 22 additions and 10 deletions

View File

@ -375,6 +375,8 @@ void am_cache_env_populate(request_rec *r, am_cache_entry_t *t)
* received from the IdP.
*/
for(i = 0; i < t->size; ++i) {
char *name = NULL;
varname = t->env[i].varname;
/* Check if we should map this name into another name. */
@ -402,17 +404,22 @@ void am_cache_env_populate(request_rec *r, am_cache_entry_t *t)
apr_hash_set(counters, varname, APR_HASH_KEY_STRING, count);
/* Add the variable without a suffix. */
apr_table_set(r->subprocess_env,
apr_pstrcat(r->pool, "MELLON_", varname, NULL),
value);
name = apr_pstrcat(r->pool, "MELLON_", varname, NULL);
apr_table_set(r->subprocess_env, name, value);
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
"Set environment variable %s to value %s",
name, value);
}
/* Add the variable with a suffix indicating how many times it has
* been added before.
*/
apr_table_set(r->subprocess_env,
apr_psprintf(r->pool, "MELLON_%s_%d", varname, *count),
value);
name = apr_psprintf(r->pool, "MELLON_%s_%d", varname, *count);
apr_table_set(r->subprocess_env, name, value);
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
"Set environment variable %s to value %s",
name, value);
/* Increase the count. */
++(*count);
@ -443,12 +450,17 @@ void am_cache_env_populate(request_rec *r, am_cache_entry_t *t)
session = apr_palloc(r->pool, dstlen);
(void)apr_base64_encode(session, t->lasso_session, srclen);
apr_table_set(r->subprocess_env, "MELLON_SESSION", session);
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Set environment "
"variable MELLON_SESSION to value %s", session);
}
if (d->dump_saml_response)
apr_table_set(r->subprocess_env,
"MELLON_SAML_RESPONSE",
t->lasso_saml_response);
if (d->dump_saml_response) {
apr_table_set(r->subprocess_env, "MELLON_SAML_RESPONSE",
t->lasso_saml_response);
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Set environment "
"variable MELLON_SAML_RESPONSE to value %s",
t->lasso_saml_response);
}
}