local file = io.popen("tail -f /var/log/ping.log")
for line in file:lines() do
local bytes, err = wb:send_text(line)
ngx.log(ngx.INFO, "LINE SENDED:",line,":",bytes,":",err)
if not bytes then
ngx.log(ngx.ERR, "failed to send a text frame: ", err)
return ngx.exit(444)
end
end
file:close()
after my browser(chrome/edge) closed,the "send_text" still return bytes and no error,which I hope a zero bytes and error msage like "the client connection is closed"
my lua code is just like this:
local file = io.popen("tail -f /var/log/ping.log") for line in file:lines() do local bytes, err = wb:send_text(line) ngx.log(ngx.INFO, "LINE SENDED:",line,":",bytes,":",err)
end file:close()
after my browser(chrome/edge) closed,the "send_text" still return bytes and no error,which I hope a zero bytes and error msage like "the client connection is closed"
need help