aboutsummaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2024-03-14Use public_key:cacerts_get/0 when possibleLoïc Hoguin
Also "fix" many TLS test failures due to yet more changes in the default options for TLS. Also small changes to make Dialyzer happy.
2023-06-05Fix crash when TLS connection closes very earlyLoïc Hoguin
And ensure that we don't infinite loop when retries are enabled, by decrementing the retry count instead of using a new one. Also check for ssl:negotiated_protocol {error,closed} which was possible but was not documented in OTP before this change. Thanks @voluntas for the help.
2023-01-23Update copyright lines in preparation for releaseLoïc Hoguin
2023-01-23Fix intermittent error in stream_info_http testLoïc Hoguin
2023-01-23Selective receive in test to avoid receiving wrong messageLoïc Hoguin
2023-01-23Linger a little at the end of a shutdown test connectionLoïc Hoguin
This is to avoid the TCP close eating data.
2023-01-23Increase times by factor 10 to fix timing issueViktor Söderqvist
2023-01-09Tweak some test outputsLoïc Hoguin
2023-01-09Skip degraded configuration test on WindowsLoïc Hoguin
2022-12-06Add keepalive_tolerance http2 optionViktor Söderqvist
The number of unacknowledged pings that can be tolerated before the connection is forcefully closed. When a keepalive ping is sent to the peer, a counter is incremented and if this counter exceeds the tolerance limit, the connection is forcefully closed. The counter is decremented whenever a ping ack is received from the peer. By default, the mechanism for closing the connection based on ping and ping ack is disabled. Loïc Hoguin: I have edited a lot of the code and renamed a few things as well as simplified the docs and increased test timeouts to avoid race conditions.
2022-12-05Add tests for ws subprotocol negotiationViktor Söderqvist
2022-11-21Don't infinite loop gun_pool on bad configurationLoïc Hoguin
We leave the pool in a degraded state if the configuration given is invalid and a lookup/connect can't be made.
2022-11-21Support positive HTTP/1.0 responses to CONNECT requestsLoïc Hoguin
2022-11-14Implement gun_raw:down/1, gun_raw:update_flow/4Denys Knertser
Loïc: I have reworded a couple things and reordered the tests. It would be great to also test these things over proxies.
2022-11-08Include Websocket StreamRef in gun_down messagesWei Huang
2022-10-24Handle send errorsViktor Söderqvist
2022-10-11Update tests for OTP-25+Loïc Hoguin
2022-09-12Silence certs related ssl warnings in test suitesLoïc Hoguin
2022-09-12Update cookie tests against latest WPTLoïc Hoguin
The http-state tests were removed and replaced with tests in HTML pages. I have devised a way to semi- automatically import them and test them. Additional fixes were made following changes in the rfc6265bis draft.
2022-08-30Add tests for the SSE handlerBenedikt Reinartz
2022-03-08Add a test for HTTP/2 empty DATA frame with fin setLoïc Hoguin
2022-03-08Handle any zero-sized Data in http:data with finMartin Björklund
Amended to make the test case hit the problem.
2022-03-08Add tests for SNILoïc Hoguin
2021-02-09Fix gun_pool:stop_pool/2,3 with default portLoïc Hoguin
2021-02-08No longer use ssl:ssl_accept/2Loïc Hoguin
2021-02-07Initial commit for Gun poolsLoïc Hoguin
The approach taken here is very similar to what browsers are doing. A separate pool is created for each host/port/scope. The authority (host header) is used to determine which pool will execute requests. A connection process is semi-randomly chosen, from the connections that have capacity. Maximum capacity is determined by the protocol (the HTTP/2 setting set by the server is used, for example). Multiple processes can process requests/responses on the same connection concurrently. There is no need to "give back" the response to the pool, the number of ongoing streams is maintained via an event handler. The implementation is currently not strict, there may be more attempts to create requests than there is capacity. I'm not sure if it should be made strict or if Gun should just wait before sending requests (it only matters in the HTTP/2 case at the moment). When there is no connection with capacity available in the pool (because they have too many streams, or are reconnecting, or any other reason), checking out fails. There is no timeout to wait for a connection to be available. On the other hand the checkout_retry option allows setting multiple timeouts to retry checking out a connection. Each retry attempt's wait time can have a different value. The initial implementation of this work was sponsored by Kobil and made at the suggestion of Ilya Khaprov.
2020-11-12Reset host/port/scheme/transport/intermediaries on disconnectLoïc Hoguin
I've made some more test timeouts infinity in order to fix additional intermittent issues that popped up.
2020-11-12Return 'undefined' for raw|socks origin_scheme where applicableLoïc Hoguin
2020-11-12Fail fast while closing if reconnect is offViktor Söderqvist
If a request/headers/connect/ws_upgrade is created when a connection is in state 'closing', such as after receiving an HTTP/2 GOAWAY frame or an HTTP/1.1 "Connection: close" header, an error message is sent back to the caller immediately, if reconnect is off (that is if the option retry is set to 0). This allows an application to retry the request on another connection without waiting for all streams on the current connection to complete.
2020-11-12Update copyright yearsLoïc Hoguin
2020-11-12Replace gun:ws_send/2 with gun:ws_send/3Loïc Hoguin
Switching from /2 to /3 should be easy enough. Also update the documentation about HTTP/2 Websocket support.
2020-11-12Add more new keys to gun:info and gun:stream_info manualsLoïc Hoguin
2020-11-09Update source path for test tool h2specdBjorn Svensson
The main source file for the test tool h2specd was moved a time ago, but correct one is used now. Also make sure that gun sends the GOAWAY directly to avoid timing issues in test 6.9.1 in h2specd_SUITE.
2020-11-06Make CONNECT responses produce a response_end eventLoïc Hoguin
While the stream has not ended, the response has.
2020-11-06Fix IsFin mismatch in HTTP/2 CONNECT responseLoïc Hoguin
The response ends when the tunnel is established, even if the stream itself does not. The data coming in on the stream after is not part of the response. This makes both HTTP/1.1 and HTTP/2 send 'fin' to successful CONNECT responses.
2020-11-02Initial implementation of Websocket over HTTP/2http2-websocketLoïc Hoguin
2020-10-21Fix cookie handling when tunnel and origin schemes mismatchLoïc Hoguin
The cookie_ignore_informational has been moved to http_opts and http2_opts. Also fix an issue when using 'protocols' in gun:open. When connecting via TLS the protocol's options were discarded.
2020-10-19Fix cookies for tunnelsLoïc Hoguin
There are still small issues left to fix. In particular the set_cookie command should be replaced with doing the same in the protocol itself so that the scheme is correct. So CookieStore must be propagated to all callbacks.
2020-10-16Remove the transport_changed eventLoïc Hoguin
It doesn't provide any new information compared to the other events.
2020-10-16Add or fix events inside or related to CONNECT tunnelsLoïc Hoguin
2020-10-07Propagate timeouts to the right layer in HTTP/2 tunnelsLoïc Hoguin
This temporarily depends on Cowlib master.
2020-10-07Normalize headers in ws_upgraderinpatch
In the documentation headers passed to ws_upgrade are typed as gun:req_headers(), however if a map of headers is passed (which is allowed by the type), the gun process will crash when trying to operate on it as if it were a list.
2020-10-03Fix test suites failing due to previous breaking changesLoïc Hoguin
2020-10-03Add tunnel_SUITE testing all 3-layer combinationsLoïc Hoguin
The test suite is 216 tests with a tunnel created via two proxies leading to one origin server. The tests are for example socks5_h2_https where socks5 identifies the first SOCKS5 proxy, h2 the second HTTP/2 CONNECT proxy and https the secure HTTP/1.1 origin server. The test not only sets up the tunnel and does a request (or sends/receives data in the case of raw origin servers) but also confirms that the stream_info and info data is correct.
2020-09-21Fix gun:stream_info/2 when gun_tunnel is involvedLoïc Hoguin
2020-09-21Initial success for h2 CONNECT -> https CONNECT -> httpsLoïc Hoguin
2020-09-21Add test HTTP/2 CONNECT -> HTTP/1.1 CONNECT -> originLoïc Hoguin
Implements gun:connect with a tunnel.
2020-09-21Add more HTTP/2 CONNECT testsLoïc Hoguin
2020-09-21Few more tests and fixesLoïc Hoguin
2020-09-21Replace gun_tunnel_up/3 message with /4 variantLoïc Hoguin
Also fixes all the tests. Lots of work remain around protocols (how best to pass the base stream_ref to them? maybe the current solution, maybe a new argument to Protocol:init) and strengthen the concept of stream_ref, at least with its own type.