diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2002-12-03 07:20:34 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2002-12-03 07:20:34 +0000 |
| commit | 7da19138e37c4e0123860f1fecbceb80c3d2627d (patch) | |
| tree | 8453f003a9ba212807d9c9590c2f2b850d323f0f /src/http.lua | |
| parent | d7e80592a69c076991ed4f4cc15d5390e14d1f0b (diff) | |
| download | luasocket-7da19138e37c4e0123860f1fecbceb80c3d2627d.tar.gz luasocket-7da19138e37c4e0123860f1fecbceb80c3d2627d.tar.bz2 luasocket-7da19138e37c4e0123860f1fecbceb80c3d2627d.zip | |
Faltam testes de ftp e smtp. O resto passa.
Diffstat (limited to 'src/http.lua')
| -rw-r--r-- | src/http.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http.lua b/src/http.lua index dce3ac8..9543d59 100644 --- a/src/http.lua +++ b/src/http.lua | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | ----------------------------------------------------------------------------- | 8 | ----------------------------------------------------------------------------- |
| 9 | 9 | ||
| 10 | local Public, Private = {}, {} | 10 | local Public, Private = {}, {} |
| 11 | HTTP = Public | 11 | http = Public |
| 12 | 12 | ||
| 13 | ----------------------------------------------------------------------------- | 13 | ----------------------------------------------------------------------------- |
| 14 | -- Program constants | 14 | -- Program constants |
| @@ -195,7 +195,7 @@ end | |||
| 195 | function Private.receivebody_bylength(sock, length, receive_cb) | 195 | function Private.receivebody_bylength(sock, length, receive_cb) |
| 196 | local uerr, go | 196 | local uerr, go |
| 197 | while length > 0 do | 197 | while length > 0 do |
| 198 | local size = min(Public.BLOCKSIZE, length) | 198 | local size = math.min(Public.BLOCKSIZE, length) |
| 199 | local chunk, err = sock:receive(size) | 199 | local chunk, err = sock:receive(size) |
| 200 | if err then | 200 | if err then |
| 201 | go, uerr = receive_cb(nil, err) | 201 | go, uerr = receive_cb(nil, err) |
| @@ -542,7 +542,7 @@ function Public.request_cb(request, response) | |||
| 542 | scheme = "http" | 542 | scheme = "http" |
| 543 | }) | 543 | }) |
| 544 | if parsed.scheme ~= "http" then | 544 | if parsed.scheme ~= "http" then |
| 545 | response.error = format("unknown scheme '%s'", parsed.scheme) | 545 | response.error = string.format("unknown scheme '%s'", parsed.scheme) |
| 546 | return response | 546 | return response |
| 547 | end | 547 | end |
| 548 | -- explicit authentication info overrides that given by the URL | 548 | -- explicit authentication info overrides that given by the URL |
