Kim Alvefur
72decbc631
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
f3a77676cd
net.http.server: Move event formation to avoid traceback on missing Host header
7 years ago
Kim Alvefur
c500a82e46
net.http: Manually merge settings ( fixes #1231 )
...
Metatable table indexing is done raw, so metatables can't be chained
7 years ago
Kim Alvefur
e0a5c81fb0
net.server_epoll: Shuffle variables earlier to improve readability
7 years ago
Matthew Wild
9b5c6c4d9d
Many things: switch from hacky multi-arg xpcall implementations to a standard util.xpcall
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
8970cc5f06
net.resolvers.basic: Suffix IPv4 TCP socket types with '4' to match eg 'tcp6'
7 years ago
Kim Alvefur
59be9d9f5e
net.server: Remove socket constructor fallback
...
Should no longer be needed
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
f0974502f0
net.resolvers.service: Sort SRV records in correct direction
7 years ago
Kim Alvefur
bf44e646cd
net.resolvers.service: Fix sorting SRV record
7 years ago
Kim Alvefur
c5c2b7036c
net.resolvers.service: Rename internal variable since net.connect uses it for __tostring
7 years ago
Kim Alvefur
a4a7a46a34
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
26f0109a5f
net.resolvers.service: Early return on empty result set
7 years ago
Kim Alvefur
ea072d7c32
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
a84c5b89c0
net.resolvers.service: net.connect resolver that uses SRV records
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
6f80e5bfa6
net.connect: Remove manual onattach callback invocation
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
9f0ece7fc6
net.http.server: Delay host checks until after host-less event
...
This allows handling events without any hosts enabled.
7 years ago
Kim Alvefur
10045809c9
net.http.server: Fire an event without host
7 years ago
Kim Alvefur
853b4c3a2c
Revert 2dc7490899ae::5d6b252bc36f: Unfinished and broken
7 years ago
Kim Alvefur
aa34271523
net.http.server: Fix default host logic
...
This was used to construct the event name previously
7 years ago
Kim Alvefur
245cf9bfbf
net.http.server: Move handling of hosts to mod_http
...
Now an event like `GET /path` is fired at first, and mod\_http
dispatches the old `GET host/path` events.
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
5788d3bc53
net.dns: Lazily generate unknown RR type names
8 years ago
Kim Alvefur
cd282219c2
Backed out changeset eae606b9266c: Used a lot of memory
8 years ago
Kim Alvefur
28aad3d690
net.dns: Syntesize type names for the full range
...
Otherwise unknown records are identified as A records. This also fixes
various tracebacks unearthed by previous commits and mis-identified
records.
Related to #1056 #976 #819
8 years ago
Kim Alvefur
80e86b6726
net.dns: Don't attempt to cache unparsed data ( fixes #1056 )
...
rr[qtype:lower()] can be nil. I think this happens if the type does not
have a parser.
Also see #819 #976
8 years ago
Kim Alvefur
accf9f8c1a
net.dns: Also cache records from the 'additional' section
...
Could be getting A/AAAA records here when asking for SRV
8 years ago