[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Download only part of a file using LuaSocket HTTP
- From: Ignacio Burgueño <ignaciob@...>
- Date: Fri, 30 Jan 2009 19:07:39 -0200
RJP Computing wrote:
I tested this and the server doesn't support it. Any other way to use a
sink and then cancel after enough chunks have been received? Does anyone
have an example of this? Thanks.
Maybe something along these lines:
local http = require "socket.http"
url = "http://lua-users.org/wiki/FiltersSourcesAndSinks",
sink = function(chunk, err)
if chunk then
print("got a chunk of length", #chunk)
-- process chunk and return nil when you don't want to process more