From: Daniel KouĊ™il Date: Thu, 2 Jul 2009 14:43:24 +0000 (+0000) Subject: improved handling of internally created connections X-Git-Tag: gridsite-core_R_1_7_3~4 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=abdd30ec528012bffb6a483f38ddb224d2a825c1;p=jra1mw.git improved handling of internally created connections --- diff --git a/org.glite.security.gsoap-plugin/src/glite_gsplugin.c b/org.glite.security.gsoap-plugin/src/glite_gsplugin.c index 444bf36..782d4e4 100644 --- a/org.glite.security.gsoap-plugin/src/glite_gsplugin.c +++ b/org.glite.security.gsoap-plugin/src/glite_gsplugin.c @@ -66,7 +66,7 @@ glite_gsplugin_free_context(glite_gsplugin_Context ctx) if ( ctx->internal_credentials && ctx->cred != NULL ) edg_wll_gss_release_cred(&ctx->cred, NULL); - if ( ctx->connection ) { + if ( ctx->internal_connection && ctx->connection ) { if ( ctx->connection->context != NULL ) edg_wll_gss_close(ctx->connection, NULL); free(ctx->connection); @@ -156,13 +156,10 @@ glite_gsplugin_set_connection(glite_gsplugin_Context ctx, edg_wll_GssConnection if ( ctx->internal_connection && ctx->connection->context != NULL) { pdprintf(("GSLITE_GSPLUGIN: closing gss connection\n")); ret = edg_wll_gss_close(ctx->connection, ctx->timeout); + free(ctx->connection); } - free(ctx->connection); } - if (conn) { - ctx->connection = (edg_wll_GssConnection *)malloc(sizeof(edg_wll_GssConnection)); - memcpy(ctx->connection, conn, sizeof(edg_wll_GssConnection)); - } else ctx->connection = NULL; + ctx->connection = conn; ctx->internal_connection = 0; return ret;