23 Commits

Author SHA1 Message Date
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
bfe77fe92c fixing initializationn of connect timeout, which needs the failed timeout value 2021-02-15 17:20:41 +00:00
HoneyryderChuck
777ab21050 making WRITE/READ more accurate by emitting them at the socket (UDP/TCP) level 2020-11-19 09:44:29 +00:00
HoneyryderChuck
1b26977d16 updated rubocop to 1.0.0 on possible rubies, making the necessary changes 2020-11-07 15:36:21 +00:00
HoneyryderChuck
e7181132ab io read: making sure that the read buffer is flushed when one can't read from the io, as we'll need this information later 2020-04-18 17:42:22 +01:00
HoneyryderChuck
382139e0a5 wrong timeout class 2020-04-18 01:48:38 +01:00
HoneyryderChuck
cf5be6b899 jruby: gave up and rw on connect, as we're entering an infinite loop too many times after ssl connect and waiting for writes. the problem is identified though, and will be worked on once we work on polling less 2020-04-13 18:07:27 +01:00
HoneyryderChuck
78ce18027c passing interests call to the underlying io object, which makes it more accurate for the ssl case 2020-04-12 03:32:04 +01:00
HoneyryderChuck
9d6f31d940 calculate interests down to connection and parser
by analyzing all of the data down to the parser, one can estimate better
whether io wants to read/write/both, thereby avoiding spurious wakeups.

This also greatly simplifies the monitor API, and solves the 100% CPU
utilization issue.
2020-04-12 03:32:04 +01:00
HoneyryderChuck
9955c2ba80 testing log output, which allowed to remove a few more nocovs 2020-01-12 18:53:23 +00:00
HoneyryderChuck
2e7713b52a enabling coverage areas from recent rubies 2020-01-11 13:22:31 +00:00
HoneyryderChuck
b96eb526a3 fixed tests for connect timeouts
using ip tables to drop SYN packets on port 9090; this requires to run
the container in privileged mode. It was also necessary to handle the
Errno::ETIMEDOUT error, as this has to be directly transformed into a
connection error
2019-12-31 01:57:00 +00:00
HoneyryderChuck
e03de0d2c6 novoc some more, removed unused code 2019-12-31 01:54:59 +00:00
HoneyryderChuck
40e62b590e disabling coverage for multiline logs 2019-12-31 01:54:59 +00:00
HoneyryderChuck
8d2f0fd064 disabling coverage in inspect methods 2019-12-31 01:54:59 +00:00
HoneyryderChuck
b39272381d removed code branching based on ruby version from coverage 2019-12-31 01:54:59 +00:00
HoneyryderChuck
933d319b0b using byteslice instead of slice for buffer manipulation
The code from which the buffer and string handling was adapted,
inherited also the usage of slice!, which is not the appropriate tool
for when dealing with byte streams. Ruby doesn't have an equivalent
String#byteslice! yet, so we adapted other known workarounds (see
https://bugs.ruby-lang.org/issues/13626) for our code. This means that:

- For HTTPX::Buffer, we add a shift! method, as all usage shift the
buffer part which has been written to the socket;
- For HTTP1 parser and Chunker, we have to double the usage of
byteslice. In the cases where it results in nil, we might needlessly
initialize an empty string, however this is the lesser of evils, until a
proper backport is in place.
2019-10-12 20:57:44 +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
cf7b4bff94 Fixed issue when IO was passed as an option, but a DNS query was still
issued to the request host, which doesn't make sense.

This also fixed an inconsistency when passing an hash of IOs. The key of
that hash MUST match the request authority for the channel to properly
assign it.
2018-12-28 14:21:25 +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
b7e875a761 rubocoped this 2018-05-28 10:00:54 +01:00
HoneyryderChuck
994c1b853e moved TCP and SSL definitions under /io, where possible future transports will go to 2018-05-25 16:05:03 +01:00