67 Commits

Author SHA1 Message Date
HoneyryderChuck
7f34a62b82 promoting native/system/https resolver classes into options
so that those can be extended in plugins
2025-09-01 10:21:23 +01:00
HoneyryderChuck
f9ae15379a promoting http1 and http2 connection classes into options
this makes them extendable like other plugin classes, and the h2c plugin is rewritten to accomodate that requirement
2025-09-01 10:21:23 +01:00
HoneyryderChuck
3a417a4623 added :debug_redact option
when true, text passed to log messages considered sensitive (wrapped in a +#log_redact+ call) will be logged as "[REDACTED}"
2025-05-13 16:21:06 +01:00
HoneyryderChuck
180d3b0e59 adding option, which automatically closes sessions on fork
only for ruby 3.1 or higher. adapted from a similar feature from the connection_pool gem
2025-04-04 00:22:05 +01:00
HoneyryderChuck
17003840d3 adding support for ruby 3.4 2025-01-02 23:38:51 +00:00
HoneyryderChuck
5223d51475 setting the connection pool locally to the session
allowing it to be plugin extended via pool_class and PoolMethods
2024-11-19 12:55:44 +00:00
HoneyryderChuck
8b2ee0b466 remove form, json, ,xml and body from the Options class
Options become a bunch of session and connection level parameters, and requests do not need to maintain a separate Options object when they contain a body anymore, instead, objects is shared with the session, while request-only parameters get passed downwards to the request and its body. This reduces allocations of Options, currently the heaviest object to manage.
2024-06-11 18:23:45 +01:00
Earlopain
91fba0a971 Fix initial headers always being an instance of the default header class 2024-02-02 16:24:54 +00:00
Earlopain
7dd06c5e87
Fix error message when options method itself raises MethodError
This would previously say that the option was unknown
2024-01-18 12:37:02 +01:00
HoneyryderChuck
4809e1d0d0 Merge branch 'options-improvements' into 'master'
adding new Options#merge implementation

See merge request os85/httpx!297
2023-11-29 17:17:12 +00:00
HoneyryderChuck
1c7881eda3 Options#== improvement: bailout early when there's mismatch of ivars 2023-11-19 22:37:20 +00:00
HoneyryderChuck
5be39fe60e moar options merge tests 2023-11-19 22:37:20 +00:00
HoneyryderChuck
100394b29c adding :close_handshake_timeout timeout option
used to monitor readiness of connection to write the last goaway frame from HTTP/2
2023-11-15 10:37:37 +00:00
HoneyryderChuck
e4facd9b7a defaulting max requests to infinity
this limit wasn't doing any favours to anyone, particularly during benchmmarks
2023-10-24 22:53:22 +01:00
HoneyryderChuck
bdc9478aa8 do not use INFINITY for timeouts
it isn't a valid input for IO#wait family of functions; instead, use nil
2023-10-24 22:53:22 +01:00
HoneyryderChuck
0d58408c58 compression plugins for gzip and deflate supported by default
most of the code was moved to the transcoder layer.

The `compression_threshold_size` option has been removed.

The `:compression/brotli` plugin becomes only ´:brotli`, and depends on
the new transcoding APIs.

options to skip compression and decompression were added.
2023-09-20 17:57:41 +01:00
HoneyryderChuck
a9cb0a69a2 seting :read_timeout and :write_timeout by default 2023-09-20 17:57:41 +01:00
HoneyryderChuck
8cd1aac99c remove deprecated APIs 2023-09-20 17:57:39 +01:00
HoneyryderChuck
134bef69e0 removed overrides and refinements of methods prior to 2.7 2023-09-20 17:57:05 +01:00
HoneyryderChuck
8105e1128e introduce :buffer_size option
this allows to tweak connection buffer sizes, which may help optimizing
memory usage, and in this case, test the resumable retries.

wip
2023-04-17 18:09:24 +03:00
HoneyryderChuck
c70209db4b added xml transcoder
capabilities to encod/decode xml, expects nokogiri.
2022-08-13 15:42:46 +01:00
HoneyryderChuck
71cb66e287 added missing options sig 2022-08-07 14:43:29 +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
06b162b6ea applying a resolver manager to hold the different family type resolvers for the pool. This allows to have multiple resolvers per type, i.e. IPv6 and IPv4 2022-01-16 22:54:56 +02:00
HoneyryderChuck
d350bebe81 integrating .sum and .filter_map + backports 2021-09-04 15:25:14 +01:00
HoneyryderChuck
c95e926886 auto-corrected the easy ones first 2021-09-03 12:24:18 +01:00
HoneyryderChuck
c8276f94f4 added tests for options to track allocation optimizations 2021-08-04 13:48:11 +01:00
HoneyryderChuck
1a7025941b allow any option which can be merged, to be merged. This is a semi-breaking change, as some hash-like options will expanded instead of replaced, like the resolver options, but that was unspecified before, no guaarantees 2021-07-15 15:53:15 +01: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
b569cc9984 adding the settings timeout as an option, as well as a specific error 2021-05-30 00:53:37 +01:00
HoneyryderChuck
bf0ec99794 removed the timeout class 2021-04-08 17:34:19 +01:00
HoneyryderChuck
c5b191d4e1 Options: allow to call def_option with a string
One can pass the body to be class_eval'ed, making the option not depend
on define_method.
2021-04-08 15:34:10 +01:00
HoneyryderChuck
261dc9af30 raise an HTTPX::Error when passed an unknown option
before, a random NoMethodError was being raised. now, an helpful message
and an HTTPX error people might be rescuing will be raised.
2021-04-07 10:05:50 +01:00
HoneyryderChuck
9363d09af8 removed with_ methods from option (not of real world use)
removed with_ options, which are unsupported, undocumented and irrelevant (contrary to the similar with session methods)
2021-03-23 16:30:45 +00:00
HoneyryderChuck
0fb343056d introducing :addresses option
(This deprecates the :transport_options option)

This should be given an array of peer addresses to connect to. It can be
used when the destination IPs are known and you want to avoid resolving
them, and when the destination is a unix socket (and the destination is
a FS path)
2021-03-08 12:46:20 +00:00
HoneyryderChuck
a733e7da6d removing option from plugin from mainline (not even used anymore) 2020-04-05 04:26:43 +01:00
HoneyryderChuck
70bf2a0e5a new option: :max_requests
This is the max number of requests that can go on a connection. By
default, it'll be 100 for HTTP/1, and whatever the peer advertises as
MAX_CONCURRENT_STREAMS in HTTP/2 (usually 100).

If one would like to disable and reuse the socket beyond the advertised
number (sometimes the servers allow this), you can set this to
Float::INFINITY
2020-03-14 23:59:04 +00:00
HoneyryderChuck
d5bd1c7249 do not set concurrent requests at the options level, instead define it depending of the protocol 2020-03-14 22:35:32 +00:00
HoneyryderChuck
2e64db8a99 changed the way that options are attributed: use attribute=; this means that the setters defined in def_option will actually work this time 2020-03-10 18:58:31 +00:00
HoneyryderChuck
c1d8b30d08 this test always fails when debug mode is on 2019-09-27 12:39:07 +01:00
HoneyryderChuck
2da56ce9af fix: keep connection alive if HTTP/1.1 and there is connection-related
header;

this was wrongly closing connections for HTTP/1.1 connections which
didn't send a "Connection" header; according to spec, the default is
"Keep-Alive", contrary to HTTP/1.0
2019-05-15 14:45:06 +00:00
HoneyryderChuck
698050363a refactored h2c to use the connection methods; moving options around match?, as they'll be crucial to reimplement in plugins 2019-04-29 15:04:00 +00:00
HoneyryderChuck
622188c0ab updated rubocop, added a few changes... 2018-12-28 02:44:43 +00:00
HoneyryderChuck
dcd2709e41 Non-Blocking DNS 2018-08-29 10:23:08 +00:00
HoneyryderChuck
daa843504c Merge branch 'unixsock' into 'master'
Unixsock

Closes #24

See merge request honeyryderchuck/httpx!20
2018-06-07 11:34:27 +00:00
HoneyryderChuck
a54fab5998 remove traces of the retries parameter, which wasn't being used anyway 2018-06-06 17:48:44 +01:00
HoneyryderChuck
b7e875a761 rubocoped this 2018-05-28 10:00:54 +01:00
HoneyryderChuck
5b4c465c72 allow to pass transport type (tcp, ssl, unix)and a transport options 2018-05-25 15:55:41 +01:00
HoneyryderChuck
2b1ab8b6b6 rubocop auto-corrections according to some basic rules for now 2018-01-28 22:33:41 +00:00
HoneyryderChuck
c4811c01f8 added support for rubies between 2.1 and 2.5 (polyfills) 2018-01-28 20:13:04 +00:00