From: Zdeněk Salvet Date: Wed, 28 May 2008 12:39:39 +0000 (+0000) Subject: 0 is valid filedescriptor number, -1 is used for closed connections X-Git-Tag: glite-lb-client_R_3_2_1_1~10 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=c7a75ebea057604f0c700fda81e42038babd67f8;p=jra1mw.git 0 is valid filedescriptor number, -1 is used for closed connections --- 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--;