1334 Commits

Author SHA1 Message Date
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
HoneyryderChuck
d9326ac027 fixing the disable of kee-alives when setting max-concurrent-connections
to 1

A check was introduced limiting the number of requests send at once.
However. the connection header was set to "close" as well, because
the accounting involved the number of concurrent connections allowed.
This is now fixed, by doing accounting separately.
2021-02-05 19:28:38 +00:00
HoneyryderChuck
3f3e1cd9cf limiting the number of max concurrent connnections for the awk
authentication plugin

TIL that S3 does not speak HTTP/2 (cloudfront does). Also, AWS sigv4
verification breaks with pipelined requests, therefore, we have to send
them one at a time.

GCP does provide HTTP/2 support, so let's test there as well.
2021-02-05 18:42:39 +00:00
HoneyryderChuck
242cee73b5 using truffleruby nightly builds 2021-02-04 20:17:35 +00:00
HoneyryderChuck
3083fe7b78 added link to wiki regarding jruby in the readme 2021-02-04 18:41:07 +00:00
HoneyryderChuck
e1d305b4d9 adding expect and compression plugins by default to the aws_sigv4 plugin
It's expected that this endpoint will be used i most cases for file
uploads, so both plugins will be important to improve throughput and
auth-fail-fast scenarios
2021-02-03 12:52:55 +00:00
HoneyryderChuck
d93de82639 do not assume that kwargs work as hash merges in older rubies 2021-02-03 12:52:22 +00:00
HoneyryderChuck
2875e81d16 testing against patched openssl version (and sending all artifacts to coverage job in CI) 2021-02-02 19:42:43 +00:00
HoneyryderChuck
5e31836ac2 changing the API so that a credentials object can be passed to sigv4
this allows the aws-sdk plugin to pass a wrapped Aws::Credentials
downstream, which provides the username/password vars. this is
important, as some of the strategies, such as the web identity token,
also revalidate these parameters.
2021-02-02 18:33:24 +00:00
HoneyryderChuck
ae1060157a changing the name of the plugin to aws_sdk_authentication, removing depenndency on s3 gem (only aws-sdk-core) 2021-02-02 18:33:24 +00:00
HoneyryderChuck
463dad46cb added the aws signature on top of the aws-sigv4 plugin, with support for using aws-sdk-core ready-made config 2021-02-02 18:33:24 +00:00
HoneyryderChuck
755b895b08 added initial aws sigv4 functional test 2021-02-02 18:33:24 +00:00
HoneyryderChuck
c588614c2c adding localstack to mimmick local aws cloud 2021-02-02 18:33:24 +00:00
HoneyryderChuck
48051d37c0 adding initial implementation of sigv4 request signing, which passed the aws-sdk-sigv4 tests 2021-02-02 18:33:24 +00:00
HoneyryderChuck
db036aaefa protocol: passing protocol specific headers as a request callback 2021-02-02 18:33:24 +00:00
HoneyryderChuck
f415d1b66b added tests for aws sigv4 2021-02-02 18:33:24 +00:00
HoneyryderChuck
a1942d5a6a Merge branch 'issue-100' into 'master'
FFI-base TLS stack for JRuby to enable HTTP/2

Closes #100

See merge request honeyryderchuck/httpx!117
2021-02-02 17:55:49 +00:00
HoneyryderChuck
550fc82b1a adding coverage innfo of ruby 3 2021-02-02 17:33:41 +00:00
HoneyryderChuck
6d3312bffe group ci tasks by name 2021-02-02 15:49:25 +00:00
HoneyryderChuck
e334bf891b as per https://github.com/msgpack/msgpack-ruby/issues/205 , restrict 1.4 to ruby >= 2.4 2021-02-02 15:40:22 +00:00
HoneyryderChuck
17dc61402b removing rubocop's pin to master (a bugfix has been released) 2021-02-02 15:28:07 +00:00
HoneyryderChuck
fa81dcbb73 ci: change dependencies to needs 2021-02-02 15:05:49 +00:00
HoneyryderChuck
065bfc48dc do not rely on deflater being initialized at this point 2021-01-31 16:19:49 +00:00
HoneyryderChuck
838f9a3e11 added ruby-tls license to the ffi-based files 2021-01-31 16:07:42 +00:00