From 6218fb1ac62350c47c5b92a9dc4848e9c3329fc9 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sun, 24 Jan 2010 18:45:51 +0100 Subject: limit the number of simultaneous connections The number of simultaneous connections to a single server is now limited by prefs.http_max_conns (default 6). This avoids opening hundreds of connections on pages with many images (BUG 685). This commit is partly based on a prototype by Jorge Arellano Cid. --- src/IO/IO.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/IO/IO.c') diff --git a/src/IO/IO.c b/src/IO/IO.c index 40677345..4b0285f2 100644 --- a/src/IO/IO.c +++ b/src/IO/IO.c @@ -133,7 +133,8 @@ static void IO_close_fd(IOData_t *io, int CloseCode) /* With HTTP, if we close the writing part, the reading one also gets * closed! (other clients may set 'IOFlag_ForceClose') */ - if ((io->Flags & IOFlag_ForceClose) || (CloseCode == IO_StopRdWr)) { + if (((io->Flags & IOFlag_ForceClose) || (CloseCode == IO_StopRdWr)) && + io->FD != -1) { do st = close(io->FD); while (st < 0 && errno == EINTR); -- cgit v1.2.3