aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-02 00:24:37 +0200
committerKim Alvefur <zash@zash.se>2017-04-02 00:24:37 +0200
commitf9143a1fec04d1825e729dc8929d1fd6b7e2f2c0 (patch)
tree289fa4c9a9d46fe73e0f4bee4156b769192d2af5 /net
parentc082eab4d489f073864af48024a9e2ee032824d3 (diff)
parent73dc95b76503f3f4ef6fa3b1e90e7293f608b263 (diff)
downloadprosody-im-server-f9143a1fec04d1825e729dc8929d1fd6b7e2f2c0.tar
prosody-im-server-f9143a1fec04d1825e729dc8929d1fd6b7e2f2c0.zip
Merge 0.10->trunk
Diffstat (limited to 'net')
-rw-r--r--net/http.lua6
-rw-r--r--net/http/parser.lua2
2 files changed, 4 insertions, 4 deletions
diff --git a/net/http.lua b/net/http.lua
index dcf94bdd..2fd46db9 100644
--- a/net/http.lua
+++ b/net/http.lua
@@ -68,7 +68,7 @@ end
function listener.ondisconnect(conn, err)
local request = requests[conn];
if request and request.conn then
- request:reader(nil, err);
+ request:reader(nil, err or "closed");
end
requests[conn] = nil;
end
@@ -126,7 +126,7 @@ local function request(u, ex, callback)
local req = url.parse(u);
if not (req and req.host) then
- callback(nil, 0, req);
+ callback("invalid-url", 0, req);
return nil, "invalid-url";
end
@@ -190,7 +190,7 @@ local function request(u, ex, callback)
local handler, conn = server.addclient(host, port_number, listener, "*a", sslctx)
if not handler then
- callback(nil, 0, req);
+ callback(conn, 0, req);
return nil, conn;
end
req.handler, req.conn = handler, conn
diff --git a/net/http/parser.lua b/net/http/parser.lua
index 96d32ec8..4e4ae9fb 100644
--- a/net/http/parser.lua
+++ b/net/http/parser.lua
@@ -46,7 +46,7 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb)
packet.body = buf;
success_cb(packet);
elseif buf ~= "" then -- unexpected EOF
- error = true; return error_cb();
+ error = true; return error_cb("unexpected-eof");
end
return;
end