aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-09-12 08:00:30 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-09-12 08:00:30 +0000
commitbec97a0999f92a02ddae393a0aca3e78a30fd485 (patch)
tree8b53c5d79ce458dfd94ef1b9f348809cea409250
parent07de3c9df0fb3e84c5e12c3c5d647944a46141e6 (diff)
ConnectionKillOne() _can_ return -1 as an indication of error
This is T. Bharath's fix
-rw-r--r--lib/url.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/url.c b/lib/url.c
index 4a7c57ff9..cfcac7322 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1097,10 +1097,14 @@ ConnectionStore(struct SessionHandle *data,
infof(data, "Connection (#%d) was killed to make room\n", i);
}
- data->state.connects[i] = conn; /* fill in this */
- conn->connectindex = i; /* make the child know where the pointer to this
- particular data is stored */
-
+ if(-1 != i) {
+ /* only do this if a true index was returned, if -1 was returned there
+ is no room in the cache for an unknown reason and we cannot store
+ this there. */
+ data->state.connects[i] = conn; /* fill in this */
+ conn->connectindex = i; /* make the child know where the pointer to this
+ particular data is stored */
+ }
return i;
}