- fixed double context freing
authorJiří Škrábal <nykolas@ics.muni.cz>
Tue, 8 Mar 2005 14:52:54 +0000 (14:52 +0000)
committerJiří Škrábal <nykolas@ics.muni.cz>
Tue, 8 Mar 2005 14:52:54 +0000 (14:52 +0000)
  All the "on disconnect" must be in server-bones on_disconnect_hnd handler
  function.

org.glite.lb.server/src/bkserverd.c

index 85883b8..0aa86e2 100644 (file)
@@ -969,9 +969,6 @@ int bk_accept_store(int conn, struct timeval *timeout, void *cdata)
                        /*      fallthrough
                         */
                case ENOTCONN:
-                       edg_wll_gss_close(&ctx->connPool[ctx->connToUse].gss, NULL);
-                       edg_wll_FreeContext(ctx);
-                       ctx = NULL;
                        free(errt); free(errd);
                        dprintf(("[%d] Connection closed\n", getpid()));
                        /*
@@ -1039,9 +1036,6 @@ int bk_accept_serve(int conn, struct timeval *timeout, void *cdata)
                        /*      fallthrough
                         */
                case ENOTCONN:
-                       edg_wll_gss_close(&ctx->connPool[ctx->connToUse].gss, NULL);
-                       edg_wll_FreeContext(ctx);
-                       ctx = NULL;
                        free(errt); free(errd);
                        dprintf(("[%d] Connection closed\n", getpid()));
                        /*
@@ -1159,12 +1153,9 @@ int bk_clnt_disconnect(int conn, struct timeval *timeout, void *cdata)
 
 
        if ( ctx->connPool[ctx->connToUse].gss.context != GSS_C_NO_CONTEXT)
-       {
-               struct timeval  to = { 0, CLNT_REJECT_TIMEOUT };
-
-               edg_wll_gss_close(&ctx->connPool[ctx->connToUse].gss, &to);
-       }
+               edg_wll_gss_close(&ctx->connPool[ctx->connToUse].gss, timeout);
        edg_wll_FreeContext(ctx);
+       ctx = NULL;
 
        return 0;
 }