[luci] httpclient - missing sock:close() ?

Helen Fornazier helen at wizzilab.com
Fri Feb 7 17:27:43 CET 2014


Hi Jow,

Thanks for your patch, but unfortunately the CLOSE_WAIT still accumulate
for each request_to_buffer.

The weird thing is that they just accumulate if I make requests to the
local LuCI server.

I tested in a Lua Interpreter:

>httpclient  = require "luci.httpclient"
>= httpclient.request_to_buffer("http://localhost")
LUCI's PAGE HERE...
>= httpclient.request_to_buffer("http://google.com")
GOOGLE's PAGE HERE...

If I repeat the request_to_buffer with localhost, it always accumulates
CLOSE_WAIT when I check with netstat, but it doesn't with the google's page.


Helen Fornazier


On Thu, Feb 6, 2014 at 2:06 PM, Jo-Philipp Wich <xm at subsignal.org> wrote:

> Hi,
>
> its not as easy as calling close() in request_raw() because it actually
> returns a source function to read the body data sent by the server from
> the yet open socket.
>
> A proper solution would be closing the socket on EOF in chunksource(),
> linesource() and blocksource().
>
> I attached a patch you can try to see if it solves your issue.
>
>
> ~ Jow
>
> _______________________________________________
> luci mailing list
> luci at lists.subsignal.org
> https://lists.subsignal.org/mailman/listinfo/luci
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20140207/11de9849/attachment.html>


More information about the luci mailing list