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

List:       kfm-devel
Subject:    Re: kio_http fix
From:       Lars Knoll <lars () trolltech ! com>
Date:       2002-04-02 9:41:01
[Download RAW message or body]


> On Wednesday 27 March 2002 07:18 pm, Dawit Alemayehu wrote:
> > On Wednesday 27 March 2002 05:59, Lars Knoll wrote:
> > > Hi,
> > >
> > > I had some trouble with internet banking on my bank. They were using
> > > http posts, and often the request didn't get through.
> > >
> > > After a while I found out that kio_http, was in certain cases loosing
> > > the post data, see the attached debug output.
> > >
> > > The patch attached is rather ugly but fixes the problem for me.
> > >
> > > Comments?
> >
> > Hi Lars,
> >
> > No need for the flag, we can simply check whether or not the buffer is
> > NULL. Infact it should not even for check the response code when sending
> > POST data. Thanks I will fix that.
> >
> > However, I am mystified by the debug output.  From the debug statement
> > you posted it looks to me like the server is crapping right before it can
> > respond to the request put forth. That should definitely not happen
> > unless the data we send is for some reason corrupted (highly unlikely
> > since your patch simply makes kio_http repost the data) or the connection
> > for some reason was broken. Did you have a bad connection to the remote
> > machine ?  I was just curious as to what the cause could be :)  It is not
> > at all evident from the debug statement.
>
> Could be that that happens when we send data to a connection that is still
> alive due to keep-alive. We really shouldn't do that because we might end
> up sending the request to the server twice and the server might actually
> process both requests. So I guess that we should close any still open
> connection before doing a POST, so that we start with a fresh connection.

The connection was indeed still alive in that case. After posting the request, 
I just got a connection closed from the other side. It was surely not a 
network problem, as it happened reproducably every time. Not usre why the 
server didn't like reusing an old connection for post requests, but it surely 
didn't, so maybe Waldos idea of closing them before posting is correct. Still 
we should keep the post data in case we really have to reconnect.

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

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