From cad7de5c38308de115cfdcaf0855c7148265f76a Mon Sep 17 00:00:00 2001 From: Izaya Date: Sun, 18 Mar 2018 13:48:13 +1100 Subject: [PATCH] removed some unneccesary code from microtel-4 --- Embedded/microtel-4-mini.lua | 4 ---- Embedded/microtel-4.lua | 14 +++++--------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Embedded/microtel-4-mini.lua b/Embedded/microtel-4-mini.lua index 383b9b3..1f89d51 100644 --- a/Embedded/microtel-4-mini.lua +++ b/Embedded/microtel-4-mini.lua @@ -1,14 +1,10 @@ net.mtu=4096 function net.send(T,P,L) local D={} -if L:len()>net.mtu then for i=1,L:len(),net.mtu do D[#D+1]=L:sub(1,net.mtu) L=L:sub(net.mtu+1) end -else -D={L} -end for k,v in ipairs(D) do net.rsend(T,P,v) end diff --git a/Embedded/microtel-4.lua b/Embedded/microtel-4.lua index 3782d5d..15e0f19 100644 --- a/Embedded/microtel-4.lua +++ b/Embedded/microtel-4.lua @@ -1,15 +1,11 @@ net.mtu = 4096 -function net.send(to,vport,ldata) +function net.lsend(to,vport,ldata) local tdata = {} - if ldata:len() > net.mtu then - for i = 1, ldata:len(), net.mtu do - tdata[#tdata+1] = ldata:sub(1,net.mtu) - ldata = ldata:sub(net.mtu+1) - end - else - tdata = {ldata} + for i = 1, ldata:len(), net.mtu do + tdata[#tdata+1] = ldata:sub(1,net.mtu) + ldata = ldata:sub(net.mtu+1) end for k,v in ipairs(tdata) do - net.rsend(to,vport,v) + net.send(to,vport,v) end end