Comparison

net/http.lua @ 1037:cb5fdce8dcec

net.http: Fix potential nil access
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Apr 2009 20:29:35 +0100
parent 923:c63f9bc45a85
child 1112:e8a00a2ea910
comparison
equal deleted inserted replaced
1036:b2e19c66ec7f 1037:cb5fdce8dcec
7 7
8 local connlisteners_get = require "net.connlisteners".get; 8 local connlisteners_get = require "net.connlisteners".get;
9 local listener = connlisteners_get("httpclient") or error("No httpclient listener!"); 9 local listener = connlisteners_get("httpclient") or error("No httpclient listener!");
10 10
11 local t_insert, t_concat = table.insert, table.concat; 11 local t_insert, t_concat = table.insert, table.concat;
12 local tonumber, tostring, pairs, xpcall, select, debug_traceback = 12 local tonumber, tostring, pairs, xpcall, select, debug_traceback, char =
13 tonumber, tostring, pairs, xpcall, select, debug.traceback; 13 tonumber, tostring, pairs, xpcall, select, debug.traceback, string.char;
14 14
15 local log = require "util.logger".init("http"); 15 local log = require "util.logger".init("http");
16 local print = function () end 16 local print = function () end
17 17
18 local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end }); 18 local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end });