# HG changeset patch # User Matthew Wild # Date 1266549710 0 # Node ID 1a7b5b775275d2fff4cc616fa75ab6dbf2c45d57 # Parent 23bb7e29819e81e25b6b7a52be425539e67f064f net.http: Close connection when invalid status line is received from the server diff -r 23bb7e29819e -r 1a7b5b775275 net/http.lua --- a/net/http.lua Fri Feb 19 03:21:20 2010 +0000 +++ b/net/http.lua Fri Feb 19 03:21:50 2010 +0000 @@ -107,7 +107,10 @@ local http, code, text, linelen = data:match("^HTTP/(%S+) (%d+) (.-)\r\n()", startpos); code = tonumber(code); if not code then - return request.callback("invalid-status-line", 0, request); + log("warn", "Invalid HTTP status line, telling callback then closing"); + local ret = request.callback("invalid-status-line", 0, request); + destroy_request(request); + return ret; end request.code, request.responseversion = code, http;