Kim Alvefur
625ec0a93f
util-src: Use the luaL_pushfail API added in Lua 5.4 to highlight all failure conditions
...
Actually just an alias of pushnil, but it does make it more obvious
where the failure conditions are, which is good for readability.
6 years ago
Kim Alvefur
2bb3772374
net.server_epoll: Special handling of signal interrupts
7 years ago
Kim Alvefur
afeb1f6f02
net.server_epoll: Ignore ENOENT when deregitering socket
...
It should not really happen
7 years ago
Kim Alvefur
bbf669b2c5
net.server_epoll: Graceful handling of registering already added socket
7 years ago
Kim Alvefur
f26390b484
util.poll: Fix inverted logic
7 years ago
Kim Alvefur
9547e0e66d
util.poll: Handle failed epoll FD creation
7 years ago
Kim Alvefur
22e0c16d4c
util.poll: Early return from __gc in case of no valid epoll FD
...
This could happen if the epoll FD has already been closed or
the epoll_create call failed
7 years ago
Kim Alvefur
28522988cc
util.poll: Increase max epoll events per call
...
This makes the struct roughly the same size in both epoll and select
mode (64bit).
There doesn’t seem to be much guidance on an appropriate size, it does
not seem to matter too much since if there are more events they will
simply show up in the next epoll_wait call. The number of exactly
concurrent events should be fairly low most of the time anyways.
7 years ago
Kim Alvefur
4a73f5daef
util.poll: Zero FD sets watched for errors on creation
7 years ago
Kim Alvefur
ceadb9c57c
net.poll: Guard against negative or too large FDs
7 years ago
Kim Alvefur
31c8b1aca3
util.poll: Fix missing return for adding duplicate FD
7 years ago
Kim Alvefur
8126707125
util.poll: Tweak metatable name field
7 years ago
Kim Alvefur
d3c236c693
util.poll: Fix monitoring of socket exceptions in select mode
...
Since state->err is a set of all watched FDs, this mistake caused all
sockets to appear to have errors.
7 years ago
Kim Alvefur
110ce660d5
util.poll: Lua 5.1 compat
7 years ago
Kim Alvefur
1ad376770f
util.poll: Remove 'inline' from function declaration
...
Why does this fix building?
7 years ago
Kim Alvefur
fa4507823f
util.poll: Import poll library with epoll and select support
8 years ago
Kim Alvefur
d8ab361f15
util.poll: Add missing return statements in fallback mode
...
These allowed modifying or deleting select() state for unregistered FDs.
During normal usage this should never happen. Modifying one that isn't
set might cause weirdness but deleting an already deleted FD isn't a
problem.
7 years ago
Kim Alvefur
b8f3a149da
util.poll: Minimize scope of methods
...
File scope is enough
7 years ago