Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
This fixes issue #33.
|
|
This is probably not perfect yet but it should be better than
nothing. We'll improve things with feedback received from the
many users.
|
|
Following discussions on #erlounge.
Also fixes compilation in R14B03 and fixes a few underspecs
dialyzer warnings.
|
|
The dispatcher now accepts '...' as the leading segment of Host and the
trailing segment of Path, this special atom matches any remaining path tail.
When given "cowboy.bugs.dev-extend.eu", host rule ['...', <<"dev-extend">>,
<<"eu">>] matches and fills host_info with [<<"cowboy">>, <<"bugs">>].
When given "/a/b/c/d", path rule [<<"a">>, <<"b">>, '...'] matches and fills
path_info with [<<"c">>, <<"d">>].
|
|
|
|
The server now does a single recv (or more, but only if needed)
which is then sent to erlang:decode_packet/3 multiple times. Since
most requests are smaller than the default MTU on many platforms,
we benefit from this greatly.
In the case of requests with a body, the server usually read at
least part of the body on the first recv. This is bufferized
properly and used when later retrieving the body.
In the case of pipelined requests, we can end up reading many
requests in a single recv, which are then handled properly using
only the buffer containing the received data.
|
|
Returns the port given in the Host header if present,
otherwise the default port of 443 for HTTPS and 80 for HTTP
is returned.
|
|
|
|
|
|
|
|
|
|
Added it while debugging an issue, so why not keep it?
|
|
|
|
|
|
|
|
|
|
|
|
Mostly used by the following request: OPTIONS * HTTP/1.1
|
|
* Makes more sense to parse the host only once instead of for each path.
* Allows proper handling of: If the host is not a valid host on the server,
the response MUST be a 400 (Bad Request) error.
|
|
|