38 Commits

Author SHA1 Message Date
HoneyryderChuck
adeb3ded50 cover other modules in plugin tests 2025-09-04 09:37:09 +01:00
HoneyryderChuck
f0329cf653 plugin init fixes: enforce usage of Options or hash for the second argument; ensure that plugin only continues loading if it is a module or converts to one 2025-08-24 01:26:24 +01:00
HoneyryderChuck
1241586eb4 introducing subplugins to plugins
subplugins are modules of plugins which register as post-plugins of other plugins

a specific plugin may want to have a side-effect on the functionality of another plugin, so they can use this to register it when the other plugin is loaded
2025-04-04 09:25:53 +01:00
HoneyryderChuck
79d5d16c1b moving session with pool test plugin to override on the session and drop pool changes 2024-11-19 12:55:44 +00:00
HoneyryderChuck
19f46574cb reduce payload size in timeout test 2024-05-14 15:04:10 +01:00
HoneyryderChuck
086e6bc970 added tests for altenative/multiple requests APIs 2023-12-05 00:34:56 +00:00
HoneyryderChuck
9465a077b1 Add Response#peer_address and ErrorResponse#peer_address
responses can now expose the IP address used to connect to the peer
server to fetch the response from.
2023-10-30 09:52:30 +00:00
HoneyryderChuck
8bd4dc1fbd fix timers overhead causing spurious wakeups on the select loop
the change to read/write cancellation-driven timeouts as the default
timeout strategy revealed a performance regression; because these were
built on Timers, which never got unsubscribed, this meant that they were
kept beyond the duration of the request they were created for, and
needlessly got picked up for the next timeout tick.

This was fixed by adding a callback on timer intervals, which
unsubscribes them from the timer group when called; these would then be
activated after the timeout is not needed anymore (request send /
response received), thereby removing the overhead on subsequent
requests.

An additional intervals array is also kept in the connection itself;
timeouts from timers are signalled via socket wait calls, however they
were always resulting in timeouts, even when they shouldn't (ex: expect
timeout and send full response payload as a result), and with the wrong
exception class in some cases. By keeping intervals from its requests
around, and monitoring whether there are relevant request triggers, the
connection can therefore handle a timeout or bail out (so that timers
can fire the correct callback).
2023-10-24 22:53:22 +01:00
HoneyryderChuck
6baca35422 support has been removed 2023-09-20 17:57:41 +01:00
HoneyryderChuck
477c3601fc eliminated blocks testing for ruby < 2.7 2023-09-20 17:57:05 +01:00
HoneyryderChuck
092e594a4b Request.verb is now an upcased string (ex: "GET")
The reference for a request verb is now the string which is used
everywhere else, instead of the symbol corresponding to it. This was an
artifact from the import from httprb, and there is no advantage in it,
since these strings are frozen in most use cases, and the
transformations from symbol to strings being performed everywhere are
prooof that keeping the atom isn't really bringing any benefit.
2023-04-17 16:54:31 +03:00
HoneyryderChuck
71cb66e287 added missing options sig 2022-08-07 14:43:29 +01:00
HoneyryderChuck
3f9c165d51 added request_timeout 2022-08-06 23:20:21 +01:00
HoneyryderChuck
452657c805 Added the read_timeout and write_timeout timeouts
These are deadline oriented for the request and response, i.e. a write
timeout tracks the full time it takes to write the request, whereas the
read timeout does the same for receiving the response.

For back-compat, they're infinite by default. v1 may change that, and
will have to provide a safe fallback for endless "stream" requests and
responses.
2022-08-06 22:30:46 +01:00
HoneyryderChuck
ee49d7452c added tests for read and write timeout 2022-08-06 22:30:46 +01:00
HoneyryderChuck
e9a81d6b16 enabled h2 tests which were blocked for jruby 2022-03-05 17:33:37 +00:00
HoneyryderChuck
5c2ad6b588 allow definition of options via OptionsMethods module; using .extra_options for setting defaults 2021-07-13 19:56:59 +01:00
HoneyryderChuck
1cf6e5aac7 new option: origin
by setting the origin, one can pass relative paths to httpx, which will
be appended when building the request.
2021-05-04 20:09:50 +01:00
HoneyryderChuck
00faafddc9 added tests around the tcp connect errors 2021-03-11 17:58:24 +00:00
HoneyryderChuck
fab44b5993 verifyig error responses annd deltas using internal methods 2021-01-05 18:57:39 +00:00
HoneyryderChuck
bb310dc106 making the connection ping when keep alive timeout is exceeded; this way if the connection is still available, it's reused 2020-05-03 16:28:58 +01:00
HoneyryderChuck
f6475009fe now that the timer interval is used in the selector, make sure that timeouts from selecting are properly reflected as total timeouts when they are 2020-04-12 03:32:04 +01:00
HoneyryderChuck
fef2d78382 show what happened if not the timeout 2020-04-05 04:26:43 +01:00
HoneyryderChuck
bc65c44e21 do not run keep alive test for ruby < 2.3, as our HTTP/1 server does not support keep alive 2020-03-30 02:31:22 +01:00
HoneyryderChuck
36134dd826 added test for keep alive timeout 2020-03-30 01:13:58 +01:00
HoneyryderChuck
adc0e71c7f commenting connect timeout test (not there yet) 2020-03-15 02:18:24 +00:00
HoneyryderChuck
89fde80f10 reenabled timeout tests again 2020-03-14 22:42:02 +00:00
HoneyryderChuck
108d9257c8 added support for HTTP#with_ methods
these will reapply options accordingly (i.e. HTTPX.with_headers(...)).

Because we now have these, HTTPX.headers and HTTPX.timeout have been
deprecated.
2020-03-10 18:58:31 +00:00
HoneyryderChuck
731db5691b moving resolver tests to the mainline requests 2020-02-02 09:41:30 +01:00
HoneyryderChuck
07c22470a9 added regression test for the reported failure 2020-01-26 20:39:34 +00:00
HoneyryderChuck
ae3cbac91d disabling connect timeout for CI 2020-01-12 21:42:12 +00:00
HoneyryderChuck
4dd40464f6 connect error: give time to the server to boot up, just in case 2020-01-11 13:24:39 +00:00
HoneyryderChuck
e4e04e9fe8 setting the connect timeout port as envvar 2020-01-11 13:19:21 +00:00
HoneyryderChuck
066ff44762 moved timeout tests to the session, as they are not supposed to be differentiated in http/https terms 2019-12-31 01:57:00 +00:00
HoneyryderChuck
ae859f743f request exposes options: this allows responses to be created with the proper set of options, instead of the connection options, which is wrong 2019-05-06 11:56:11 +00:00
HoneyryderChuck
ce9f55c96e pool: allowing it to load more than one resolver per pool, depending on connection conditions; still reusing it whenever possible (right now, per type, which is still wrong, if we want to connect, let's say, to more than a different DNS server with the same type) 2019-04-27 15:51:37 +00:00
HoneyryderChuck
c1c0c536eb Client -> Session (signal this as deprecation, as this is public API 2019-03-16 16:32:33 +00:00
HoneyryderChuck
05543d12f6 not a TODO anymore 2019-03-16 16:24:44 +00:00