[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    Re: decompressing a http stream
From:       David Burgess <dabsoft () gmail ! com>
Date:       2010-03-30 4:39:27
Message-ID: 4BB1807F.3010207 () gmail ! com
[Download RAW message or body]

I have a gz filter(.c) that adds to luasocket.
It was built to avoid the memory blowout.
If you want it, mail me directly.

DB

On 30/3/2010 1:42 AM, Natanael Copa wrote:
> Hi,
>
> So, I have this code:
>
> f = io.popen("wget -q -O - "..gzurl.." | gunzip -c")
> for line in f:lines() do
>      -- process line here
> end
>
> Clean, and simple. Not so beautiful. So i thought I'd have a look at
> lzlib and luasocket to do the same. I'd expect something in the lines:
>
> s = socket.http.open(gzurl)
> f = zlib.inflate(s)
> for line in f:lines()
>     -- process line here
> end
>
> But thats obviously not how socket.http works. I need sinks, and
> chains and pumps? I cannot even use socket.tcp for this which does not
> give me a "file handle" either.
>
> Any one have a link to an example how to do things like that?
>
> One key point here is that the memory is limited and file is big so i
> cannot download entire file to ram and process it afterwards. (And I
> also want use the time waiting for data over slow lines doing
> something useful)
>
> Thanks!
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic