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

List:       kde-core-devel
Subject:    Re: www.granroth.org == KWord doc?
From:       Alex Zepeda <jazepeda () pacbell ! net>
Date:       2000-03-18 19:33:26
[Download RAW message or body]

On Fri, 17 Mar 2000, Dawit Alemayehu wrote:

> This seems to me to be the problematic code that is causing this issue in
> kio_http:
> 
>   else if (!locationStr.isEmpty() && !noRedirect)
>   {
> #if 0
>     // WABA:
>     // We either need to close the connection or read the rest of the contents!
>     // Closing the connection is bad for performance.
>     // We really should read the contents here!
>     http_closeConnection();
>     KURL u(m_request.url, locationStr);
>     redirection(u.url());
> 
>     if ( !http_open() )
>       return false;
> 
>     return readHeader();
> #else
>     KURL u(m_request.url, locationStr);
>     redirection(u.url());
> #endif
>   }
>   // FINALLY, let the world know what kind of data we are getting
>   // and that we do indeed have a header
>   mimeType(m_strMimeType);
> 
> As already stated in previous messages, we should not be changing
> the mimeType on redirection.

We should not be setting the mimetype at all, this will confuse konqueror
and other consumers of http data.

> I also do not know exactly why Waldo felt that closing the connection
> is bad for performance.

Because persistant connections mean less packets sent.  However, a
redirection means that it could be going to a whole different server.  
Also, persistant connections require you to read all data and take action
before sending a new request, something kio_http doesn't do right now.

> Wouldn't this problematic if the server responded with header that
> explicitly asked the connection to be closed after the transmission of
> the header ( "Connection : close" ) as this site does ??  Anyways, I
> think the simplest fix is to have change the last line to

No.  Not if kio_http properly handled this.  This is another problem with
persistant connections, not many server support them, and so we must also
properly handle cases when persistant connections aren't specified (terse
connections are the implied default).

> if( locationStr.isEmpty() ) // Do this if there is no redirection...
>   mimeType( m_strMimeType );

Looks good.

- alex

   The average Slashdotter seems genuinely to think that the entire 'Net
   could be run on beige x86 boxes running Linux.

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

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