X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=net%2Fhttpclient_listener.lua;h=69b7946b9f1441ee6dd123a65116e784e45059da;hb=d7563fd6f04b7a307ee1aa4fdc557e104b8a4dad;hp=1948f2782962084e5528bc0576e37d1c05761d8c;hpb=833006543a919f4d316f85d887e264cc15d65e2a;p=prosody.git diff --git a/net/httpclient_listener.lua b/net/httpclient_listener.lua index 1948f278..69b7946b 100644 --- a/net/httpclient_listener.lua +++ b/net/httpclient_listener.lua @@ -1,6 +1,14 @@ +-- Prosody IM +-- Copyright (C) 2008-2009 Matthew Wild +-- Copyright (C) 2008-2009 Waqas Hussain +-- +-- This project is MIT/X11 licensed. Please see the +-- COPYING file in the source package for more information. +-- -local connlisteners_register = require "net.connlisteners".register; +local log = require "util.logger".init("httpclient_listener"); +local connlisteners_register = require "net.connlisteners".register; local requests = {}; -- Open requests local buffers = {}; -- Buffers of partial lines @@ -11,7 +19,7 @@ function httpclient.listener(conn, data) local request = requests[conn]; if not request then - print("NO REQUEST!! for "..tostring(conn)); + log("warn", "Received response from connection %s with no request attached!", tostring(conn)); return; end @@ -25,11 +33,11 @@ function httpclient.disconnect(conn, err) if request then request:reader(nil); end - --requests[conn] = nil; + requests[conn] = nil; end function httpclient.register_request(conn, req) - print("Registering a request for "..tostring(conn)); + log("debug", "Attaching request %s to connection %s", tostring(req.id or req), tostring(conn)); requests[conn] = req; end