Skip to content

Commit 9d27c94

Browse files
committed
Update examples.
1 parent 810ab53 commit 9d27c94

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

examples/lcurl/curl_debug.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ local function printf(...)
88
io.stderr:write(string.format(...))
99
end
1010

11-
local function dumb(title, data, n)
11+
local function dump(title, data, n)
1212
n = n or 16
1313
printf("%s, %10.10d bytes (0x%8.8x)\n", title, #data, #data)
1414
for i = 1, #data do
@@ -28,7 +28,7 @@ local function my_trace(type, data)
2828
if type == curl.INFO_HEADER_IN then text = "<= Recv header" end
2929
if type == curl.INFO_DATA_IN then text = "<= Recv data" end
3030
if type == curl.INFO_SSL_DATA_IN then text = "<= Recv SSL data" end
31-
if text then dumb(text, data) end
31+
if text then dump(text, data) end
3232
end
3333

3434
local easy = curl.easy{

examples/lcurl/fnmatch.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ local c = curl.easy{
2121
}
2222

2323
local data, n = 0, 0
24-
c:setopt_writefunction(function(chunk) data = #chunk + 1 end)
24+
c:setopt_writefunction(function(chunk) data = #chunk + data end)
2525

2626
-- called before each new file
2727
c:setopt_chunk_bgn_function(function(info, remains)
@@ -32,7 +32,7 @@ end)
3232

3333
-- called after file download complite
3434
c:setopt_chunk_end_function(function()
35-
printf('total size %d\n', data)
35+
printf('total size %d[B]\n', data)
3636
printf('------------------------------------------------------\n')
3737
end)
3838

0 commit comments

Comments
 (0)