aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/get.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/get.lua b/etc/get.lua
index c7e2a43..712d807 100644
--- a/etc/get.lua
+++ b/etc/get.lua
@@ -4,11 +4,11 @@
4-- Author: Diego Nehab 4-- Author: Diego Nehab
5-- RCS ID: $Id$ 5-- RCS ID: $Id$
6----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
7socket = require("socket") 7local socket = require("socket")
8http = require("http") 8local http = require("http")
9ftp = require("ftp") 9local ftp = require("ftp")
10url = require("url") 10local url = require("url")
11ltn12 = require("ltn12") 11local ltn12 = require("ltn12")
12 12
13-- formats a number of seconds into human readable form 13-- formats a number of seconds into human readable form
14function nicetime(s) 14function nicetime(s)
@@ -64,11 +64,11 @@ end
64-- creates a new instance of a receive_cb that saves to disk 64-- creates a new instance of a receive_cb that saves to disk
65-- kind of copied from luasocket's manual callback examples 65-- kind of copied from luasocket's manual callback examples
66function stats(size) 66function stats(size)
67 local start = socket.time() 67 local start = socket.gettime()
68 local got = 0 68 local got = 0
69 return function(chunk) 69 return function(chunk)
70 -- elapsed time since start 70 -- elapsed time since start
71 local delta = socket.time() - start 71 local delta = socket.gettime() - start
72 if chunk then 72 if chunk then
73 -- total bytes received 73 -- total bytes received
74 got = got + string.len(chunk) 74 got = got + string.len(chunk)