aboutsummaryrefslogtreecommitdiff
path: root/src/http.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-16 01:02:07 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-16 01:02:07 +0000
commitd46f7a09a768b146f2f3cdc9a6a50357832bd1c7 (patch)
treed4f7ca1e677d06446245691d5ece6dab51915f16 /src/http.lua
parent843a431ef98fd541d98fd3898463985d9bfcde28 (diff)
downloadluasocket-d46f7a09a768b146f2f3cdc9a6a50357832bd1c7.tar.gz
luasocket-d46f7a09a768b146f2f3cdc9a6a50357832bd1c7.tar.bz2
luasocket-d46f7a09a768b146f2f3cdc9a6a50357832bd1c7.zip
Fixed smtp.lua loading.
Adjusted tftp module. Added some comments.
Diffstat (limited to 'src/http.lua')
-rw-r--r--src/http.lua7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/http.lua b/src/http.lua
index 129b562..8f3fdb9 100644
--- a/src/http.lua
+++ b/src/http.lua
@@ -2,7 +2,6 @@
2-- HTTP/1.1 client support for the Lua language. 2-- HTTP/1.1 client support for the Lua language.
3-- LuaSocket toolkit. 3-- LuaSocket toolkit.
4-- Author: Diego Nehab 4-- Author: Diego Nehab
5-- Conforming to RFC 2616
6-- RCS ID: $Id$ 5-- RCS ID: $Id$
7----------------------------------------------------------------------------- 6-----------------------------------------------------------------------------
8 7
@@ -23,7 +22,7 @@ _LOADED["http"] = getfenv(1)
23-- Program constants 22-- Program constants
24----------------------------------------------------------------------------- 23-----------------------------------------------------------------------------
25-- connection timeout in seconds 24-- connection timeout in seconds
26TIMEOUT = 4 25TIMEOUT = 60
27-- default port for document retrieval 26-- default port for document retrieval
28PORT = 80 27PORT = 80
29-- user agent field sent in request 28-- user agent field sent in request
@@ -146,7 +145,7 @@ end
146 145
147local function adjustrequest(reqt) 146local function adjustrequest(reqt)
148 -- parse url with default fields 147 -- parse url with default fields
149 local parsed = url.parse(reqt.url, { 148 local parsed = url.parse(reqt.url or "", {
150 host = "", 149 host = "",
151 port = PORT, 150 port = PORT,
152 path ="/", 151 path ="/",
@@ -258,5 +257,3 @@ post = socket.protect(function(u, body)
258 return (table.getn(t) > 0 or nil) and table.concat(t), 257 return (table.getn(t) > 0 or nil) and table.concat(t),
259 respt.headers, respt.code 258 respt.headers, respt.code
260end) 259end)
261
262return http