Skip to content
Snippets Groups Projects
Commit 7c574572 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

If the current connection doesn't fit to get added to the connection cache,

we certainly MUST NOT kill an active connection... Problem tracked down thanks
to Michael Wallner's excellent test program.
parent 00ae13f9
No related branches found
No related tags found
No related merge requests found
......@@ -2002,7 +2002,7 @@ ConnectionKillOne(struct SessionHandle *data)
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;
/*
......@@ -2078,7 +2078,10 @@ ConnectionStore(struct SessionHandle *data,
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment