Age | Commit message (Collapse) | Author |
|
The documentation was correct, the code was not.
This should make it easier to implement new protocols. Note that
for HTTP/2 we will need to add some form of counting later on to
check for malformed requests, but we can do simpler and just
reduce from the expected length and then check if that's 0 when
IsFin=fin.
|
|
|
|
|
|
|
|
|
|
|
|
It is completely removed for connection processes, because
assuming Cowboy is written properly this should bring us
nothing anymore in 2.0.
It is reworked for request processes, there we want to
always propagate the stacktrace (including for exits)
because we will print a report to help with debugging
and proc_lib doesn't propagate it for exits.
At the same time the initial callback for connection
and request processes has been changed to connection_process
and request_process, which should help with identifying
processes when inspecting.
|
|
When the request process exits with a {request_error, Reason, Human}
exit reason, Cowboy will return a 400 status code instead of 500.
Cowboy may also return a more specific status code depending on
the error. Currently it may also return 408 or 413.
This should prove to be more solid that looking inside the stack
trace.
|
|
|
|
|
|
The header never reaches this point.
|
|
|
|
This will result in no data being sent. It's simply easier to
do this than to have to handle 0 size cases in user code.
|
|
|
|
|
|
I have decided not to include a manual page for
cowboy_stream_h at this point because it clashes
with the cowboy_stream manual page. This decision
will be revisited in the future.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
My bad! Still new at this.
|
|
|
|
This should work very similar to normal supervisors,
in particular during the shutdown sequence when the
connection process goes down or switches to Websocket.
Processes that need to enforce the shutdown timeout
will be required to trap exits, just like in a supervisor.
In a vanilla Cowboy, this only matters at connection
shutdown, as Cowboy will otherwise wait for the request
process to be down before stopping the stream.
Tests are currently missing.
|
|
Cowboy was encoding the headers then decoding them when initializing
the request. The problem is that the encoding and decoding contexts
are not the same. Now, Cowboy will directly use the headers it
received in the push command for the new request. This is also
more efficient.
I am surprised it worked at all considering the issue.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is important because it clarifies that sec-websocket-protocol
is case sensitive when matching. Only the registry is case
insensitive.
|
|
This will be reintroduced in a future release once the
interface stabilizes. For the time being it will be an
internal module only.
|
|
|
|
None of these workarounds currently exist in Cowboy 2.0.
We can resurrect the chapter later if it's still necessary,
once we've added the workarounds back in some other form.
|
|
|
|
They're gone!
|
|
Hooks are gone, and we won't be able to stream body in REST
in Cowboy 2.0-rc.1, and might not in 2.0 either. That is,
other than via halting the processing.
|
|
|
|
Please consult the appendixes in the user guide.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The Cowboy behavior has changed a little and gives more
accurate error responses now. And in some cases, successes.
|
|
|
|
|