From c7a75ebea057604f0c700fda81e42038babd67f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20Salvet?= Date: Wed, 28 May 2008 12:39:39 +0000 Subject: [PATCH] 0 is valid filedescriptor number, -1 is used for closed connections --- org.glite.lb.client/src/connection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.glite.lb.client/src/connection.c b/org.glite.lb.client/src/connection.c index 5b02d66..9d68ad4 100644 --- a/org.glite.lb.client/src/connection.c +++ b/org.glite.lb.client/src/connection.c @@ -32,7 +32,7 @@ int CloseConnection(edg_wll_Context ctx, int* conn_index) assert(ctx->connections->connOpened); - if (ctx->connections->connPool[cIndex].gss.sock) + if (ctx->connections->connPool[cIndex].gss.sock >= 0) ret = edg_wll_gss_close(&ctx->connections->connPool[cIndex].gss, &ctx->p_tmp_timeout); if (ctx->connections->connPool[cIndex].gsiCred != GSS_C_NO_CREDENTIAL) gss_release_cred(&min_stat, &ctx->connections->connPool[cIndex].gsiCred); @@ -41,6 +41,7 @@ int CloseConnection(edg_wll_Context ctx, int* conn_index) free(ctx->connections->connPool[cIndex].certfile); memset(ctx->connections->connPool + cIndex, 0, sizeof(edg_wll_ConnPool)); + ctx->connections->connPool[cIndex].gss.sock = -1; ctx->connections->connOpened--; -- 1.8.2.3