[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Problem with lua-curl
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 20 Apr 2017 18:45:16 +0200
2017-04-20 15:07 GMT+02:00 Alexey Melnichuk <firstname.lastname@example.org>:
>>>> i = i + 1
>>>> if (#chunk > 4096) then print(i, #chunk) end
> Did you try code that I post.
Thanks, my eyes have finally opened. 16384 is the block size in
which lcurl serves up the chunks. It is the responsibility of
'writefunction' to reassemble them. That is why one must
provide a write function. If lcurl assembled them, it could just
return a string.
My writefunction consisted of simply storing the string in a variable.
Now I ask you, was I just being dense, or is the documentation
not very forthcoming?
easy:setopt_writefunction (writer[, context]) Set writer function.
A callback accepting one or two parameters. The first is the writer
context if any, and the second is a string with the data to be
written. Function must return `true` (any non number true value) or
full data length or nothing to continue operation. Otherwise the
transfer will be aborted with an error.
context writer context