]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_lamp/commitdiff
fifosock: dramatically simplify
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Sat, 29 Jul 2017 20:09:42 +0000 (16:09 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Mon, 31 Jul 2017 11:57:54 +0000 (07:57 -0400)
All we really need here is a thin shim around send; stop trying to be
clever, it just makes things obfucsated when they go wrong.

Chase consequences around the tree.  Extensive testing was done looking
for memory leaks despite the newfound simplicity, with none found.

init2.lua

index 540689405c96cab364bc4cd9c315d7e3a08a8a8c..713b69b0e2a50ab4b26017cca07681e0a35468f0 100644 (file)
--- a/init2.lua
+++ b/init2.lua
@@ -24,7 +24,7 @@ end
 tcpserv = net.createServer(net.TCP, 120)
 tcpserv:listen(23,function(k)
   local telnetd = dofile "telnetd.lc"
-  telnetd.on["conn"] = function(k) k:send(string.format("%s [NODE-%06X]",mqttUser,node.chipid())) end
+  telnetd.on["conn"] = function(k) k(string.format("%s [NODE-%06X]",mqttUser,node.chipid())) end
   telnetd.server(k)
 end)