46 Commits

Author SHA1 Message Date
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
HoneyryderChuck
72b90c3f17 added support for plugin pimping the request body, remove the content-encoding logic there 2018-01-14 22:45:54 +00:00
HoneyryderChuck
65722a3b12 changed timeout so it relies on a loop timeout and a global timeout; both can be disabled 2018-01-13 15:42:34 +00:00
HoneyryderChuck
30fcdfeb2c http2: added http2_settings as configurable options 2018-01-08 22:29:14 +00:00
HoneyryderChuck
48e55a7ca2 removing :proxy options from base class, adding them with the plugin 2017-12-20 19:14:19 +02:00
HoneyryderChuck
193828527b added debug_level option, which can make logs more verbose 2017-12-19 13:06:51 +02:00
HoneyryderChuck
0c307c82c3 removing the cookies test from options 2017-12-19 13:05:54 +02:00
HoneyryderChuck
89298be707 allow debug option, which can be passed the logger (must respond to #<<); using it in the debug logger for http1 payload and http2 frames 2017-12-13 01:23:38 +00:00
HoneyryderChuck
e6a5fbdf45 passing fallback protocol as option; this will allow to override, specially in the case when user knows that server can do unencrypted http/2 2017-12-11 22:28:12 +00:00
HoneyryderChuck
4e094f79d0 ssl options: passing alpn fixtures as ssl default options; this will allow disabling, and will centralize defaults 2017-12-11 16:02:51 +00:00
HoneyryderChuck
15a5ffffdd allow to pass a custom body class, which only needs to implement the constructor signature and #<< 2017-12-11 13:10:58 +00:00
HoneyryderChuck
40a73f5a7b made body threshold size (the max buffered size after which the response body is buffered to disk) a top-level option 2017-12-11 12:43:05 +00:00
HoneyryderChuck
94cb9b63d9 moved window size to options, changed it to 16K 2017-12-10 20:37:27 +00:00
HoneyryderChuck
824efb83fd allow IOs to be passed as argument; they are expected to be connected already, and won't be closed after use; if passed only one, assume that all requests are going through it, otherwise, pass them as an hash indexed by IP or IP:PORT 2017-12-10 00:29:06 +00:00
HoneyryderChuck
690fcaf3d2 default timeout is now the per operation one 2017-12-08 18:45:29 +00:00
HoneyryderChuck
15a972df32 added tests to the req/rep/head factory classes, and to the plugin module 2017-12-07 01:07:17 +00:00
HoneyryderChuck
7cc2f66eed added retryability, in that certain errors (for http2 now, rst_stream ones); added a max concurrent requests setting, which governs how many concurrent requests might be inflight (besides the obvious settings handled by the lower layer) 2017-12-06 14:27:58 +00:00
HoneyryderChuck
a214891fa1 added timeouts backend like http, integrated it in connecting sockets, and performing selector operations; the global one still needs work though (currently connecting one by one, connection not integrated in selector) 2017-11-29 00:07:49 +00:00