33 Commits

Author SHA1 Message Date
HoneyryderChuck
0be39faefc added some missing sigs + type safe code 2025-05-13 15:44:21 +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
84db0072fb new :stream_bidi plugin
this plugin is an HTTP/2 only plugin which enables bidirectional streaming

the client can continue writing request streams as response streams arrive midway

Closes https://github.com/HoneyryderChuck/httpx/discussions/71
2025-04-04 00:21:12 +01:00
HoneyryderChuck
b2a1b9cded fixed wrong API call on missing corresponding client PING frame
the function used did not exist; instead, an exception will be raised
2025-03-19 23:42:10 +00:00
HoneyryderChuck
6af8ad0132 missing sig for HTTP2 Connection 2025-03-19 23:30:36 +00:00
HoneyryderChuck
681650e9a6 fixed long-standing reenqueue of request in the pending list 2024-11-19 12:55:44 +00:00
HoneyryderChuck
74fc7bf77d when bubbling up errors in the connection, handle request error directly
instead of expecting it to be contained within it, and therefore handled explicitly. sometimes they may not.
2024-07-25 11:59:02 +01:00
HoneyryderChuck
e250ea5118 Merge branch 'http-2-gem' into 'master'
switch from http-2-next to http-2

See merge request os85/httpx!344
2024-07-08 15:19:37 +00:00
HoneyryderChuck
ba31204227 switch from http-2-next to http-2
will be merged back to original repo soon
2024-06-28 15:49:58 +01:00
HoneyryderChuck
b686119a6f do not try to cast to Options all the time, trust the internal structure 2024-06-11 18:23:12 +01:00
HoneyryderChuck
587271ff77 improving sigs 2024-06-11 18:21:22 +01:00
HoneyryderChuck
874bb6f1cf immprove h2c to not misuse max_concurrrent_requests
the h2c was relying heavily on rewriting connection options to only allow the first request to upgrade; this changes by instead changing the parser on first incoming request, so that if it's upgrade and contains the header, blocks the remainder until the upgrade is successful or not, and if it's not reverts the max concurrent requests anyway
2023-12-06 14:24:33 +00:00
HoneyryderChuck
1e05cdbe62 http/1.1 fix: close connection even if the server does not respect connectionn: close in request 2023-11-04 02:21:03 +00:00
HoneyryderChuck
bdc9478aa8 do not use INFINITY for timeouts
it isn't a valid input for IO#wait family of functions; instead, use nil
2023-10-24 22:53:22 +01:00
HoneyryderChuck
d3b36c5668 added support for HTTP/2 proxy by simplifying the overall http proxy implementation 2022-01-07 12:26:26 +02:00
HoneyryderChuck
5a61586fd5 do not ignore goaway with no errors sent by the server, let the connection go down
raise a specific error for this, which will make it easier to rescue
from.
2021-11-18 18:07:12 +00:00
HoneyryderChuck
b18b715818 some small rbs improvemments 2021-11-13 11:09:29 +00:00
HoneyryderChuck
cdcbf14675 few sig changes (more assertive) 2021-08-31 13:50:29 +01:00
HoneyryderChuck
b6ee019014 several signature improvements while testing with steep 2021-07-07 19:21:36 +01:00
HoneyryderChuck
5cfb494d50 allow parsers to define a connection timeout, and channge it via callback 2021-05-30 00:57:54 +01:00
HoneyryderChuck
8e1e6b3c6a set_protocol_headers now returns extra fields, that can be yielded in the handler, instead of merged into the request
this implicit mutation of the request was causing issue in insecure
redirects, which kept the same HTTP/2 specific headers in HTTP/1
payloads
2021-05-26 18:13:53 +01:00
HoneyryderChuck
441716a5ac fixing double-response for streams
there was a long-standing buggy workaround, whereas in stream-mode, when
there was no response yet to query from, a synchronous request would be
fired. This would break when under event streams, so we had to document
this as "make sure that...".

This fixes it by implementing a general session API convention, which
separates the step of sending the requests, from waiting for its
receival. And, given that the request knows when the response is
available, we can actually "tick until response".

This might be used in the future to refactor the way we handle the
responses, which buffer the full payload by default, instead of reading
from the connection at will.
2021-05-20 00:11:26 +01:00
HoneyryderChuck
7a60346bf7 Added trailer header support for writing requests
Request can also add their own trailer headers, either explicitly via
Request#trailers , or via request lifecycle callbacks
2021-05-06 10:38:20 +01:00
HoneyryderChuck
351276dcb5 added support for multiple header frame received callback calls, by merging them (trailer header case) 2021-04-12 16:38:11 +01:00
HoneyryderChuck
a77091f9e7 refactor the h2c plugin on top of the upgrade plugin
By setting the h2c protocol handler, the rest became much simpler.

Formatting the upgrade request is a matter for the sub-plugin.
Therefore, the specific h2c request upgrade headers are built-in there.
2021-02-28 03:06:03 +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
75c9f08964 added test for trailer headers (http/1 only) 2021-02-19 17:13:19 +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
db036aaefa protocol: passing protocol specific headers as a request callback 2021-02-02 18:33:24 +00:00
HoneyryderChuck
d6465ce433 by passing arity to curry calls, methods can be type-checked now 2020-12-19 00:26:05 +00:00
HoneyryderChuck
392dadcb78 typing the connection parsers 2020-12-07 17:46:45 +00:00
HoneyryderChuck
beb0a82baa typing selector and connection 2020-12-07 16:30:39 +00:00
HoneyryderChuck
936a8533a7 initial signatures for typed ruby 2020-10-27 17:00:44 +00:00