0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00
Commit graph

20 commits

Author SHA1 Message Date
Loïc Hoguin
8cb9d242b0
Initial HTTP/3 implementation
This includes Websocket over HTTP/3.

Since quicer, which provides the QUIC implementation,
is a NIF, Cowboy cannot depend directly on it. In order
to enable QUIC and HTTP/3, users have to set the
COWBOY_QUICER environment variable:

  export COWBOY_QUICER=1

In order to run the test suites, the same must be done
for Gun:

  export GUN_QUICER=1

HTTP/3 support is currently not available on Windows
due to compilation issues of quicer which have yet to
be looked at or resolved.

HTTP/3 support is also unavailable on the upcoming
OTP-27 due to compilation errors in quicer dependencies.
Once resolved HTTP/3 should work on OTP-27.

Because of how QUIC currently works, it's possible
that streams that get reset after sending a response
do not receive that response. The test suite was
modified to accomodate for that. A future extension
to QUIC will allow us to gracefully reset streams.

This also updates Erlang.mk.
2024-03-26 15:53:48 +01:00
Loïc Hoguin
b36f064a91
Refresh copyright lines 2024-01-25 11:22:54 +01:00
Loïc Hoguin
627a4508b5
Explicitly close the socket in some tests for speed ups
The socket staying open meant that the graceful shut down
of the Cowboy listeners were waiting for the connections
to be closed gracefully (or a timeout). Closing explicitly
where it makes sense ensures we don't unnecessarily wait.

This commit removes a full minute in the run time of all
Cowboy test suites (minus examples).
2023-12-18 18:17:09 +01:00
Loïc Hoguin
efb681d749
Handle socket errors in HTTP/1.1 and HTTP/2
Doing so will let us notice when the connection is gone instead
of waiting for timeouts, at least in the cases where the remote
socket was closed properly. Timeouts are still needed in case
of TCP half-open problems.

This change means that the order of stream handler commands is
more important than before because socket errors may occur
during the processing of commands.
2023-12-12 15:05:33 +01:00
Loïc Hoguin
8fc3da2fc3
Fix HTTP/1.1 bug when a flow command is returned after fin
This resulted in a badarith error due to the current flow being
set to infinity when the body has been fully read. A test case
has been added reproducing the issue.
2020-02-07 11:32:15 +01:00
Loïc Hoguin
1a9e62ae2a
Improve some early_error tests 2019-10-04 11:57:29 +02:00
Loïc Hoguin
1ba48c58b1
Make stream_error early_error reasons consistent
Now both HTTP/1.1 and HTTP/2 follow the documented format.
HTTP/1.1 was including an extra element containing the
StreamID before, which was unnecessary because it is also
given as argument to the callback.

HTTP/2 early_error will now include headers in its PartialReq.
2019-10-03 16:04:17 +02:00
Loïc Hoguin
36836594f8
Fix tests failing following Gun update to master 2019-09-06 15:37:42 +02:00
Loïc Hoguin
66fd122c08
Silence expected errors from the stream_handler test suite 2018-11-19 12:37:39 +01:00
Loïc Hoguin
75045637fc
Ensure unknown options are ignored in set_options command 2018-11-16 13:09:01 +01:00
Loïc Hoguin
bc43fca9e6
Fix stream_handler_SUITE test failures due to compression
We always compress when streaming the body back to the client
regardless of the size actually streamed.
2018-09-23 14:10:04 +02:00
Loïc Hoguin
b56a5a1d60
Do not send a 101 after a final response in switch_protocol 2018-09-12 16:16:29 +02:00
Loïc Hoguin
1066a8d376
Remove two warnings in test suites 2017-11-29 17:03:16 +01:00
Loïc Hoguin
cf3ab5832a
Add nowarn_export_all to all test suites 2017-11-29 16:57:10 +01:00
Loïc Hoguin
af58babd94
Fix stream_handler_SUITE test failures 2017-11-01 19:24:42 +00:00
Loïc Hoguin
4bebe39975
Ensure stream terminate is called when switching protocols 2017-10-22 14:53:04 +01:00
Loïc Hoguin
c602871f86
Fix HTTP/1.1 stopping streams too early
It is possible in some cases to move on to the next request
without waiting, but that can be done as an optimization
later on if necessary.
2017-10-20 13:16:04 +01:00
Loïc Hoguin
11ae407eed
Ensure the behavior on stream handler crash is consistent
Also corrects the lack of error response when HTTP/1.1 is used.
2017-09-27 14:17:27 +02:00
Loïc Hoguin
a2facaf2da
Add tests for the streams shutdown mechanism 2017-08-14 17:17:44 +02:00
Loïc Hoguin
767da623f1
Fix terminate not being called on connection close in HTTP/1.1
Introduces the new stream_handler_SUITE test suite. More cases
will be added later on.
2017-06-02 12:31:00 +02:00