[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luasocket/soap: can I keep the connection open?
- From: Norbert Kiesel <nkiesel@...>
- Date: Sun, 03 Oct 2010 12:15:29 -0700
On Sun, 2010-10-03 at 20:38 +0200, Petite Abeille wrote:
> On Oct 3, 2010, at 8:26 PM, Norbert Kiesel wrote:
>
> > 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 thing is... LuaSocket http module doesn't support persistent connection by default... so you will have to tweak it a bit...
>
> Now... from an HTTP point of view... you need the client side request to be HTTP/1.1 or use connection = keep-alive for earlier version.
>
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
>
> And have the HTTP server honor such persistent request... which the server could choose not to.
>
> The easiest way to check what's going on would be to record what HTTP request header are emitted and what response header are returned.
I added print's at various places and I see a "HTTP/1.1 200 OK" status
coming back from the server (print before the return in
metat.__index:receivestatusline). And the headers sent are
{host=192.168.6.185,content-type=text/xml,te=trailers,
user-agent=LuaSocket2.0.2,content-length=326,
cookie=vmware_soap_session="52530721-2986-0459-f803-481be1afe990",
soapaction="urn:vim25/4.1"}
I think the socket/http.lua already uses mode = "keep-open" because I
have a content-length in my header.
I could try to switch the server from HTTPS to HTTP so that I could
record the conversation with wireshark, but ultimately I have to support
SOAP over HTTPS.
</nk>