projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libs/lucid-http: copyz() causes a Kernel oops on brcm-2.4, revert to copy() for now...
[project/luci.git]
/
libs
/
lucid-http
/
luasrc
/
lucid
/
http
/
server.lua
diff --git
a/libs/lucid-http/luasrc/lucid/http/server.lua
b/libs/lucid-http/luasrc/lucid/http/server.lua
index
f5de4e9
..
7cfd1b7
100644
(file)
--- a/
libs/lucid-http/luasrc/lucid/http/server.lua
+++ b/
libs/lucid-http/luasrc/lucid/http/server.lua
@@
-344,7
+344,7
@@
function Server.parse_headers(self, source)
end
until false
end
until false
- env.SCRIPT_NAME, env.QUERY_STRING = env.REQUEST_URI:match("(
.
*)%??(.*)")
+ env.SCRIPT_NAME, env.QUERY_STRING = env.REQUEST_URI:match("(
[^?]
*)%??(.*)")
return req
end
return req
end
@@
-358,8
+358,8
@@
function Server.process(self, client, env)
local close = false
local stat, code, msg, message, err
local close = false
local stat, code, msg, message, err
- client:setsockopt("socket", "rcvtimeo",
1
5)
- client:setsockopt("socket", "sndtimeo",
1
5)
+ client:setsockopt("socket", "rcvtimeo", 5)
+ client:setsockopt("socket", "sndtimeo", 5)
repeat
-- parse headers
repeat
-- parse headers
@@
-432,6
+432,8
@@
function Server.process(self, client, env)
else
return self:error(client, 411, statusmsg[411])
end
else
return self:error(client, 411, statusmsg[411])
end
+
+ close = true
else
return self:error(client, 405, statusmsg[405])
end
else
return self:error(client, 405, statusmsg[405])
end
@@
-453,14
+455,14
@@
function Server.process(self, client, env)
end
end
if not headers["Content-Length"] then
end
end
if not headers["Content-Length"] then
- if message.
http_version == 1.1
then
+ if message.
env.SERVER_PROTOCOL == "HTTP/1.1"
then
headers["Transfer-Encoding"] = "chunked"
sinkout = chunksink(client)
else
close = true
end
end
headers["Transfer-Encoding"] = "chunked"
sinkout = chunksink(client)
else
close = true
end
end
- elseif message.
request_method ~= "head
" then
+ elseif message.
env.REQUEST_METHOD ~= "HEAD
" then
headers["Content-Length"] = 0
end
headers["Content-Length"] = 0
end
@@
-496,7
+498,9
@@
function Server.process(self, client, env)
if sourceout and stat then
if util.instanceof(sourceout, IOResource) then
if sourceout and stat then
if util.instanceof(sourceout, IOResource) then
- stat, code, msg = sourceout.fd:copyz(client, sourceout.len)
+ -- Jow: copyz() oopses on brcm-2.4, use copy() for now
+ --stat, code, msg = sourceout.fd:copyz(client, sourceout.len)
+ stat, code, msg = sourceout.fd:copy(client, sourceout.len)
else
stat, msg = ltn12.pump.all(sourceout, sinkout)
end
else
stat, msg = ltn12.pump.all(sourceout, sinkout)
end