Age | Commit message (Collapse) | Author |
|
This is a big change in the internal cowboy API. This should not
have any impact on existing applications as only the acceptor is
expected to use these API calls.
The function cowboy_listener:wait/3 has been removed. max_connections
checking now occurs directly in cowboy_listener:add_connection/3.
If the pool is full and the acceptor has to wait, then it doesn't
return, waiting for a free space to be available.
To accomodate these changes, it is now cowboy_listener that will
inform the new connection that it is ready by sending {shoot, self()}.
This should be a great improvement to the latency of responses as
there is one less message to wait for before the request process
can do its work.
Overall the performance under heavy load should also be improved as
we greatly reduce the number of messages sent between the acceptor
and the listener process.
|
|
|
|
The body was still in the buffer that's being used for the next
request and was thus used as a request, causing errors.
|
|
|
|
At the same time rename http_headers/0 to cowboy_http:headers/0.
|
|
|
|
|
|
Exported types are much better than include files.
|
|
|
|
Excluding generate_etag, last_modified, expires and variances.
|
|
|
|
|
|
Conflicts:
src/cowboy_http_req.erl
test/http_SUITE.erl
|
|
|
|
|
|
|
|
Followup to 0bb23f2400ed0b65834913c8522a978d986f1f92.
As discussed in #119.
|
|
|
|
They should return true when it has been processed successfully,
or false otherwise, in which case a 500 error is sent.
Fixes #119.
|
|
We try to send a 500 error only if we didn't send the response
headers yet. If they were, then we have no way to be sure the
response was fully sent, nor should we assume anything about
how this will be handled client-side, so we do nothing more
and in both cases close the connection.
|
|
We want to reply as soon as possible.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Removes the cowboy_clock:date/0, time/0 and datetime/0 exported types.
|
|
Not parsing product tokens, I don't see much point.
|
|
|
|
Based on the patch by Louis-Philippe Gauthier.
|
|
|
|
Also add the new 'put_path' metadata information to the request
before entering the put_resource step (which proceeds to call
content_types_accepted and then the chosen content type's callback,
which is expected to use the 'put_path' value as the path to the new
resource instead of the original request path, because it may have
been changed by the create_path call.
|
|
* cowboy_http_protocol now defines 'websocket_version' as metadata.
* cowboy_http_rest now defines 'media_type', 'language', 'charset' as metadata.
|
|
|
|
resp_body is set by cowboy_http_req:set_resp_body/2 which accepts
the input type iodata(). Update the resp_body field to use the same
type. Also update the cowboy_http_req:has_resp_body/2 function to
use the iolist_size/1 which works with both binary() and iolist()
values instead of the byte_size/1 function which only works with
binary() values.
|
|
|
|
|
|
|
|
|
|
Based on the patch from Heinz N. Gies. The main change is that his
patch accept values such as */plain which we do not want.
Fixes issue #105.
|
|
|
|
|
|
|
|
Fix pattern in case statement that was intended
to strip away the first comma separating the
values in the variance header.
Update generation of variance list to use more
idiomatic erlang. Pattern match on list structure
over using erlang:length/1 to compute length.
|
|
This is a workaround for an issue in the hipe compiler where
compilation of code matching on binaries using patterns of the
form Data = <<Char, _Ignore/bits>> fails because _Ignore is
expected to be used. Using /binary instead of /bits resolves
the issue.
We're applying this change to all binary expressions in cowboy_http
because all functions in this module process human readable text
formats which are always expected to be bytestrings.
Two uses of /bits has been changed to /binary in cowboy_http_websocket
in two clauses of a single function, websocket_data/4. This is safe
to change because the data is later passed to binary:match/2 which
will always fail with a badarg error if the input is a bitstring
instead of a bytestring.
|
|
This function complements the cowboy_http:urldecode/2
and urldecode/1 functions. We should have this encoding
covered now. urldecode is only expected to be invoked
by user code, no further changes needed to integrate this.
|
|
|