Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | net.server: Fix multiple return values | Kim Alvefur | 2022-06-03 | 1 | -3/+6 |
| | | | | | | | return foo and foo() crops multiple return values to a single one, so any second return values etc were last, mostly error details. Introduced in 7e9ebdc75ce4 | ||||
* | net.server_select: Restore dependency on LuaSec to soft for tests | Kim Alvefur | 2022-04-27 | 1 | -3/+1 |
| | | | | | server_select is used in e.g. storagemanager tests, and some of the CI runners are lacking LuaSec, which resulted in failures. | ||||
* | net: refactor sslconfig to not depend on LuaSec | Jonas Schäfer | 2022-04-02 | 1 | -0/+6 |
| | | | | | | | | | | | This now requires that the network backend exposes a tls_builder function, which essentially wraps the former util.sslconfig.new() function, passing a factory to create the eventual SSL context. That allows a net.server backend to pick whatever it likes as SSL context factory, as long as it understands the config table passed by the SSL config builder. Heck, a backend could even mock and replace the entire SSL config builder API. | ||||
* | net: isolate LuaSec-specifics | Jonas Schäfer | 2022-04-27 | 1 | -3/+15 |
| | | | | | | | | | | | | | | For this, various accessor functions are now provided directly on the sockets, which reach down into the LuaSec implementation to obtain the information. While this may seem of little gain at first, it hides the implementation detail of the LuaSec+LuaSocket combination that the actual socket and the TLS layer are separate objects. The net gain here is that an alternative implementation does not have to emulate that specific implementation detail and "only" has to expose LuaSec-compatible data structures on the new functions. | ||||
* | net.server: Add a predrain callaback just before writes | Kim Alvefur | 2021-08-16 | 1 | -0/+5 |
| | | | | | | | | | | Allows sneaking in things in the write buffer just before it's sent to the network stack. For example ack requests, compression flushes or other things that make sense to send after stanzas or other things. This ensures any additional trailing data sent is included in the same write, and possibly the same TCP packet. Other methods used such as timers or nextTick might not have the same effect as it depends on scheduling. | ||||
* | net.server_select: Fix traceback (thanks eta) | Kim Alvefur | 2020-08-23 | 1 | -1/+1 |
| | | | | | | The `socket` here is unreferenced on disconnect. Calling :resume_writes after that causes an error when `addsocket()` tries to use it as a table index. | ||||
* | net.server_select: Pass conn/handler to readbuffer/sendbuffer | Matthew Wild | 2020-06-01 | 1 | -4/+4 |
| | | | | | | The internal implementations don't use it, but this causes onreadable and onwritable of watchfd to receive the conn as they do in other backends. | ||||
* | net.server_select: Ensure onconnect is always called before onincoming | Matthew Wild | 2020-06-01 | 1 | -9/+18 |
| | | | | | | | | | This changes the code to call onconnect when the first data is sucessfully read or written, instead of simply when the socket first becomes writable. A writable socket can mean a connection error, and if the client already sent some data it may get passed to onincoming before processing writable sockets. This fixes the issue. | ||||
* | net.server_select: Remove prefix added to TLS handshaker errors | Kim Alvefur | 2019-12-01 | 1 | -1/+1 |
| | | | | For consistency. None of the other implementations do this. | ||||
* | net.server: Handle server name (SNI) as extra argument | Kim Alvefur | 2019-09-01 | 1 | -0/+3 |
| | | | | | | Code added in 75d2874502c3, 9a905888b96c and adc0672b700e uses this field. See #409 and #1408 | ||||
* | net.server: Accept and save an 'extra' field for client connections | Kim Alvefur | 2019-09-01 | 1 | -5/+7 |
| | | | | | This lets code attach some extra data to be attached to client connections. | ||||
* | Fix various spelling mistakes [codespell] | Kim Alvefur | 2019-05-03 | 1 | -2/+2 |
| | |||||
* | net.server_select: Fix write pause/resume functions | Kim Alvefur | 2019-03-24 | 1 | -6/+4 |
| | | | | | | | Nothing would happen if the write buffer was empty. Also simplified the code because it took too long to understand what `if _sendlistlen ~= tmp then` did. | ||||
* | net.server: Only add alternate SNI contexts if at least one is provided | Kim Alvefur | 2019-03-11 | 1 | -1/+1 |
| | | | | Fixes use of <starttls/> when a client sends SNI, which would send no certificate otherwise. | ||||
* | net.server_select: SNI support (#409) | Kim Alvefur | 2019-03-10 | 1 | -0/+10 |
| | |||||
* | net.server: New API for creating server listeners | Kim Alvefur | 2018-09-13 | 1 | -8/+22 |
| | | | | server.listen(interface, port, listeners, options); | ||||
* | Merge 0.11->trunk | Kim Alvefur | 2018-11-18 | 1 | -1/+1 |
|\ | |||||
| * | net.server_select: Fix IP validation to use correct variable (thanks quest) | Kim Alvefur | 2018-11-17 | 1 | -1/+1 |
| | | | | | | | | Copy-paste mistake most likely. Not caught because server_select is ignored by luacheck. | ||||
* | | net.server: Add an API for holding writes of outgoing data | Kim Alvefur | 2018-10-25 | 1 | -12/+19 |
| | | |||||
* | | net.server_select: Still allow buffering outgoing data on write-locked ↵ | Kim Alvefur | 2018-10-28 | 1 | -4/+1 |
| | | | | | | | | connections | ||||
* | | net.server_select: Replace use of deprecated :lock_read in server.link | Kim Alvefur | 2018-10-28 | 1 | -2/+2 |
| | | |||||
* | | net.server_select: Deprecate :lock method | Kim Alvefur | 2018-10-28 | 1 | -0/+1 |
| | | | | | | | | Exists only in server_select and I found nothing using it | ||||
* | | server_select: Fix :lock method | Kim Alvefur | 2018-10-28 | 1 | -1/+1 |
| | | | | | | | | | | | | This always unlocks reading. I don't believe this is used anywhere. server_event does not implement this. | ||||
* | | net.server_select: Move code from :lock_read into :pause and :resume | Kim Alvefur | 2018-10-28 | 1 | -13/+15 |
| | | |||||
* | | net.server_select: Deprecate connection:lock_read() method | Kim Alvefur | 2018-10-28 | 1 | -1/+1 |
|/ | |||||
* | net.server: Swich method for connecting sockets with remotes | Kim Alvefur | 2018-10-12 | 1 | -1/+1 |
| | | | | | | | 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. | ||||
* | net.server: Remove socket constructor fallback | Kim Alvefur | 2018-10-12 | 1 | -1/+1 |
| | | | | Should no longer be needed | ||||
* | net.server: Require IP address as argument to addclient (no DNS names) | Kim Alvefur | 2018-10-11 | 1 | -7/+10 |
| | | | | The net.connect API should be used to resolve DNS names first | ||||
* | net.connect: Fix passing request table to new listener | Kim Alvefur | 2018-09-26 | 1 | -2/+2 |
| | | | | This could be a return value from ondetach | ||||
* | net.server: Call a 'onattach' callback when replacing listeners | Kim Alvefur | 2018-09-26 | 1 | -0/+3 |
| | |||||
* | net.server: Set default read timeout to 14 minutes (fixes #971) | Kim Alvefur | 2018-07-06 | 1 | -1/+1 |
| | |||||
* | net.server: Add watchfd, a simple API for watching file descriptors | Kim Alvefur | 2018-05-09 | 1 | -0/+43 |
| | |||||
* | net.server_select: Allow setquitting("once") to allow resuming the loop later | Matthew Wild | 2018-04-10 | 1 | -2/+2 |
| | |||||
* | Fix spelling throughout the codebase [codespell] | Kim Alvefur | 2018-02-04 | 1 | -3/+3 |
| | |||||
* | net.server_select: Better detection of errors for outgoing connections | Matthew Wild | 2018-02-23 | 1 | -6/+7 |
| | | | | | | | | | | | On connection failure, a socket is marked readable and writable. So to detect initial connection failures (connection refused, etc.) we now watch for sockets becoming readable during initial connection, and also read from readable sockets before writing to writable sockets. This should fix 'onconnect' being called for outgoing connections that actually failed. | ||||
* | Merge 0.10->trunk | Kim Alvefur | 2016-11-26 | 1 | -0/+1 |
|\ | |||||
| * | Merge 0.9->0.10 | Kim Alvefur | 2016-11-24 | 1 | -0/+1 |
| |\ | |||||
| | * | net.server_select: Prevent writes after a handler is closed (fixes #783 I hope) | Kim Alvefur | 2016-11-22 | 1 | -0/+1 |
| | | | |||||
| * | | net.server_select: remove unused import [luacheck] | Anton Shestakov | 2016-07-28 | 1 | -1/+0 |
| | | | |||||
* | | | Merge 0.10->trunk | Kim Alvefur | 2016-07-14 | 1 | -1/+1 |
|\| | | |||||
| * | | net.server_select: remove unused one-letter loop variable [luacheck] | Anton Shestakov | 2016-07-14 | 1 | -1/+1 |
| | | | |||||
* | | | Merge 0.10->trunk | Kim Alvefur | 2016-07-08 | 1 | -2/+2 |
|\| | | |||||
| * | | net.server_select: remove unused one-letter loop variables [luacheck] | Anton Shestakov | 2016-07-09 | 1 | -2/+2 |
| | | | |||||
| * | | net.server_select: Remove do-nothing os_difftime calls [backported from trunk] | daurnimator | 2015-01-19 | 1 | -5/+3 |
| | | | |||||
* | | | Merge 0.10->trunk | Kim Alvefur | 2016-01-22 | 1 | -1/+21 |
|\| | | |||||
| * | | Merge 0.9->0.10 | Kim Alvefur | 2016-01-22 | 1 | -0/+20 |
| |\| | |||||
| | * | server_select: Add logging of when servers are paused and resumed | Kim Alvefur | 2016-01-22 | 1 | -0/+2 |
| | | | |||||
| | * | server_select: Pause and mark server as full if accepting a client fails ↵ | Kim Alvefur | 2016-01-22 | 1 | -0/+2 |
| | | | | | | | | | | | | (fixes #597) | ||||
| | * | server_select: Retry accepting clients from full servers after 10s (matches ↵ | Kim Alvefur | 2016-01-22 | 1 | -0/+11 |
| | | | | | | | | | | | | libevent behaviour) | ||||
| | * | server_select: Keep track of which server listeners are full | Kim Alvefur | 2016-01-22 | 1 | -0/+5 |
| | | |