[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Fixing kio_http
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2001-06-28 22:35:09
[Download RAW message or body]

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 ?  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 :)

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.

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 ?

Regards,
Dawit A.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic