1557 Commits

Author SHA1 Message Date
HoneyryderChuck
2be907d1ed Merge branch 'coverage-boost' into 'master'
Coverage boost

See merge request honeyryderchuck/httpx!123
2021-02-21 16:19:16 +00:00
HoneyryderChuck
aa64af9a1a removing init vars from zlib-deflate, might fix truffleruby 2021-02-21 16:09:45 +00:00
HoneyryderChuck
f3999daafc more simplecov ignores 2021-02-21 16:09:45 +00:00
HoneyryderChuck
ee505a92e5 testing altsvc lookups directly 2021-02-21 16:09:45 +00:00
HoneyryderChuck
48961d6c64 do not select on an http/2 connection with no ongoing comms
It was observed that, during a request done via a DoH resolve, the
resolver connection is left in the selector, despite already having
resolved the name, until the whole transfer is done. This is
inefficient, as we're not expected to use it again.

Fixed by improvinng the interest calculation of an HTTP/2 connection; if
the connection doesn't have anything to write. and there aren't  any
inflight streams nor pings, connection won't be listened on.
2021-02-21 16:09:45 +00:00
HoneyryderChuck
28852e19fa fixing double registry for DoH resolver
Some debugging surfaced that the resolving step of doh contains 2
registered connections in the selector, instead of just one. That's
because both the resolver and its inherent connection are registered.

Fixed it by marking the resolver as closed, in the same way we do for
the system resolver, which also nnever gets registered in the selector.
2021-02-19 17:13:19 +00:00
HoneyryderChuck
18625dbc11 registry: remove conversion (internal API, and not used anywhere) 2021-02-19 17:13:19 +00:00
HoneyryderChuck
3ed3dcaa43 ignore http/form-data warning from the coverage 2021-02-19 17:13:19 +00:00
HoneyryderChuck
a050b5a403 selector: jump out of the loop if there's nothing to wait on 2021-02-19 17:13:19 +00:00
HoneyryderChuck
825dcf867b resolver test: status might be an exception message 2021-02-19 17:13:19 +00:00
HoneyryderChuck
75c9f08964 added test for trailer headers (http/1 only) 2021-02-19 17:13:19 +00:00
HoneyryderChuck
c7251d9a17 remove internal telemetry from coverage 2021-02-19 17:13:19 +00:00
HoneyryderChuck
cedd14df09 compacting method_missing defs 2021-02-19 17:13:19 +00:00
HoneyryderChuck
edfd92ea60 added test for to_s rep of error response (i.e. must contain the canonical message class def) 2021-02-19 16:42:39 +00:00
HoneyryderChuck
b6c94f1702 added test for unsupported charset in response 2021-02-18 10:43:48 +00:00
HoneyryderChuck
7f103447ac Merge branch 'issue-111' into 'master'
byteslices

Closes #111

See merge request honeyryderchuck/httpx!122
2021-02-17 17:56:11 +00:00
HoneyryderChuck
39aab9dd09 more usage of byteslice in the http1 parser (in header parsing) 2021-02-17 01:23:49 +00:00
HoneyryderChuck
5c4cf4dd9e regression test for issue fixed in v0.11.2
added a test for parsing an RFC-2616-compliant expires date in the
cookie, which fails without the fix.
2021-02-17 01:23:16 +00:00
HoneyryderChuck
a2895d456f regression test for bug fixed in 0.11.3
created a test server which removes the content-length. Taken extra
condition into account, that the close might manifest itself while
selecting on the socket; at that point we're out of the consumption
loop, so better not to deal with throwing :called
2021-02-17 00:55:05 +00:00
HoneyryderChuck
4bcaf1e121 Merge branch 'issue-115' into 'master'
do not leave the read loop after the epiped event, unless we're out of...

Closes #115

See merge request honeyryderchuck/httpx!121
2021-02-16 21:46:49 +00:00
HoneyryderChuck
952ae7c1ef do not leave the read loop after the epiped event, unless we're out of requests to process or can't read from socket 2021-02-16 21:38:09 +00:00
HoneyryderChuck
3b2d822af9 Merge branch 'issue-90' into 'master'
syscall improvements

Closes #90

See merge request honeyryderchuck/httpx!120
2021-02-16 20:26:32 +00:00
HoneyryderChuck
d4fe89094e fixing TCP connection inprogress on SSL connection bug
The Errno::INPROGRESS error signals that the TCP handshake has been
signaled to the peer already, by which locally we just have wait for it
to be writable.

For simple plaintext requests, this was working correctly, because the
interest was always writable no matter what. However, when wrapped in
the SSL conn, and with the OS tcp stack under more stress, the interest
could be switched to readable, and by reuse, never reset; if, by
subsequent reconnection, EINPROGRESS would be emitted, the socket would
wait for readable instead, resulting in a loop and subsequent
connectionnn timeout.
2021-02-16 18:27:05 +00:00
HoneyryderChuck
d3cc6d2d96 making sure that every response is returned
although a connection might correctly emit an error response, the
returned responses are still defined by the fetch_response loop in the
session. When the pool is actually empty, this had the side-effect of
leaving error responses behind and exiting with just the first one.

