Removed unnecessary comments and debugging printouts.
authorZdeněk Šustr <sustr4@cesnet.cz>
Wed, 18 Oct 2006 08:07:44 +0000 (08:07 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Wed, 18 Oct 2006 08:07:44 +0000 (08:07 +0000)
org.glite.lb.client/src/connection.c
org.glite.lb.common/interface/connpool.h
org.glite.lb.common/interface/context-int.h
org.glite.lb.server/src/bkserverd.c

index f192621..cfaf925 100644 (file)
@@ -28,7 +28,6 @@ static void CloseConnection(edg_wll_Context ctx, int* conn_index)
         cIndex = *conn_index;
 
        assert(ctx->connections->connOpened);
-//     assert(cIndex < ctx->connections->connOpened); // Assertion no longer valid. "Holes" in the pool are permitted.
 
        edg_wll_gss_close(&ctx->connections->connPool[cIndex].gss, &ctx->p_tmp_timeout);
        if (ctx->connections->connPool[cIndex].gsiCred) 
@@ -38,17 +37,6 @@ static void CloseConnection(edg_wll_Context ctx, int* conn_index)
        
        memset(ctx->connections->connPool + cIndex, 0, sizeof(edg_wll_ConnPool));
        
-       /* if deleted conn was not the last one -> there is a 'hole' and then   */
-       /* 'shake' together connections in pool, no holes are allowed           */
-       /* */
-       /* This principle is unsuitable for multi-threaded applications. Too much waiting for connections */
-       /* to unlock. We need to allow "holes" in the pool. */
-
-/*     if (cIndex < ctx->connections->connOpened - 1) {        
-               ctx->connections->connPool[cIndex] = ctx->connections->connPool[ctx->connections->connOpened - 1];
-               memset(ctx->connections->connPool + ctx->connections->connOpened  - 1 , 0, sizeof(edg_wll_ConnPool));
-       }*/
-
        ctx->connections->connOpened--;
 
         *conn_index = cIndex;
@@ -130,8 +118,6 @@ static int ReleaseConnection(edg_wll_Context ctx, char *name, int port)
                        CloseConnection(ctx, &index);
        }
        else {                                  /* free the oldest (unlocked) connection */
-/*             assert(ctx->connections->connPool[0].peerName);  // Full pool expected - accept non-NULL values only
-               min = ctx->connections->connPool[0].lastUsed.tv_sec;*/
                for (i=0; i<ctx->connections->poolSize; i++) {
                        assert(ctx->connections->connPool[i].peerName); // Full pool expected - accept non-NULL values only
                        if (!edg_wll_connectionTryLock(ctx, i)) {
@@ -150,7 +136,6 @@ static int ReleaseConnection(edg_wll_Context ctx, char *name, int port)
                                }
                        }
                }
-//             printf("Connections to drop: %d\nDropping connection No. %d\n",foundConnToDrop,index);
                if (!foundConnToDrop) return edg_wll_SetError(ctx,EAGAIN,"all connections in the connection pool are locked");
                CloseConnection(ctx, &index);
        }
@@ -426,8 +411,6 @@ int edg_wll_http_send_recv(
        assert(connToUse >= 0);
        gettimeofday(&ctx->connections->connPool[connToUse].lastUsed, NULL);
  
-//        sleep(3); //Just for testing
-
         edg_wll_connectionUnlock(ctx, connToUse);
 
        return 0;
index fcb437d..f536a8b 100644 (file)
@@ -11,8 +11,6 @@
 extern "C" {
 #endif
 
-#define EDG_WLL_CONNPOOL_DEBUG
-
 #ifndef EDG_WLL_CONNPOOL_DECLARED
 #define EDG_WLL_CONNPOOL_DECLARED 1
 
@@ -94,25 +92,6 @@ void edg_wll_poolFree();
     in case memory has been already allocated, just return a pointer */
 edg_wll_Connections* edg_wll_initConnections();
 
-
-/** Set parameters */
-
-/* Not yet defined */
-
-/** Make connection (+ establish a lock) */
-
-/* Not yet defined */
-
-/** Unlock connection after use */
-
-/* Not yet defined */
-
-/** Forcibly drop the connection */
-
-/* Not yet defined */
-
-
-
 #ifdef __cplusplus
 }
 #endif
index 433a71d..6e41c3f 100644 (file)
@@ -30,23 +30,6 @@ typedef struct _edg_wll_ConnProxy {
 
 
 
-/* typedef struct _edg_wll_ConnPool { */
-/* address and port where we are connected to */
-/*     char            *peerName; */
-/*     unsigned int    peerPort; */
-       
- /* http(s) stream */
-/*     gss_cred_id_t   gsiCred; */
-/*     edg_wll_GssConnection   gss; */
-/*     char            *buf; */
-/*     int             bufUse,bufSize; */
-
-/* timestamp of usage of this entry in ctx.connPool */
-/*     struct timeval  lastUsed; */
-/* } edg_wll_ConnPool; */
-
-
-
 struct _edg_wll_Context {
 /* Error handling */
        int             errCode;        /* recent error code */
@@ -99,14 +82,6 @@ struct _edg_wll_Context {
        char            *srvName;
        unsigned int    srvPort;
        
-/* pool of connections from client */
-//     int             poolSize;
-//     int             connOpened;     /* number of opened connections  */
-//     int             connToUse;      /* index of connection that will *
-//                                      *  be used by low-level f-cions */
-       // XXX similar variables will be needed for connPoolNotif
-
-       
 /* other client stuff */
        int             notifSock;              /* default client socket        *
                                                 * for receiving notifications  */   
index 972588c..97c1612 100644 (file)
@@ -759,9 +759,6 @@ int bk_handle_connection(int conn, struct timeval *timeout, void *data)
        ctx->p_tmp_timeout.tv_sec = timeout->tv_sec;
        ctx->p_tmp_timeout.tv_usec = timeout->tv_usec;
        
-//     ctx->connections->poolSize = 0;
-//     ctx->connections->connPool = calloc(1, sizeof(edg_wll_ConnPool));
-//     ctx->connToUse = 0;
        edg_wll_initConnections();
 
        alen = sizeof(a);