aboutsummaryrefslogtreecommitdiffstats
path: root/net
Commit message (Collapse)AuthorAgeFilesLines
* net.unbound: Show canonical name in textual format (e.g. in shell)Kim Alvefur2024-04-141-1/+5
| | | | | | | libunbound does not tell us the whole chain of CNAMEs, only the final canonical name. This is to aid in debugging since it will only be shown in the shell.
* net.server: Restore epoll signalfd handlingKim Alvefur2024-03-021-5/+0
| | | | Reverts 4a9a69659727
* net.server: Disable epoll signalfd handling by default until problems resolvedKim Alvefur2024-03-011-0/+5
|
* net.server_epoll: Log creation of signalfd handles at noise levelKim Alvefur2024-03-011-0/+1
| | | | To aid in tracking down signalfd-related problems
* net.server_epoll: Log failure to hook signalsKim Alvefur2024-02-281-1/+6
| | | | To make any such failures noticeable
* Merge 0.12->trunkKim Alvefur2024-02-271-1/+1
|\
| * net.http.files: Validate argument to setup functionKim Alvefur2024-02-271-1/+1
| | | | | | | | Fixes error in #1765 by throwing an error earlier
* | util.signal: Wrap signalfd in an userdatum for gc handling etcKim Alvefur2024-02-241-1/+2
| |
* | net.server_epoll: Support hooking signals via signalfdKim Alvefur2024-02-241-0/+15
| | | | | | | | | | | | Handling signal events the same way as all other events makes sense and seems safer than the signal handling just jumping around in C and messing with Lua states.
* | net.server_epoll: Prevent traceback when checking TLS after connection goneKim Alvefur2024-01-211-0/+5
| | | | | | | | Unclear why this would be done, but an error is not great.
* | net.http.server: Fix whitespace-ignoring syntaxKim Alvefur2023-12-011-2/+2
| |
* | Merge 0.12->trunkKim Alvefur2023-12-011-1/+7
|\|
| * net.http.parser: Reject overlarge header section earlierKim Alvefur2023-08-231-1/+7
| | | | | | | | This case would eventually be rejected by the buffer size limit.
* | net.http.server: Complete async waiter for non-persistent connectionsKim Alvefur2023-11-241-3/+2
| | | | | | | | | | | | | | | | | | Otherwise requests with Connection: close would be stuck in the async wait that starts after the handle_request() call. Together with the new async debugging, this makes the async thread stay in the set of waiting runners forever, where previously it would simply be garbage collected.
* | net.server_epoll: Avoid call to update socket watch flags when nothing changedKim Alvefur2023-11-211-0/+3
| | | | | | | | Should skip a syscall for each write when using epoll.
* | net.http: Set Connection header based on connection pool usageKim Alvefur2023-11-111-1/+8
| | | | | | | | Connection: keep-alive is implicit in HTTP/1.1 but explicit > implicit
* | net.http: Add simple connection poolingKim Alvefur2023-11-111-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This should speed up repeated requests to the same site by keeping their connections around and sending more requests on them. Sending multiple requests at the same time is not supported, instead a request started while another to the same authority is in progress would open a new one and the first one to complete would go back in the pool. This could be investigated in the future. Some http servers limit the number of requests per connection and this is not tested and could cause one request to fail, but hopefully it will close the connection and prevent it from being reused.
* | net.http.server: Fix typo in previous commitKim Alvefur2023-09-231-1/+1
| |
* | net.http.server: Support setting Content-Type of uncaught HTTP errorsKim Alvefur2023-09-221-1/+6
| | | | | | | | | | | | | | | | mod_http_errors normally sets the Content-Type header via the response object, which isn't available when handling these uncaught errors. Without a Content-Type header the browser is forced to guess, which may or may not result in something sensible.
* | net.websocket.frames: Remove completed TODOKim Alvefur2023-07-291-1/+0
| | | | | | | | The XOR is done in C since 4e5a2af9dd19
* | net.server: Handle loading from outside Prosody (e.g. Verse)Kim Alvefur2023-05-201-15/+20
| | | | | | | | | | server_select only depending on LuaSocket generally makes it more portable, so fall back to that if util.poll can't be found.
* | net.http.server: Return request ID in header to aid debuggingKim Alvefur2023-05-291-1/+1
| | | | | | | | Eases locating the request in logs
* | net.tls_luasec: Expose method for loading a certificateKim Alvefur2023-05-271-0/+1
| | | | | | | | | | Further isolates LuaSec from Prosody core, with the ultimate goal of allowing LuaSec to be replaced more easily.
* | net.certmanager: Move LuaSec feature detection to net.tls_luasecKim Alvefur2023-05-271-0/+24
| | | | | | | | | | Further isolates LuaSec from Prosody core, with the ultimate goal of allowing LuaSec to be replaced more easily.
* | net.http.server: Remove "Firing event" logs, use event logging insteadKim Alvefur2023-05-141-4/+0
| | | | | | | | | | | | | | | | Since these are noisy and we have the thing in util.helpers to log events fired. The new status line events are meant to replace these as they include more useful info.
* | net.http.server: Log request and response status linesKim Alvefur2023-05-141-0/+3
| | | | | | | | Points out the beginning and end of a request.
* | net.http.server: Assign each request its own log sourceKim Alvefur2023-05-141-5/+8
| |
* | net.http.server: Assign an ID to each request, shared with responseKim Alvefur2023-05-141-0/+3
| | | | | | | | | | Goal is improve tracking of individual HTTP requests throughout its life-cycle. Having a single ID to use in logging should help here.
* | net: Prefix module imports with prosody namespaceKim Alvefur2023-03-1720-108/+108
| |
* | Merge 0.12->trunkMatthew Wild2023-02-171-2/+3
|\|
| * net.http.parser: Fix off-by-one error in chunk parserMatthew Wild2023-02-171-2/+3
| |
* | Merge 0.12->trunkMatthew Wild2023-02-161-0/+4
|\|
| * net.http.server: Add new API to get HTTP request from a connectionMatthew Wild2023-02-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | This information is sometimes necessary in the context where we have a connection that we know (or believe to be) associated with an incoming HTTP request. For example, it can be used to retrieve the IP address of a request (which may differ from the IP address of the connection, due to X-Forwarded-For and co). Thanks to the Jitsi team for highlighting this gap in the API.
* | Merge 0.12->trunkMatthew Wild2023-02-092-7/+12
|\|
| * net.http.parser: Improve handling of responses without content-lengthMatthew Wild2023-02-091-6/+11
| | | | | | | | | | | | This ensures that we support responses without a content-length header, and allow streaming them through the streaming handler interface. An example of such a response would be Server-Sent Events streams.
| * net.http: Add missing log parameterMatthew Wild2023-02-091-1/+1
| |
* | net.http.server: Close file handle earlierKim Alvefur2023-01-081-1/+1
| | | | | | | | | | Frees unneeded resources earlier, so they're not held on to while potentially sending the chunk trailer.
* | Merge 0.12->trunkKim Alvefur2023-01-081-1/+1
|\|
| * net.http.server: Fix #1789Kim Alvefur2023-01-081-1/+1
| | | | | | | | | | | | | | | | | | Unregistering the response before sending the trailer of the chunked transfer encoding prevents opportunistic writes from being invoked and running this code again when, which may cause an error when closing the file handle a second time. Normally the file size is known, so no chuck headers are sent.
* | net.server_epoll: Remove delay on last main loop iteration when quittingKim Alvefur2023-01-061-7/+8
| | | | | | | | | | | | | | Main difference is that timers are not checked unconditionally before each poll, only when running out of previous poll results (hidden by util.poll). This removes a final poll at shutdown that usually delays the 'not quitting' condition check by one second.
* | net.server_epoll: Factor out single main loop step into its own functionKim Alvefur2023-01-061-1/+26
| | | | | | | | | | This isn't actually used in Prosody, so no value in complicating the real main loop because of it
* | net.resolvers.basic: Record hostname coming from secure SRV recordsKim Alvefur2022-12-221-0/+2
| | | | | | | | Will be useful even later...
* | net.resolvers.service: Record DNSSEC security status of SRV recordsKim Alvefur2022-12-221-0/+3
| | | | | | | | Will be useful later.
* | net.resolvers.service: Fix reporting of Bogus DNSSEC resultsKim Alvefur2022-12-211-3/+6
| | | | | | | | | | | | | | | | | | The order of checks led to Bogus results being reported with a generic "unable to resolve service". This had no practical effects as such results are simply empty and the process would stop there. Tested by attempting to establish s2s with dnssec-bogus.sg and observing the error reply.
* | Revert unintentionally committed parts of 12bd40b8e105Kim Alvefur2022-12-211-8/+3
| |
* | mod_c2s,mod_s2s: Adapt to XEP-xxxx: Stream Limits AdvertisementKim Alvefur2022-10-201-3/+8
| | | | | | | | Thanks MattJ
* | net.connect: Clear TODO for Happy Eyeballs / RFC 8305, close #1246Kim Alvefur2022-08-191-1/+0
| | | | | | | | Gotta have the DOAP references!
* | various: Update IETF RFC URLs for tools.ietf.org transitionKim Alvefur2022-08-051-2/+2
| | | | | | | | | | | | See https://www.ietf.org/blog/finalizing-ietf-tools-transition/ Already done in various other places.
* | net.resolvers.basic: Add opt-out argument for DNSSEC security statusKim Alvefur2022-08-021-3/+5
| | | | | | | | | | | | | | This makes explicit which lookups can accept an unsigned response. Insecure (unsigned, as before DNSSEC) A and AAAA records can be used as security would come from TLS, but an insecure TLSA record is worthless.
* | mod_saslauth: Implement RFC 9266 'tls-exporter' channel binding (#1760)Kim Alvefur2022-06-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Brings back SCRAM-SHA-*-PLUS from its hiatus brought on by the earlier channel binding method being undefined for TLS 1.3, and the increasing deployment of TLS 1.3. See 1bfd238e05ad and #1542 Requires future version of LuaSec, once support for this key material export method is merged. See https://github.com/brunoos/luasec/pull/187