This fixes it popping all available responses in such cases.
2021-02-16 18:27:05 +00:00
HoneyryderChuck
19dc528030 fixed broken pipe issue on quick error response from server
in some cases where the client is sending a request with a lot of bytes
(i.e. file uploads), and the server can't consume it (because
authorization, or wrong endpoint), the server stops processing the
request altogether and sends an error response immediately, in which
case the client should pivot and read the error response. Not doing this
was causing the Errno::EPIPE error. The mitigation is therefore to
rescue the error, and mark the consumption loop to read the response
immediately.
2021-02-16 18:27:05 +00:00
HoneyryderChuck
7082f63e4e more explicit error message in multipart test 2021-02-16 18:27:05 +00:00
HoneyryderChuck
4bab923f25 experimental optimizations in the connection call loop.
skip entering the read/write hot loops when the connection interests
specifically say so. this led to a overhaul of how interests are
calculated.
2021-02-15 17:20:41 +00:00
HoneyryderChuck
ad88aa27cf added more level 3 logging using a custom telemetry plugin, which is internal use only
this will therefore not be documented.
2021-02-15 17:20:41 +00:00
HoneyryderChuck
bfe77fe92c fixing initializationn of connect timeout, which needs the failed timeout value 2021-02-15 17:20:41 +00:00
HoneyryderChuck
981824bf47 fixing how to load plugins on boot, such as the http_proxy when the system proxy is set 2021-02-15 17:20:41 +00:00
HoneyryderChuck
cb07abc94e unused condition in pool 2021-02-15 17:20:41 +00:00
HoneyryderChuck
8feecf693f Merge branch 'issue-114' into 'master'
fixing http/1.1 bug when response doesn't have a content-length

Closes #114

See merge request honeyryderchuck/httpx!119
2021-02-15 16:48:11 +00:00
HoneyryderChuck
fa72b25a57 bumped to 0.11.3 v0.11.3 2021-02-15 15:05:22 +00:00
HoneyryderChuck
17aeb10e0b fixing http/1.1 bug when response doesn't have a content-length
if a response does not advertise its body length, then the server closes
    the connection when there's no more data to read. Therefore, the
    HTTP/1.1 parser should interpret these conditions accordingly, and
    emit the response.

Closes #114
2021-02-15 15:05:01 +00:00
HoneyryderChuck
d9ffa846a6 Merge branch 'issue-113' 2021-02-12 12:52:20 +00:00
HoneyryderChuck
396f02c904 show how much mem gitlab is letting the job use v0.11.2 2021-02-12 11:15:41 +00:00
HoneyryderChuck
46862068b2 bumped to 0.11.2 2021-02-12 11:15:19 +00:00
HoneyryderChuck
a128f42c5c hotfix: use Time.parse to parse cookie datetimes instead, as they need to be 6265-compliant, which Time.httpdate isn't for 2021-02-12 11:08:19 +00:00
HoneyryderChuck
7c1d29ec1a aws sigv4: fixing usage of hashing algorithm 2021-02-08 01:37:24 +00:00
HoneyryderChuck
7de0ab0862 condition for 2.2 in gemfile not good enough for 2.2.10 2021-02-07 17:01:34 +00:00
HoneyryderChuck
71dd9fe1c9 Merge branch 'issue-108' into 'master'
AWS Sigv4

Closes #108

See merge request honeyryderchuck/httpx!118
2021-02-07 16:48:55 +00:00
HoneyryderChuck
10bb2fbfd2 removed test logging 2021-02-07 15:52:28 +00:00
HoneyryderChuck
005ae539ea fixing multipart encoder error rewind
two bugs were found. first, only file bodies would be rewinded, whereas
other rewindable (i.e. stringios and such) would be ignored. also,
part_index needed to be reset to 0, so that the parts would be flushed
sequentially (second request body was always empty).
2021-02-07 15:49:08 +00:00
HoneyryderChuck
fd28741a97 fixing retry protocol bug for not-completely-flushed requests
a bug was found where in certain cases, a server responds with an error
before the request fully buffers the body. Under retries, the request
is reset, however, the http/2 conn handler kept the last chunk around,
which it would flush before writing the second request body, resulting
in byte-accounting issues. Therefore, response clean up request state
before yielding.
2021-02-07 15:48:36 +00:00
HoneyryderChuck
9ca4cbe68b yield error response on frame protocol errors for a given stream
stream HTTP/2 framing errors were being yielded directly into the connection. This had
the issue of not closing the request, thereby causing an infinite loop
when closing the connection. This seemed to be the issue in CI.
2021-02-07 15:16:26 +00:00
HoneyryderChuck
5a9277d8f4 logging multipart retry test, this seems to be the onne hanging from time to time... 2021-02-06 16:34:47 +00:00
HoneyryderChuck
ff87177a4a added module signatures 2021-02-06 16:24:35 +00:00
HoneyryderChuck
408e71a490 clean unused options, prefer using kwargs redirectionn for #aws_sdk_authentication instead 2021-02-06 16:24:35 +00:00
HoneyryderChuck
1724c0f913 waiting for localstack to be up before running the tests in CI 2021-02-06 16:24:35 +00:00
HoneyryderChuck
ef8ad355e9 show the header in the logs when aws sigv4 fails 2021-02-06 16:24:35 +00:00