[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Fixing kio_http
From: Rik Hemsley <rik () kde ! org>
Date: 2001-06-29 0:55:28
[Download RAW message or body]
#if Dawit Alemayehu
> On Thursday 28 June 2001 18:39, Rik Hemsley wrote:
> > My quick hack to ensure that there is a maximum of 2 http slaves per
> > host:
> >
> > KIO::Scheduler::ProtocolInfo *
> > KIO::Scheduler::ProtocolInfoDict::get(const QString &protocol)
> > {
> > ProtocolInfo *info = find(protocol);
> > if (!info)
> > {
> > info = new ProtocolInfo;
> > + if ("http" == protocol.lower())
> > + {
> > + info->maxSlaves = 1;
> > + }
> > info->protocol = protocol;
> > insert(protocol, info);
> > }
> > return info;
> > }
> >
> > Yes, I know that should be 2, but there's an off-by-one error
> > somewhere... the maximum is normally set to 3, which in real life is
> > 4.
>
> Hi Rik,
>
> Does the scheduler properly cache the other requests ? I mean if there
> are more than two request what happens ?
They're just queued. This patch just limits the number of concurrent
connections made to one site.
> A typical scenario for this
> is khtml downloading image links within a page in the background ? I
> am not sure how this is handled. Also you might want to change that to
> protocol.lower().startsWith("http") so that it also applies to https
> connections :)
Well, I'm not sure what to do about https - it has to be handled
specially in various ways.
> Anyways, this is indeed a quick hack as you said :) We definitely need
> to find a more generic solution any/all protocol can use and the user
> can adjust :) Waldo said he was going to implement something for
> this, but he's on vacation this week I guess. Otherwise, another
> solution which Waldo did not like is to use connection-oriented mode
> in khtml and have it manage its own io-slave connections which would be
> more work for khtml, but also more flexiable since it can do whatever
> it wants that way.
Yes, this should be more generic, but it would be nice to fix this now
and make it generic later IMO.
> BTW, the two connection is a recommendation and not a requirement,
> right ? Does the spec say MUST or SHOULD when it comes to this topic ?
I don't know, but it's a bit impolite to use > 2 connections anyway.
There are enough stupid programs around that do things like open multiple
connections to one server in order to theoretically download a file
faster. Grr.
Rik
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic