2851 Commits

Author SHA1 Message Date
HoneyryderChuck
3ff10f142a replace h2 upgrade peer with a custom implementation
the remote one has been failing for some time
2025-06-09 22:56:30 +01:00
HoneyryderChuck
51ce9d10a4 bump version to 1.5.1 v1.5.1 2025-06-09 09:04:05 +01:00
HoneyryderChuck
6bde11b09c Merge branch 'gh-92' into 'master'
don't bookkeep retry attempts when errors happen on just-checked-out open connections

See merge request os85/httpx!394
2025-05-28 17:54:03 +00:00
HoneyryderChuck
0c2808fa25 prevent needless closing loop when process is interrupted during DNS request
the native resolver needs to be unselected. it was already, but it was taken into account still for bookkeeping. this removes it from the list by eliminating closed selectables from the list (which were probably already removed from the list via callback)

Closes https://github.com/HoneyryderChuck/httpx/issues/91
2025-05-28 15:26:11 +01:00
HoneyryderChuck
cb78091e03 don't bookkeep retry attempts when errors happen on just-checked-out open connections
in case of multiple connections to the same server, where the server may have closed all of them at the same time, a request will fail after checkout multiple times, before starting a new one where the request may succeed. this patch allows the prior attempts not to exhaust the number of possible retries on the request

it does so by marking the request as ping when the connection it's being sent to is marked as inactive; this leverages the logic of gating retries bookkeeping in such a case

Closes https://github.com/HoneyryderChuck/httpx/issues/92
2025-05-28 15:25:50 +01:00
HoneyryderChuck
6fa69ba475 Merge branch 'duplicate-method-def' into 'master'
Fix duplicate `option_pool_options` method

See merge request os85/httpx!393
2025-05-21 15:30:34 +00:00
Earlopain
4a78e78d32
Fix duplicate option_pool_options method
> /usr/local/bundle/bundler/gems/httpx-0e393987d027/lib/httpx/options.rb:237: warning: method redefined; discarding old option_pool_options (StandardError)
> /usr/local/bundle/bundler/gems/httpx-0e393987d027/lib/httpx/options.rb:221: warning: previous definition of option_pool_options was here
2025-05-21 12:49:54 +02:00
HoneyryderChuck
0e393987d0 bump version to 1.5.0 v1.5.0 2025-05-16 14:04:08 +01:00
HoneyryderChuck
12483fa7c8 missing ivar sigs in tcp class 2025-05-16 11:15:28 +01:00
HoneyryderChuck
d955ba616a deselect idle connections on session termination
session may be interrupted earlier than the connection has finished
the handshake; in such a case, simulate early termination.

Closes https://github.com/HoneyryderChuck/httpx/issues/91
2025-05-15 00:31:15 +01:00
HoneyryderChuck
804d5b878b Merge branch 'debug-redact' into 'master'
added :debug_redact option

See merge request os85/httpx!387
2025-05-14 23:01:28 +00:00
HoneyryderChuck
75702165fd remove ping check when querying for repeatable request status
this should be dependent on the exception only, as connections may have closed before ping was released

this addresses https://github.com/HoneyryderChuck/httpx/issues/87\#issuecomment-2866564479
2025-05-14 23:52:18 +01:00
HoneyryderChuck
120bbad126 clear write buffer on connect errors
leaving bytes around messes up the termination handshake and may raise other unwanted errors
2025-05-13 16:21:06 +01:00
HoneyryderChuck
35446e9fe1 fixes for connection coalescing flow
the whole "found connection not open" branch was removed, as currently,
a mergeable connection must not be closed; this means that only
open/inactive connections will be picked up from selector/pool, as
they're the only coalescable connections (have addresses/ssl cert
state). this may be extended to support closed connections though, as
remaining ssl/addresses are enough to make it coalescable at that point,
and then it's just a matter of idling it, so it'll be simpler than it is
today.

coalesced connection gets closed via Connection#terminate at the end
now, in order to propagate whether it was a cloned connection.

added log messages in order to monitor coalescing handshake from logs.
2025-05-13 16:21:06 +01:00
HoneyryderChuck
3ed41ef2bf pool: do not decrement conn counter when returning existing connection, nor increment it when acquiring
this variable is supposed to monitor new connections being created or dropped, existing connection management shouldn't affect it
2025-05-13 16:21:06 +01:00
HoneyryderChuck
9ffbceff87 rename Connection#coalesced_connection=(conn) to Connection.coalesce!(conn) 2025-05-13 16:21:06 +01:00
HoneyryderChuck
757c9ae32c making tcp state transition logs less ambiguous
also show transition states in connected
2025-05-13 16:21:06 +01:00
HoneyryderChuck
5d88ccedf9 redact ping payload as well 2025-05-13 16:21:06 +01:00
HoneyryderChuck
85808b6569 adding logs to select-on-socket phase 2025-05-13 16:21:06 +01:00
HoneyryderChuck
d5483a4264 reconnectable errors: include HTTP/2 parser errors and opnessl errors 2025-05-13 16:21:06 +01:00
HoneyryderChuck
540430c00e assert for request in a faraday test (sometimes this is nil, for some reason) 2025-05-13 16:21:06 +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
35c18a1b9b options: meta prog integer options into the same definition 2025-05-13 16:20:28 +01:00
HoneyryderChuck
cf19fe5221 Merge branch 'improv' into 'master'
sig improvements

See merge request os85/httpx!390
2025-05-13 15:18:50 +00:00
HoneyryderChuck
f9c2fc469a options: freeze more ivars by default 2025-05-13 15:52:57 +01:00
HoneyryderChuck
9b513faab4 aligning implementation of the #resolve function in all implementations 2025-05-13 15:52:57 +01:00
HoneyryderChuck
0be39faefc added some missing sigs + type safe code 2025-05-13 15:44:21 +01:00
HoneyryderChuck
08c5f394ba fixed usage of inexisting var 2025-05-13 15:13:02 +01:00
HoneyryderChuck
55411178ce resolver: moved @connections ivar + init into parent class
also, establishing the selectable interface for resolvers
2025-05-13 15:13:02 +01:00
HoneyryderChuck
a5c83e84d3 Merge branch 'stream-bidi-thread' into 'master'
stream_bidi: allows payload to be buffered to requests from other threads

See merge request os85/httpx!389
2025-05-13 14:10:56 +00:00
HoneyryderChuck
d7e15c4441 stream_bidi: allows payload to be buffered to requests from other threads
this is achieved by inserting some synchronization primitives when buffering the content, and waking up the main select loop, via an IO pipe
2025-05-13 11:02:13 +01:00
HoneyryderChuck
012255e49c Merge branch 'ruby-3.5-cgi' into 'master'
Only require from `cgi` what is required

See merge request os85/httpx!391
2025-05-10 00:20:33 +00:00
HoneyryderChuck
d20506acb8 Merge branch 'httpx-issue-350' into 'master'
In file (any serialized) store need to response.finish! on get

Closes #350

See merge request os85/httpx!392
2025-05-10 00:13:41 +00:00
Paul Duey
28399f1b88 In file (any serialized) store need to response.finish! on get 2025-05-09 17:22:39 -04:00
Earlopain
953101afde
Only require from cgi what is required
In Ruby 3.5, most of the `cgi` gem will be removed and moved to a bundled gem.

Luckily, the escape/unescape methods have been left around. So, only the require path needs to be adjusted to avoid a warning.
`cgi/escape` was available since Ruby 2.3

I also moved the require to the file that actually uses it.

https://bugs.ruby-lang.org/issues/21258
2025-05-09 18:54:41 +02:00
HoneyryderChuck
055ee47b83 Merge branch 'stream-bidi-thread' into 'master'
stream_bidi: allows payload to be buffered to requests from other threads

See merge request os85/httpx!383
2025-04-29 22:44:44 +00:00
HoneyryderChuck
dbad275c65 stream_bidi: allows payload to be buffered to requests from other threads
this is achieved by inserting some synchronization primitives when buffering the content, and waking up the main select loop, via an IO pipe
2025-04-29 23:25:41 +01:00
HoneyryderChuck
fe69231e6c Merge branch 'gh-86' into 'master'
persistent plugin: by default, do not retry requests which failed due to a request timeout

See merge request os85/httpx!385
2025-04-29 09:41:45 +00:00
HoneyryderChuck
4c61df768a persistent plugin: by default, do not retry requests which failed due to a request timeout
that isn't a connection-related type of failure, and confuses users when it gets retried, as connection was fine, request was just slow

Fixes https://github.com/HoneyryderChuck/httpx/issues/86
2025-04-27 16:47:50 +01:00
HoneyryderChuck
aec150b030 Merge branch 'issue-347' into 'master'
:callbacks plugin fix: copy callbacks to new session when using the session builder methods

Closes #347 and #348

See merge request os85/httpx!386
2025-04-26 15:12:42 +00:00
HoneyryderChuck
29a43c4bc3 callbacks plugin fix: errors raised in .on_request_error callback should bubble up to user code
this was not happening for errors happening during name resolution, particularly when HEv2 was used, as the second resolver was kept open and didn't stop the selector loop

Closes #348
2025-04-26 03:11:55 +01:00
HoneyryderChuck
34c2fee60c :callbacks plugin fix: copy callbacks to new session when using the session builder methods
such as '.with' or '.wrap', which create a new session object on the fly
2025-04-26 02:34:56 +01:00
HoneyryderChuck
c62966361e moving can_vuffer_more_requests? to private sector
it's only used internally
2025-04-26 01:42:55 +01:00
HoneyryderChuck
2b87a3d5e5 selector: make APIs expecting connections more strict, improve sigs by using interface 2025-04-26 01:42:55 +01:00
HoneyryderChuck
3dd767cdc2 response_cache: also cache request headers, for vary algo computation 2025-04-26 01:42:55 +01:00
HoneyryderChuck
a9255c52aa response_cache plugin: adding more rdoc documentation to methods 2025-04-26 01:42:55 +01:00
HoneyryderChuck
32031e8a03 response_cache plugin: rename cached_response? to not_modified?, more accurate 2025-04-26 01:42:55 +01:00
HoneyryderChuck
f328646c08 Merge branch 'gh-84' into 'master'
adding missing datadog span decoration

See merge request os85/httpx!384
2025-04-26 00:40:49 +00:00
HoneyryderChuck
0484dd76c8 fix for wrong query string encoding when passed an empty :params input
Fixes https://github.com/HoneyryderChuck/httpx/issues/85
2025-04-26 00:20:28 +01:00
HoneyryderChuck
17c1090b7a more agressive timeouts in tests 2025-04-26 00:10:48 +01:00