Software /
code /
prosody
Comparison
net/http/server.lua @ 4715:4d6ebe54671e
Merge with backout
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 26 Apr 2012 16:25:17 +0100 |
parent | 4713:9c15fa5192d3 |
parent | 4714:7dedf8cc173c |
child | 4726:917a5ffb73f1 |
comparison
equal
deleted
inserted
replaced
4713:9c15fa5192d3 | 4715:4d6ebe54671e |
---|---|
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; |
105 end | 104 end |
106 end | 105 end |
107 local function success_cb(request) | 106 local function success_cb(request) |
108 --log("debug", "success_cb: %s", request.path); | 107 --log("debug", "success_cb: %s", request.path); |
109 request.secure = secure; | 108 request.secure = secure; |
110 local parsed_dest = url_parse(request.path); | |
111 request.url = parsed_dest; | |
112 request.path = parsed_dest.path; | |
113 t_insert(pending, request); | 109 t_insert(pending, request); |
114 if not waiting then | 110 if not waiting then |
115 process_next(); | 111 process_next(); |
116 end | 112 end |
117 end | 113 end |