for(i=0; data->state.connc && (i< data->state.connc->num); i++) {
conn = data->state.connc->connects[i];
- if(!conn)
+ if(!conn || conn->inuse)
continue;
/*
if(i == data->state.connc->num) {
/* there was no room available, kill one */
i = ConnectionKillOne(data);
- infof(data, "Connection (#%d) was killed to make room\n", i);
+ if(-1 != i)
+ infof(data, "Connection (#%d) was killed to make room\n", i);
+ else
+ infof(data, "This connection did not fit in the connection cache\n");
}
conn->connectindex = i; /* Make the child know where the pointer to this