Comparison

net/http/server.lua @ 4714:7dedf8cc173c

Revert 98bfebb38705, moved to net.http.parser in 4fc99f1b7570
author Matthew Wild <mwild1@gmail.com>
date Thu, 26 Apr 2012 16:25:11 +0100
parent 4709:98bfebb38705
child 4715:4d6ebe54671e
comparison
equal deleted inserted replaced
4709:98bfebb38705 4714:7dedf8cc173c
1 1
2 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; 2 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat;
3 local parser_new = require "net.http.parser".new; 3 local parser_new = require "net.http.parser".new;
4 local url_parse = require "socket.url".parse;
5 local events = require "util.events".new(); 4 local events = require "util.events".new();
6 local addserver = require "net.server".addserver; 5 local addserver = require "net.server".addserver;
7 local log = require "util.logger".init("http.server"); 6 local log = require "util.logger".init("http.server");
8 local os_date = os.date; 7 local os_date = os.date;
9 local pairs = pairs; 8 local pairs = pairs;
100 end 99 end
101 end 100 end
102 local function success_cb(request) 101 local function success_cb(request)
103 --log("debug", "success_cb: %s", request.path); 102 --log("debug", "success_cb: %s", request.path);
104 request.secure = secure; 103 request.secure = secure;
105 local parsed_dest = url_parse(request.path);
106 request.url = parsed_dest;
107 request.path = parsed_dest.path;
108 t_insert(pending, request); 104 t_insert(pending, request);
109 if not waiting then 105 if not waiting then
110 process_next(); 106 process_next();
111 end 107 end
112 end 108 end