Initialize gss connections to closed (fd=-1).
authorZdeněk Salvet <salvet@ics.muni.cz>
Wed, 28 May 2008 12:40:48 +0000 (12:40 +0000)
committerZdeněk Salvet <salvet@ics.muni.cz>
Wed, 28 May 2008 12:40:48 +0000 (12:40 +0000)
org.glite.lb.common/src/connpool.c

index fb84222..a9bfb6d 100644 (file)
@@ -238,6 +238,7 @@ void edg_wll_poolFree() {
 /** Allocate memory for arrays within the edg_wll_Connections structure */
 edg_wll_Connections* edg_wll_initConnections() {
 
+       int i;
 
     #ifdef EDG_WLL_CONNPOOL_DEBUG
         #ifdef GLITE_LB_THREADED
@@ -258,6 +259,9 @@ edg_wll_Connections* edg_wll_initConnections() {
 
 
         connectionsHandle.connPool = (edg_wll_ConnPool *) calloc(connectionsHandle.poolSize, sizeof(edg_wll_ConnPool));
+        for (i=0; i<connectionsHandle.poolSize; i++) {
+                connectionsHandle.connPool[i].gss.sock = -1;
+        }
 
         #ifdef GLITE_LB_THREADED
             connectionsHandle.connectionLock = (pthread_mutex_t *) calloc(connectionsHandle.poolSize, sizeof(pthread_mutex_t));