summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2011-04-02 17:29:07 (GMT)
committerChristian Pointner <equinox@helsinki.at>2011-04-02 17:29:07 (GMT)
commitaa3bbc7d588739c1b86ed8d6a523a7a97bb96744 (patch)
tree09a5a0ef52638090c3f8341080b3c567966d0dfa
parent96889f1baf748b33f65398c79c03b439eaa0f3ef (diff)
better client handling on write error
-rw-r--r--rhnop-server/tcpserver.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/rhnop-server/tcpserver.lua b/rhnop-server/tcpserver.lua
index c035ba4..bb7fcc5 100644
--- a/rhnop-server/tcpserver.lua
+++ b/rhnop-server/tcpserver.lua
@@ -116,8 +116,12 @@ function main_loop()
end
for _, output in ipairs(writeables) do
- local ret = assert(output.hdl:send(output.buffer))
- output.buffer = string.sub(output.buffer, ret+1)
+ local ret = output.hdl:send(output.buffer)
+ if(ret == nil) then
+ remove_client(output)
+ else
+ output.buffer = string.sub(output.buffer, ret+1)
+ end
end
end
end