Skip to content

Commit

Permalink
parse Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
HereAdvertise authored Jul 11, 2024
1 parent 2e14009 commit ab5c8b4
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions pgmoon/redbean.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,7 @@ do
end
return unix.recv(self.unix_socket, size)
end
local buf = ""
while true do
local events = assert(unix.poll({
[self.unix_socket] = unix.POLLIN
}, self.timeout))
if not (events[self.unix_socket]) then
return nil, "timeout"
end
if events[self.unix_socket] & CANREAD == 0 then
break
else
buf = buf .. assert(unix.recv(self.unix_socket, 4096))
end
end
return buf
return ""
end,
close = function(self)
return assert(unix.close(self.unix_socket))
Expand Down

0 comments on commit ab5c8b4

Please sign in to comment.