[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Problem with lua-curl
- From: Alexey Melnichuk <alexeymelnichuck@...>
- Date: Thu, 20 Apr 2017 16:07:57 +0300
Здравствуйте, Dirk.
Вы писали 19 апреля 2017 г., 23:11:59:
> 2017-04-18 13:15 GMT+02:00 Alexey Melnichuk <alexeymelnichuck@gmail.com>:
>> Здравствуйте, Dirk.
>>
>> Вы писали 17 апреля 2017 г., 17:23:47:
>>
>>> If the server sends >16363 bytes, some bytes are lost.
>>
>>> It looks as if all completed blocks of 16384 bytes are overwritten
>>> and only the remnant is passed through to to the user.
>>
>>> I'll have a read in the source but I am sure bigger experts
>>> than me will beat me to the punch.
>>
>>
>> Just tested this code with download ~9M zip archive.
>> It has several sequence chunks series with size 16384.
>> All seems correct.
>>
>>> local curl = require "cURL"
>>> local url = "https://github.com/fusionpbx/fusionpbx/archive/4.2.2.zip"
>>> local c = curl.easy{
>>> url = url,
>>> ssl_verifypeer = false,
>>> ssl_verifyhost = false,
>>> followlocation = true,
>>> }
>>> print(curl._NAME, curl._VERSION)
>>> print(curl.version())
>>> local f, i = assert(io.open('test.zip', 'w+b')), 0;
>>> c:setopt_writefunction(function(chunk)
>>> i = i + 1
>>> if (#chunk > 4096) then print(i, #chunk) end
>>> f:write(chunk)
>>> end)
>>> c:perform()
>>> f:close()
>>
>> PS. Versions is:
>> * Lua-cURL 0.3.6-dev
>> * libcurl/7.49.0 OpenSSL/1.0.1c zlib/1.2.7 WinIDN
> I am (in principle for this project) using what I get from LuaRocks.
> $ luarocks show lua-curl
> Lua-cURL 0.3.6-1 - Lua binding to libcurl
> License: MIT/X11
> Homepage: https://github.com/Lua-cURL
> Installed in: /usr/local
> Modules:
> cURL (/usr/local/share/lua/5.3/cURL.lua)
> cURL.impl.cURL (/usr/local/share/lua/5.3/cURL/impl/cURL.lua)
> cURL.safe (/usr/local/share/lua/5.3/cURL/safe.lua)
> cURL.utils (/usr/local/share/lua/5.3/cURL/utils.lua)
> lcurl (/usr/local/lib/lua/5.3/lcurl.so)
> I have verified that the problem is present also if I require 'lcurl'
> rather than 'cURL'.
> My system is Ubuntu 16.04.2 LTS .
Did you try code that I post. Does it produce wrong file?
My 0.3.6-dev is close to release. And there no changes in C code
related with any IO operations quite a long time.
If you still have problem probably best open issue on github.
Do not forget post your problem code.
--
С уважением,
Alexey mailto:alexeymelnichuck@gmail.com
---
Это сообщение проверено на вирусы антивирусом Avast.
https://www.avast.com/antivirus