Software / code / prosody
Comparison
net/http.lua @ 3540:bc139431830b
Monster whitespace commit (beware the whitespace monster).
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Sat, 16 Oct 2010 23:00:42 +0500 |
| parent | 3470:0e59b5cdd57b |
| child | 3569:f30da46e0add |
comparison
equal
deleted
inserted
replaced
| 3539:8bbd965267b2 | 3540:bc139431830b |
|---|---|
| 17 local listener = connlisteners_get("httpclient") or error("No httpclient listener!"); | 17 local listener = connlisteners_get("httpclient") or error("No httpclient listener!"); |
| 18 | 18 |
| 19 local t_insert, t_concat = table.insert, table.concat; | 19 local t_insert, t_concat = table.insert, table.concat; |
| 20 local pairs, ipairs = pairs, ipairs; | 20 local pairs, ipairs = pairs, ipairs; |
| 21 local tonumber, tostring, xpcall, select, debug_traceback, char, format = | 21 local tonumber, tostring, xpcall, select, debug_traceback, char, format = |
| 22 tonumber, tostring, xpcall, select, debug.traceback, string.char, string.format; | 22 tonumber, tostring, xpcall, select, debug.traceback, string.char, string.format; |
| 23 | 23 |
| 24 local log = require "util.logger".init("http"); | 24 local log = require "util.logger".init("http"); |
| 25 | 25 |
| 26 module "http" | 26 module "http" |
| 27 | 27 |
| 44 end | 44 end |
| 45 return t_concat(result, "&"); | 45 return t_concat(result, "&"); |
| 46 end | 46 end |
| 47 | 47 |
| 48 local function expectbody(reqt, code) | 48 local function expectbody(reqt, code) |
| 49 if reqt.method == "HEAD" then return nil end | 49 if reqt.method == "HEAD" then return nil end |
| 50 if code == 204 or code == 304 or code == 301 then return nil end | 50 if code == 204 or code == 304 or code == 301 then return nil end |
| 51 if code >= 100 and code < 200 then return nil end | 51 if code >= 100 and code < 200 then return nil end |
| 52 return 1 | 52 return 1 |
| 53 end | 53 end |
| 54 | 54 |
| 55 local function request_reader(request, data, startpos) | 55 local function request_reader(request, data, startpos) |
| 56 if not data then | 56 if not data then |
| 57 if request.body then | 57 if request.body then |