aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-12-26 20:35:40 +0100
committerKim Alvefur <zash@zash.se>2012-12-26 20:35:40 +0100
commit2fcee0e7f8872fd4357ed15e7c34cc327ec99ae1 (patch)
tree5bbd6b49aac7077d566f6bc7eaf3298a445a5d3e /net
parent1d1efd975193cd7d8f0bb221b9bedba3a50d9065 (diff)
parentea67b3cd4ab3813c3d0c2bb368dccd644a2a9a26 (diff)
downloadprosody-2fcee0e7f8872fd4357ed15e7c34cc327ec99ae1.tar.gz
prosody-2fcee0e7f8872fd4357ed15e7c34cc327ec99ae1.zip
Merge 0.9->trunk
Diffstat (limited to 'net')
-rw-r--r--net/dns.lua6
-rw-r--r--net/http/parser.lua9
2 files changed, 14 insertions, 1 deletions
diff --git a/net/dns.lua b/net/dns.lua
index 5b32a56c..a134eceb 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -549,6 +549,7 @@ function resolver:decode(packet, force) -- - - - - - - - - - - - - - decode
if not force then
if not self.active[response.header.id] or not self.active[response.header.id][response.question.raw] then
+ self.active[response.header.id] = nil;
return nil;
end
end
@@ -642,6 +643,7 @@ function resolver:voidsocket(sock)
self.socket[self.socketset[sock]] = nil;
self.socketset[sock] = nil;
end
+ sock:close();
end
function resolver:socket_wrapper_set(func) -- - - - - - - socket_wrapper_set
@@ -796,6 +798,9 @@ function resolver:servfail(sock)
end
end
end
+ if next(queries) == nil then
+ self.active[id] = nil;
+ end
end
if num == self.best_server then
@@ -852,6 +857,7 @@ function resolver:receive(rset) -- - - - - - - - - - - - - - - - - receive
set(self.wanted, q.class, q.type, q.name, nil);
end
end
+
end
end
end
diff --git a/net/http/parser.lua b/net/http/parser.lua
index c760a0a4..b53dfa4e 100644
--- a/net/http/parser.lua
+++ b/net/http/parser.lua
@@ -91,7 +91,14 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb)
responseheaders = headers;
};
else
- local parsed_url = url_parse(path);
+ local parsed_url;
+ if path:byte() == 47 then -- starts with /
+ local _path, _query = path:match("([^?]*).?(.*)");
+ if _query == "" then _query = nil; end
+ parsed_url = { path = _path, query = _query };
+ else
+ parsed_url = url_parse(path);
+ end
path = preprocess_path(parsed_url.path);
headers.host = parsed_url.host or headers.host;