Re: [PATCH] Naive approach to HTTP-timeouts

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Centrium GmbH
Message-ID <[email protected]>
Hi Slava,

I would vote -1 for your patch. I see no need to start "yet another thread" 
only to watch timedout connections (threads are limited resources). David's 
patch (though only for http-server part) avoid it gracefully...

David your patch has one problem (what I can see right now):
please add cleanup for appropriate clients into port_remove function; 
otherwise callback function will be called for those clients, wich call 
port_put function then and we have panic, because port just doesn't exists in 
the dictionary anymore.

On Monday 24 November 2003 13:52, Vjacheslav Chekushin wrote:
> Hi, David.
> Current kannel http implementation doesn't free sockets for client->server
> part too (I mean conn_pool dictionary).
> This part even more important for WAP than server's part of http library.
> I've made patch some time ago to clean timeouted connection for this part
> of library. It works fine for me.
>
> David Schmitz wrote:
> > Hi everybody,
> >
> > attached is a patch that implements a rather naive HTTP-timeout solution.
> > Problem:
> > The current http-module will not disconnect clients, thus resources
> > (e.g. sockets) are not reclaimed.
> > Approach of the solution:
> > * each new client registers itself in a dictionary of active clients
> > upon creation.
> > * the server thread checks after a certain timeout each client in the
> > dictionary whether or not the connection has been timed out.
> > * 2 kinds of timeout are supported:
> > (1) CONNECTION: the time between creation of the client and the first
> > input.
> > (2) IDLE: the time between subsequent data transfers.
> > * clients that are waiting for an answer (e.g. clients in the
> > request_is_being_handled and sending_reply state) are not disconnected.
> > * each data transfer resets the client's timestamp.
> > * the configuration of the timeout-values is done in the http.h file,
> > which I know is not a very sane approach.
> >
> > Please have a look at the patch. If anyone comes up with a better
> > solution or finds errors/mistakes: I am happy to learn :))).
> >
> > Mit freundlichen Gruessen/Best regards
> >
> > David Schmitz
> >
> > Softwareentwicklung

-- 
Best regards / Mit besten Grüßen aus Düsseldorf

Dipl.-Ing.
Alexander Malysh
___________________________________________

Centrium GmbH
Vogelsanger Weg 80
40470 Düsseldorf

Fon: +49 (0211) 74 84 51 80
Fax: +49 (0211) 277 49 109

email: [email protected]
web: www.centrium.de
msn: [email protected]
icq: 98063111
___________________________________________

Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.