aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-20 22:19:54 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-20 22:19:54 +0000
commitf7579db9e830ef41f422a280d26c9077f48728e5 (patch)
treed96affac7f5e8203d2e9c4a053213a992cd76650 /etc
parent5dc5c3ebe8f111bba01762ca0f5edba912c4f0b9 (diff)
downloadluasocket-f7579db9e830ef41f422a280d26c9077f48728e5.tar.gz
luasocket-f7579db9e830ef41f422a280d26c9077f48728e5.tar.bz2
luasocket-f7579db9e830ef41f422a280d26c9077f48728e5.zip
Fixing bugs...
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)