aboutsummaryrefslogtreecommitdiffstats
path: root/net
Commit message (Collapse)AuthorAgeFilesLines
* net.server_select: Fix traceback (thanks eta)Kim Alvefur2020-08-231-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.http.parser: Fix indentationKim Alvefur2020-08-201-2/+2
| | | | | Probably due to a rebase/merge with a merge tool that ignores whitespace. Happens all the time to me :(
* net.http.errors: Add new module for converting net.http errors to util.error ↵Matthew Wild2020-08-131-0/+115
| | | | objects
* net.http.parser: Allow specifying sink for large request bodiesKim Alvefur2020-08-011-4/+22
| | | | | | | This enables uses such as saving uploaded files directly to a file on disk or streaming parsing of payloads. See #726
* net.http.parser: Switch to util.dbuffer for buffering incoming dataKim Alvefur2020-08-011-61/+49
| | | | | | This is primarily a step towards saving uploads directly to files, tho this should hopefully be more efficient than collapsing the entire buffer to a single string every now and then.
* Merge 0.11->trunkMatthew Wild2020-08-081-0/+12
|\
| * net.http: Add request:cancel() methodMatthew Wild2020-08-081-0/+11
| | | | | | | | | | | | | | | | | | | | This is a new API that should be used in preference to http.destroy_request() when possible, as it ensures the callback is always called (with an error of course). APIs that have edge-cases where they don't call callbacks have, from experience, shown to be difficult to work with and often lead to unintentional leaks when the callback was expected to free up certain resources.
| * net.http: Re-expose destroy_request() functionMatthew Wild2020-08-081-0/+1
| | | | | | | | | | This was accidentally turned private in 647adfd8f738 as part of refactoring for Lua 5.2+.
* | net.server_epoll: Log debug message when a connection errors on readKim Alvefur2020-07-251-0/+5
| | | | | | | | | | | | It's confusingly quiet otherwise, even with maximum verboseness. Thanks perflyst
* | Merge 0.11->trunkMatthew Wild2020-07-101-1/+2
|\|
| * net.resolvers.basic: Default conn_type to 'tcp' consistently if unspecified ↵Matthew Wild2020-07-101-1/+2
| | | | | | | | | | | | (thanks marc0s) Fixes a traceback when passed an IP address with no conn_type.
* | net.cqueues: Fix resuming after timeoutsKim Alvefur2020-07-081-0/+14
| | | | | | | | | | | | | | net.cqueues previously relied on timers instead of fd events sometimes. Under net.server_select, it would have called cq:loop() on every iteration of the main loop, which was probably not optimal.
* | net.cqueues: Switch to server.watchfd for main loop integrationKim Alvefur2020-07-081-46/+2
| | | | | | | | | | | | | | Why? Just look at all that code deleted! watchfd is the prefered way to poll things that expose FDs for this purpose, altho it was added after net.cqueues.
* | Merge 0.11->trunkMatthew Wild2020-07-071-2/+3
|\|
| * net.http: Fix traceback on invalid URL passed to request()Matthew Wild2020-07-071-2/+3
| |
* | net.server_epoll: Add setting for turning off callback protectionsKim Alvefur2020-06-301-0/+6
| | | | | | | | | | Might improve (CPU) performance at the risk of triggering top level errors.
* | net.server_epoll: Allow setting a custom error handler for listenerKim Alvefur2020-06-301-1/+2
| | | | | | | | This lets plugins handle errors in some custom way, should they wish to.
* | net.server_epoll: ... and include a tracebackKim Alvefur2020-06-301-1/+1
| |
* | net.server_epoll: Report errors in timersKim Alvefur2020-06-301-0/+2
| |
* | net.server_epoll: Expose way to turn monotonic time into wall clock timeKim Alvefur2020-06-301-0/+3
| |
* | net.server_epoll: Optimize away table allocation for timer objectsKim Alvefur2020-06-291-15/+21
| |
* | net.server_epoll: Remove unused time field from timer objectsKim Alvefur2020-06-291-6/+3
| | | | | | | | Unused since the move to util.indexedbheap in c8c3f2eba898
* | net.server_epoll: Signal API-compatibilty with util.timerKim Alvefur2020-06-291-0/+6
| | | | | | | | | | Reduces the overhead of having both util.timer and the timer handling here, since they are very similar and now API-compatible.
* | net.server_epoll: Make API-compatible with util.timerKim Alvefur2020-06-291-3/+3
| |
* | net.dns: Disable jitter for default resolver (used by blocking dns.lookup() ↵Matthew Wild2020-06-281-0/+1
| | | | | | | | | | | | calls) This fixes 'prosodyctl check dns' being slow.
* | util.dependencies: Tone down lua-unbound dependency for nowKim Alvefur2020-06-271-1/+2
| | | | | | | | | | | | At least until packages are available Wording from MattJ
* | net.resolvers: Remove FIXMEs obsoleted by switch to libunboundKim Alvefur2020-06-252-5/+0
| |
* | net.unbound: Remove compat for missing promises (pre-0.11)Kim Alvefur2020-06-251-15/+12
| | | | | | | | | | Code existed in a separate project before merged into Prosody, so util.promise was not always around.
* | net.unbound: Strip support for legacy net.server APIsKim Alvefur2020-06-251-37/+3
| | | | | | | | | | These are not needed since the watchfd API is provided by all net.server backends.
* | net.adns: Log a warning if loaded (because net.unbound wasn't)Kim Alvefur2020-06-251-0/+2
| |
* | net.unbound: Async DNS resolver library based on libunbound via luaunboundKim Alvefur2019-03-091-0/+245
| |
* | net.dns: Reduce default timeout to 5sMatthew Wild2020-06-251-1/+1
| | | | | | | | | | Most healthy queries will return well within this time, and the new retry logic should help spread the cost of additional retries.
* | net.dns: Increase backoff delaysMatthew Wild2020-06-251-1/+1
| | | | | | | | Not entirely happy with the overall logic here.
* | net.dns: Add jitter to spread queries and reduce failures due to congestionMatthew Wild2020-06-251-2/+20
| |
* | net.dns: Fix timeout retry logicMatthew Wild2020-06-251-16/+21
| | | | | | | | | | | | | | On timeout the query would be resent twice - once within servfail(), and again inside the timeout callback. This commit moves all retry logic to servfail().
* | net.dns: Add some debug loggingMatthew Wild2020-06-251-0/+4
| |
* | Merge 0.11->trunkKim Alvefur2020-06-231-1/+2
|\|
| * net.http.server: Fix reporting of missing Host headerKim Alvefur2020-06-231-1/+2
| | | | | | | | | | The "Missing or invalid 'Host' header" case was dead code previously because `host` was always at least an empty string.
| * net.http.server: Strip port from Host header in IPv6 friendly way (fix #1302)Kim Alvefur2020-06-231-1/+1
| | | | | | | | | | E.g. given `[::1]:5280` it would previously result in only `[` instead of the correct `[::1]`
* | net.connect: Remove TODO about use_ipv4/6 done in 3bfb20be844cKim Alvefur2020-06-222-2/+0
| |
* | net.server_epoll: Add way to start accepting clients on an arbitrary server ↵Kim Alvefur2020-06-011-4/+9
| | | | | | | | | | | | socket This adds an escape hatch where things like UNIX sockets can be added.
* | net.server_epoll: Handle missing ports from getsock/peername (as in the case ↵Matthew Wild2020-06-011-2/+2
| | | | | | | | of unix sockets)
* | net.server: Switch to epoll backend by defaultMatthew Wild2020-06-011-1/+5
| | | | | | | | (if util.poll is found)
* | net.server_select: Pass conn/handler to readbuffer/sendbufferMatthew Wild2020-06-011-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 onincomingMatthew Wild2020-06-011-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_epoll: Fix typo in internal method nameKim Alvefur2020-05-221-5/+5
| |
* | net.server_epoll: Log some noise before TLS handshake stepKim Alvefur2020-05-221-0/+1
| | | | | | | | | | This would help pinpoint if a crash happens during the handshake, which has occurred a few times, e.g. like https://github.com/brunoos/luasec/issues/75
* | net.http: Return a Promise if no callback is givenKim Alvefur2020-05-061-1/+17
| |
* | Merge 0.11->trunkKim Alvefur2020-04-261-1/+1
|\|
| * net.server_epoll: Fix indentationKim Alvefur2020-03-111-3/+3
| | | | | | | | | | | | Some lines seem to have gotten the wrong indentation, possibly caused by Meld which often ignores lines with only whitespace changes and leaves their previous indentation.