Software /
code /
prosody
Comparison
net/dns.lua @ 2573:60493186fef6
net.dns: Removed some useless indirection to improve readability.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 10 Feb 2010 00:34:30 +0500 |
parent | 2425:772b2caf762e |
child | 2574:7a12578aadb1 |
comparison
equal
deleted
inserted
replaced
2572:0584e157f073 | 2573:60493186fef6 |
---|---|
925 setmetatable (r.cache, cache_metatable); | 925 setmetatable (r.cache, cache_metatable); |
926 setmetatable (r.unsorted, { __mode = 'kv' }); | 926 setmetatable (r.unsorted, { __mode = 'kv' }); |
927 return r; | 927 return r; |
928 end | 928 end |
929 | 929 |
930 local _resolver = dns.resolver(); | |
931 dns._resolver = _resolver; | |
930 | 932 |
931 function dns.lookup(...) -- - - - - - - - - - - - - - - - - - - - - lookup | 933 function dns.lookup(...) -- - - - - - - - - - - - - - - - - - - - - lookup |
932 return resolve(resolver.lookup, ...); | 934 return _resolver:lookup(...); |
933 end | 935 end |
934 | 936 |
935 | 937 |
936 function dns.purge(...) -- - - - - - - - - - - - - - - - - - - - - - purge | 938 function dns.purge(...) -- - - - - - - - - - - - - - - - - - - - - - purge |
937 return resolve(resolver.purge, ...); | 939 return _resolver:purge(...); |
938 end | 940 end |
939 | 941 |
940 function dns.peek(...) -- - - - - - - - - - - - - - - - - - - - - - - peek | 942 function dns.peek(...) -- - - - - - - - - - - - - - - - - - - - - - - peek |
941 return resolve(resolver.peek, ...); | 943 return _resolver:peek(...); |
942 end | 944 end |
943 | |
944 | 945 |
945 function dns.query(...) -- - - - - - - - - - - - - - - - - - - - - - query | 946 function dns.query(...) -- - - - - - - - - - - - - - - - - - - - - - query |
946 return resolve(resolver.query, ...); | 947 return _resolver:query(...); |
947 end | 948 end |
948 | 949 |
949 function dns.feed(...) -- - - - - - - - - - - - - - - - - - - - - - feed | 950 function dns.feed(...) -- - - - - - - - - - - - - - - - - - - - - - feed |
950 return resolve(resolver.feed, ...); | 951 return _resolver:feed(...); |
951 end | 952 end |
952 | 953 |
953 function dns.cancel(...) -- - - - - - - - - - - - - - - - - - - - - - cancel | 954 function dns.cancel(...) -- - - - - - - - - - - - - - - - - - - - - - cancel |
954 return resolve(resolver.cancel, ...); | 955 return _resolver:cancel(...); |
955 end | 956 end |
956 | 957 |
957 function dns:socket_wrapper_set(...) -- - - - - - - - - socket_wrapper_set | 958 function dns:socket_wrapper_set(...) -- - - - - - - - - socket_wrapper_set |
958 return resolve(resolver.socket_wrapper_set, ...); | 959 return _resolver:socket_wrapper_set(...); |
959 end | 960 end |
960 | |
961 dns._resolver = dns.resolver(); | |
962 | 961 |
963 return dns; | 962 return dns; |