Kim Alvefur
e0a5c81fb0
net.server_epoll: Shuffle variables earlier to improve readability
7 years ago
Kim Alvefur
6d12622b2a
net.server_epoll: Special handling of signal interrupts
7 years ago
Kim Alvefur
ec7fb3ee61
net.server_epoll: Ignore ENOENT when deregitering socket
...
It should not really happen
7 years ago
Kim Alvefur
6f088c5034
net.server_epoll: Graceful handling of registering already added socket
7 years ago
Kim Alvefur
75784460bb
net.server: Swich method for connecting sockets with remotes
...
LuaSocket TCP sockets have have both :connect and :setpeername, which
are the exact same function, however UDP sockets only have :setpeername.
Switching to :setpeername allows most of this code to be generic wrt
TCP/UDP.
7 years ago
Kim Alvefur
0ae3ed3ea9
net.server_epoll: Check return conditions of early socket setup
7 years ago
Kim Alvefur
b59d36968a
net.server_epoll: Add support for the conn_type argument to addclient
7 years ago
Kim Alvefur
25fac9a74b
net.server_epoll: Assert successful creation of util.poll handle
7 years ago
Kim Alvefur
71c3649d97
net.server_epoll: Update copyright year
7 years ago
Kim Alvefur
d1c5754d3c
net.server: Require IP address as argument to addclient (no DNS names)
...
The net.connect API should be used to resolve DNS names first
7 years ago
Kim Alvefur
c81f221767
net.server_epoll: Log error number from wait()
7 years ago
Kim Alvefur
e02f405a5f
net.server_epoll: Pass error number to logging
...
Why do we ignore unused secondaries?
7 years ago
Kim Alvefur
2e73c8dd2e
net.server_epoll: Fix luacheck annotation
7 years ago
Kim Alvefur
9f1837f5a4
net.server_epoll: Make :set_send a noop, should fix net.adns
...
This is also a noop in server_event. Supposedly meant to prevent
buffered writes from being sent to the socket, but that path becomes
unreachable when net.adns replaces the public send method
7 years ago
Kim Alvefur
34bd628b8c
net.server_epoll: Inherit Direct TLS flag from servers to their clients
7 years ago
Kim Alvefur
78c3965089
net.server_epoll: Catch errors from luasec.wrap
...
It throws if given an invalid TLS context
7 years ago
Kim Alvefur
a13adc7a8c
net.server_epoll: Delay wrapping sockets in TLS until just before first handshake
7 years ago
Kim Alvefur
177fab2322
net.connect: Fix passing request table to new listener
...
This could be a return value from ondetach
7 years ago
Kim Alvefur
074af5e0b1
net.server: Call a 'onattach' callback when replacing listeners
7 years ago
Kim Alvefur
87a85e347e
net.server_epoll: Include errno in log messages
7 years ago
Kim Alvefur
47963b59da
net.server_epoll: Factor out IP/port detection into its own method
7 years ago
Kim Alvefur
4691dc6bef
net.server_epoll: Protect from errors in get{peer,sock}name
7 years ago
Kim Alvefur
f1ce7fec66
net.server_epoll: Watching instead of registering, seems more understandable
7 years ago
Kim Alvefur
db5cef1861
net.server_epoll: Simplify minimal string representation
...
.conn might just be the FD sometimes
7 years ago
Kim Alvefur
d2bbc414c2
net.server_epoll: Add back setflags API for compat
7 years ago
Kim Alvefur
a39eb7be8f
net.server_epoll: Fix write signal handling in watchfd API
...
The main loop calls :onwritable but here it was spelled :onwriteable
7 years ago
Kim Alvefur
aaa28d9ab0
net.server_epoll: Use util.poll
8 years ago
Kim Alvefur
03097e5230
net.server_epoll: Make read_size a server-wide option
...
Can still be overriden per connection
7 years ago
Kim Alvefur
aaed8b90a0
net.server_epoll: Rename pattern to read_size
7 years ago
Kim Alvefur
27321d582d
net.server_epoll: Refactor Direct TLS assumptions outwards
...
The assumption that connections are "Direct TLS" when a TLS context is
supplided should be broken. The goal is to make it easy to add a new API
that can be given a TLS context at creation even if it should do
STARTTLS.
With this commit, only the exposed server_select-compatible API assumes
Direct TLS when a TLS context is included.
7 years ago
Kim Alvefur
fee3f096fc
net.server_epoll: Factor Direct TLS handling out of connection initialization
...
Eventually it should be possible to create a socket that has a TLS
context but that does not automatically start TLS on connect.
7 years ago
Kim Alvefur
9b035ed542
net.server_epoll: Remove coercion of connections to strings
...
No longer needed since util.logger does this now
7 years ago
Kim Alvefur
220191bc5e
net.server_epoll: Rename all variables holding TLS contexts for consistency
7 years ago
Kim Alvefur
e77ed7aa89
net.server: Set default read timeout to 14 minutes ( fixes #971 )
8 years ago
Kim Alvefur
a247edeac9
net.server: Add watchfd, a simple API for watching file descriptors
8 years ago
Kim Alvefur
3cc1ca831f
net.server_epoll: Guard against connection missing the getpeername method (thanks LuaSec)
8 years ago
Kim Alvefur
d727b92dc6
net.server_epoll: Retry retrieving peername once connected
8 years ago
Kim Alvefur
17a7b45299
net.server_epoll: Handle connection being closed and destroyed in onconnect callback
8 years ago
Kim Alvefur
146acdbd33
vairious: Add annotation when an empty environment is set [luacheck]
8 years ago
Kim Alvefur
42eec26103
server_epoll: Onconnect should happen before first attempt to write to socket
8 years ago
Kim Alvefur
5d2cf77ff3
net.server_epoll: Spelling writeable -> writable
8 years ago
Kim Alvefur
a032613e26
net.server_epoll: Remove special casing for having sent an empty write buffer because the wantwrite flag must be unset regardless
8 years ago
Kim Alvefur
7a1cc7bc28
net.server_epoll: Call onconnect listener on first successful read or write
8 years ago
Kim Alvefur
36da2e1aab
server_epoll: Restore mark on connections which had the onconnect handler called so it is only done once
8 years ago
Kim Alvefur
09f7754302
server_epoll: Rework how socket readyness is detected
8 years ago
Kim Alvefur
9c9d5678b0
net.server_epoll: Add interface:server() method to match server_event (fixes c2s:show traceback in telnet console)
8 years ago
Kim Alvefur
ad56ba387e
net.server_epoll: Reset onwritable before calling onconnect (fixes traceback if connection closed in onconnect)
9 years ago
Kim Alvefur
e99b755de7
net.server_epoll: Attempt to simplify state control
9 years ago
Kim Alvefur
3c88f71ca0
net.server_epoll: Check write buffer for remaining data to write when closing
9 years ago
Kim Alvefur
604b2b4af3
net.server_epoll: Log if there's a connection without listeners
9 years ago