lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Oct 3, 2010 at 9:26 PM, Norbert Kiesel <nkiesel@tbdnetworks.com> wrote:
On Sun, 2010-10-03 at 20:09 +0200, Petite Abeille wrote:
> On Oct 3, 2010, at 8:04 PM, Norbert Kiesel wrote:
>
> >> At first glance, luasocket's http module doesn't support persistent connection.
> >>
> >> http.lua:215 adjustheaders(reqt): ["connection"] = "close, TE",
 

</nk>



> >> http.lua:327 trequest(reqt): h:close()
> >
> > Yeah, but even after commenting out the h:close() the socket is  still
> > closed somehow.
>
> By default, the request is asking for the connection to be closed by the server (http.lua:215), so perhaps this is not unexpected, no?

First of all thanks for your help.
I removed the "close" from that line (and also the TE in another
attempt), but that does not make a difference.  I even ran it under gdb
and put breakpoints on meth_close and meth_shutdown (the C functions
implementing socket:close() and socket:shutdown(), but they are not hit
and still getfd() returns -1 after the request.

The HTTP keepalive mechanism isn't supposed to keep connections opened for too long:

http://en.wikipedia.org/wiki/Keepalive

Best,
Bogdan