Kim Alvefur
70e3e96c02
net.server_epoll: Backport timer optimization 6c2370f17027 from trunk (see #1388 )
...
The previous timer handling did not scale well and led to high CPU usage
with many connections (each with at least an read timeout).
7 years ago
Kim Alvefur
d2d042186f
net.server_epoll: Restore wantread flag after pause ( fixes #1354 )
...
If a chunk of data has been received that is larger than the amount read
at a time, then the connection is paused for a short time after which it
tries to read some more. If, after that, there is still more data to
read, it should do the same thing. However, because the "want read" flag
is removed and was restored after the delayed reading, it would not
schedule another delayed read.
7 years ago
Kim Alvefur
94880142e9
net.dns: Close resolv.conf handle when done ( fixes #1342 )
7 years ago
Kim Alvefur
c422e8f134
net.server_epoll: Skip delayed continuation read on paused connections
...
This should prevent #1333 in cases where LuaSockets buffer is "dirty",
i.e. contains more data after a read, where it gets resumed with a
short delay.
7 years ago
Kim Alvefur
e34e8e845d
net.server_epoll: Handle LuaSec wantread/wantwrite conditions before callbacks ( fixes #1333 )
...
This prevents the :set(true) call from resuming a connection that was
paused in the onincoming callback.
7 years ago
Kim Alvefur
66d2e6adc3
net.server_epoll: Rename handshake_timeout to ssl_handshake_timeout ( fixes #1319 )
...
This is to match server_event, see 430797a8fc81
7 years ago
Kim Alvefur
8732027944
net.server_epoll: Use send_timeout for write timout like other implementations ( fixes #1316 )
7 years ago
Kim Alvefur
6176e9ff1b
server_epoll: Add comments describing config options
7 years ago
Kim Alvefur
448257af39
net.server_epoll: Remove unused config option
7 years ago
Kim Alvefur
160fd37742
server_epoll: Increase write timeout
...
7 may be too low for some slow machines and/or networks
7 years ago
Kim Alvefur
589010b407
net.server_select: Fix IP validation to use correct variable (thanks quest)
...
Copy-paste mistake most likely. Not caught because server_select is ignored by luacheck.
7 years ago
Matthew Wild
8ebaee9c3d
net.http.server: Move event formation to avoid traceback on missing Host header
7 years ago
Kim Alvefur
8226d6de4c
net.http: Manually merge settings ( fixes #1231 )
...
Metatable table indexing is done raw, so metatables can't be chained
7 years ago
Kim Alvefur
84c8383fb6
net.server_epoll: Shuffle variables earlier to improve readability
7 years ago
Matthew Wild
f5f6460b2e
Many things: switch from hacky multi-arg xpcall implementations to a standard util.xpcall
7 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
0ac9ea3a74
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
e1aa03deaa
net.server_epoll: Check return conditions of early socket setup
7 years ago
Kim Alvefur
f2d9638627
net.server_epoll: Add support for the conn_type argument to addclient
7 years ago
Kim Alvefur
83e1a2af50
net.resolvers.basic: Suffix IPv4 TCP socket types with '4' to match eg 'tcp6'
7 years ago
Kim Alvefur
2104ac9fb0
net.server: Remove socket constructor fallback
...
Should no longer be needed
7 years ago
Kim Alvefur
fda067d696
net.server_epoll: Assert successful creation of util.poll handle
7 years ago
Kim Alvefur
0304fc6ba2
net.server_epoll: Update copyright year
7 years ago
Kim Alvefur
8a62a14e5d
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
6b592b4bee
net.server_epoll: Log error number from wait()
7 years ago
Kim Alvefur
9b2c4b2740
net.server_epoll: Pass error number to logging
...
Why do we ignore unused secondaries?
7 years ago
Kim Alvefur
d92dfb7bc8
net.server_epoll: Fix luacheck annotation
7 years ago
Kim Alvefur
27ad8d000e
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
b701156f2f
net.server_epoll: Inherit Direct TLS flag from servers to their clients
7 years ago
Kim Alvefur
68d9b01091
net.server_epoll: Catch errors from luasec.wrap
...
It throws if given an invalid TLS context
7 years ago
Kim Alvefur
9291209e82
net.server_epoll: Delay wrapping sockets in TLS until just before first handshake
7 years ago
Kim Alvefur
e8e4292dc4
net.resolvers.service: Sort SRV records in correct direction
7 years ago
Kim Alvefur
ca4804c413
net.resolvers.service: Fix sorting SRV record
7 years ago
Kim Alvefur
bb9b344fee
net.resolvers.service: Rename internal variable since net.connect uses it for __tostring
7 years ago
Kim Alvefur
6dfb01673a
net.resolvers.service: Add support for fallback to bare domain and default port
...
The default port must be configured separately to enable this behavior
7 years ago
Kim Alvefur
ce0ce78b78
net.resolvers.service: Early return on empty result set
7 years ago
Kim Alvefur
06b75d8153
net.resolvers.service: Understand when service is explicitly unavailable
...
RFC2782 states:
> A Target of "." means that the service is decidedly not available at
> this domain.
7 years ago
Kim Alvefur
0a784969c0
net.resolvers.service: net.connect resolver that uses SRV records
7 years ago
Kim Alvefur
7a86af343f
net.connect: Fix passing request table to new listener
...
This could be a return value from ondetach
7 years ago
Kim Alvefur
7f9c753df9
net.connect: Remove manual onattach callback invocation
7 years ago
Kim Alvefur
437fd63c6f
net.server: Call a 'onattach' callback when replacing listeners
7 years ago
Kim Alvefur
341cb9cc54
net.server_epoll: Include errno in log messages
7 years ago
Kim Alvefur
83f3341452
net.server_epoll: Factor out IP/port detection into its own method
7 years ago
Kim Alvefur
6ba93205b0
net.server_epoll: Protect from errors in get{peer,sock}name
7 years ago
Kim Alvefur
e9146e8777
net.server_epoll: Watching instead of registering, seems more understandable
7 years ago
Kim Alvefur
95eac7d4c6
net.http.server: Delay host checks until after host-less event
...
This allows handling events without any hosts enabled.
7 years ago
Kim Alvefur
91c5bd7853
net.http.server: Fire an event without host
7 years ago
Kim Alvefur
a31b6728d4
Revert 2dc7490899ae::5d6b252bc36f: Unfinished and broken
7 years ago