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
