From dd556ad776cb46c051d9e89c4f10743e2992d287 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Posp=C3=AD=C5=A1il?= Date: Tue, 24 Apr 2007 11:43:29 +0000 Subject: [PATCH] do not call edg_wll_gss_acquire_cred_gsi in SetLoggingJob and in log_connect - speeds up logging enormously - not necessary all the time - still needs to work out properly --- org.glite.lb.client/src/prod_proto.c | 26 +++++++++++++++++++++++++- org.glite.lb.client/src/producer.c | 2 ++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/org.glite.lb.client/src/prod_proto.c b/org.glite.lb.client/src/prod_proto.c index 402f3e6..51a3152 100644 --- a/org.glite.lb.client/src/prod_proto.c +++ b/org.glite.lb.client/src/prod_proto.c @@ -234,6 +234,7 @@ int edg_wll_log_connect(edg_wll_Context ctx, int *conn) ctx->connections->connPool[index].peerPort,index); #endif +#if 0 /* acquire gss credentials */ ret = edg_wll_gss_acquire_cred_gsi( ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename, @@ -251,6 +252,7 @@ int edg_wll_log_connect(edg_wll_Context ctx, int *conn) fprintf(stderr,"edg_wll_log_connect: going on anonymously!\n"); } #endif +#endif #ifdef EDG_WLL_LOG_STUB fprintf(stderr,"edg_wll_log_connect: opening connection to local-logger %s:%d\n", ctx->connections->connPool[index].peerName, @@ -259,6 +261,23 @@ int edg_wll_log_connect(edg_wll_Context ctx, int *conn) /* gss_connect */ if (ctx->connections->connPool[index].gss.context == GSS_C_NO_CONTEXT) { + /* acquire gss credentials */ + ret = edg_wll_gss_acquire_cred_gsi( + ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename, + ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_key_filename, + &ctx->connections->connPool[index].gsiCred, &my_subject_name, &gss_stat); + /* give up if unable to acquire prescribed credentials, otherwise go on anonymously */ + if (ret && ctx->p_proxy_filename) { + edg_wll_SetErrorGss(ctx, "edg_wll_gss_acquire_cred_gsi(): failed to load GSI credentials", &gss_stat); + goto edg_wll_log_connect_err; + } +#ifdef EDG_WLL_LOG_STUB + if (my_subject_name != NULL) { + fprintf(stderr,"edg_wll_log_connect: using certificate: %s\n",my_subject_name); + } else { + fprintf(stderr,"edg_wll_log_connect: going on anonymously!\n"); + } +#endif if ((answer = edg_wll_gss_connect( ctx->connections->connPool[index].gsiCred, ctx->connections->connPool[index].peerName, @@ -283,8 +302,13 @@ edg_wll_log_connect_end: edg_wll_poolUnlock(); #ifdef EDG_WLL_LOG_STUB - fprintf(stderr,"edg_wll_log_connect: done (remaining timeout %d.%06d sec)\n", + if (answer) { + fprintf(stderr,"edg_wll_log_connect: error (remaining timeout %d.%06d sec)\n", (int) ctx->p_tmp_timeout.tv_sec, (int) ctx->p_tmp_timeout.tv_usec); + } else { + fprintf(stderr,"edg_wll_log_connect: done o.k. (remaining timeout %d.%06d sec)\n", + (int) ctx->p_tmp_timeout.tv_sec, (int) ctx->p_tmp_timeout.tv_usec); + } #endif *conn = index; return answer; diff --git a/org.glite.lb.client/src/producer.c b/org.glite.lb.client/src/producer.c index a06a7ba..bd842d1 100644 --- a/org.glite.lb.client/src/producer.c +++ b/org.glite.lb.client/src/producer.c @@ -641,6 +641,7 @@ int edg_wll_SetLoggingJob( } /* add user credentials to context */ +#if 0 { char *my_subject_name = NULL; edg_wll_GssStatus gss_stat; @@ -663,6 +664,7 @@ int edg_wll_SetLoggingJob( gss_release_cred(&min_stat, &cred); if (my_subject_name) free(my_subject_name); } +#endif return edg_wll_Error(ctx,NULL,NULL); } -- 1.8.2.3