Comparison

net/adns.lua @ 5776:bd0ff8ae98a8

Remove all trailing whitespace
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 09 Aug 2013 17:48:21 +0200
parent 5730:411e9e7d8035
child 6289:a29cc79295e6
comparison
equal deleted inserted replaced
5775:a6c2b8933507 5776:bd0ff8ae98a8
1 -- Prosody IM 1 -- Prosody IM
2 -- Copyright (C) 2008-2010 Matthew Wild 2 -- Copyright (C) 2008-2010 Matthew Wild
3 -- Copyright (C) 2008-2010 Waqas Hussain 3 -- Copyright (C) 2008-2010 Waqas Hussain
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 local server = require "net.server"; 9 local server = require "net.server";
62 log("warn", "DNS socket for %s disconnected: %s", peername, err); 62 log("warn", "DNS socket for %s disconnected: %s", peername, err);
63 local servers = resolver.server; 63 local servers = resolver.server;
64 if resolver.socketset[conn] == resolver.best_server and resolver.best_server == #servers then 64 if resolver.socketset[conn] == resolver.best_server and resolver.best_server == #servers then
65 log("error", "Exhausted all %d configured DNS servers, next lookup will try %s again", #servers, servers[1]); 65 log("error", "Exhausted all %d configured DNS servers, next lookup will try %s again", #servers, servers[1]);
66 end 66 end
67 67
68 resolver:servfail(conn); -- Let the magic commence 68 resolver:servfail(conn); -- Let the magic commence
69 end 69 end
70 end 70 end
71 handler, err = server.wrapclient(sock, "dns", 53, listener); 71 handler, err = server.wrapclient(sock, "dns", 53, listener);
72 if not handler then 72 if not handler then
73 return nil, err; 73 return nil, err;
74 end 74 end
75 75
76 handler.settimeout = function () end 76 handler.settimeout = function () end
77 handler.setsockname = function (_, ...) return sock:setsockname(...); end 77 handler.setsockname = function (_, ...) return sock:setsockname(...); end
78 handler.setpeername = function (_, ...) peername = (...); local ret = sock:setpeername(...); _:set_send(dummy_send); return ret; end 78 handler.setpeername = function (_, ...) peername = (...); local ret = sock:setpeername(...); _:set_send(dummy_send); return ret; end
79 handler.connect = function (_, ...) return sock:connect(...) end 79 handler.connect = function (_, ...) return sock:connect(...) end
80 --handler.send = function (_, data) _:write(data); return _.sendbuffer and _.sendbuffer(); end 80 --handler.send = function (_, data) _:write(data); return _.sendbuffer and _.sendbuffer(); end