aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-04-30Add backlog transport option.Loïc Hoguin
This fixes issues with the http_load benchmark tool. The default backlog option from OTP only queues up to 5 connections, which is way too low for a fast-responding server. Issue initially found thanks to DeadZen bugging me to test cowboy with http_load. Fix found thanks to ostinelli's misultin already having the backlog option which was the one thing it did differently than cowboy.
2011-04-30Remove the next_request function always matching its first clause.Loïc Hoguin
2011-04-29Fix type specs for ssl:socket.Loïc Hoguin
Should fix the warnings given by the Dialyzer-current build over at http://dialyzer.softlab.ntua.gr/current/cowboy/ Thanks Kostis for the help.
2011-04-18Remove the include/types.hrl file.Loïc Hoguin
2011-04-18Replace port_number() by ip_port() from kernel/include/inet.hrl.Loïc Hoguin
2011-04-18Replace posix() by atom(), for now.Loïc Hoguin
The type isn't exported by OTP so we don't win much. Also, inet.erl and file.erl define posix() différently, so OTP needs to stop being so confuse in the first place before we can attempt to use it properly.
2011-04-18Move the type application_start_type() into cowboy_app.Loïc Hoguin
2011-04-18Move the dispatcher related types into cowboy_dispatcher.Loïc Hoguin
2011-04-18Rename match() into match_rule().Loïc Hoguin
2011-04-18Rename dispatch() into dispatch_rules().Loïc Hoguin
2011-04-18Rename dispatch_rules() into dispatch_rule().Loïc Hoguin
2011-04-18Move HTTP types definitions to include/http.hrl (for now).Loïc Hoguin
2011-04-18Move the opaque type sslsocket() out of include/types.hrl.Loïc Hoguin
2011-04-18Use the inet:socket() type instead of the user-defined one.Loïc Hoguin
2011-04-17Use the inet:ip_address() type instead of the user-defined one.Loïc Hoguin
2011-04-17ct: Throw garbage at the server then check if it's still up.Loïc Hoguin
Basically: cat /dev/urandom | nc host port Only run this test if cat and nc are available.
2011-04-16Add an accept timeout for code reloading.Loïc Hoguin
Thought it was already there, but I guess not. Anyway it's here now so everything is back to normal. ;)
2011-04-14SSL transport uses sslsocket(), not plain socket().Loïc Hoguin
2011-04-14Initial draft-hixie-thewebsocketprotocol-76 support.Loïc Hoguin
2011-04-14Fix specs for cowboy_http_req:reply/4.Loïc Hoguin
Body is iodata(), not iolist().
2011-04-14Fix a bug where dupe headers were sent in cowboy_http_req:reply/4.Loïc Hoguin
Now the server defines default headers that can be overwritten by the handler simply by passing them to the reply/4 function. Default headers include, for now, Connection and Content-Length headers. Note that it isn't enough to change the Connection header to close a keep-alive connection server-side.
2011-04-14Add a test case for cowboy_dispatcher:match/3.Loïc Hoguin
Added it while debugging an issue, so why not keep it?
2011-04-12Add a Transport:messages/0 function to obtain the atoms sent in active mode.Loïc Hoguin
That way we can support active mode without having to hardcode the atoms for each transports available.
2011-04-12Don't enable binary optimization warnings by default.Loïc Hoguin
It's problematic: both doing it right and doing it wrong trigger a warning and we treat warnings as errors.
2011-04-12Fix a pattern matching bug in cowboy_http_protocol:handler_init/2.Loïc Hoguin
2011-04-10ct: Add a test for requests pipelining.Loïc Hoguin
2011-04-09ct: Add a test for \n which throws an error 400.Loïc Hoguin
2011-04-09Limit the number of empty lines to allow before the request-line.Loïc Hoguin
Defaults to 5. Prevents someone from indefinitely sending empty lines.
2011-04-09ct: Add tests for incomplete requests leading to a timeout.Loïc Hoguin
2011-04-09ct: Add raw tests to check that errors are properly handled.Loïc Hoguin
2011-04-08Initial work on a ct test suite for the HTTP protocol.Loïc Hoguin
Handles two basic tests for both HTTP and HTTPS. Also renames 'make test' into 'make tests'.
2011-04-08Discard the port from the host before tokenizing it.Loïc Hoguin
2011-04-07Don't crash on errors while receiving headers; throw an error 500 instead.Loïc Hoguin
The server shouldn't crash the request process when we have an error while receiving headers. A case where this could happen is if the header line is too long. See also bfrog's report on ticket #3 on github.
2011-04-05Don't automatically retrieve the peer information for the 'OPTIONS' method.Loïc Hoguin
2011-04-05Handle properly the default Connection value for HTTP/1.0.Loïc Hoguin
Fixes a bug reported by evaxsoftware on IRC.
2011-04-03Add initial SSL transport support.Loïc Hoguin
Code is working but hasn't been benchmarked yet.
2011-04-03Add a dialyze verb to the Makefile for convenience.Loïc Hoguin
2011-04-03Use rebar instead of ./rebar by default in the Makefile.Loïc Hoguin
2011-04-03Fix a grammar error reported by DeadZen on IRC.Loïc Hoguin
2011-04-03Don't ignore the return values in cowboy:stop_listener/1.Loïc Hoguin
2011-04-03Add an AUTHORS file.Loïc Hoguin
2011-04-03Ensure the listening socket gets closed with the listener supervisor.Loïc Hoguin
Moved the Transport:listen call to cowboy_acceptors_sup. This make it depend on a child of cowboy_listener_sup instead of cowboy_sup, which isn't getting shut down when calling cowboy:stop_listener/1 and thus didn't close the listening socket.
2011-04-03Make Cowboy an OTP application again, properly this time.Loïc Hoguin
As requested by many people on IRC Cowboy is now a proper OTP application to support soft code upgrades. It should also be easier to start and stop listeners now using cowboy:start_listener/6 and cowboy:stop_listener/1.
2011-04-02Anonymize and improve the cowboy supervision tree.Loïc Hoguin
* Cowboy isn't an OTP application anymore; just a supervisor. * All processes started by Cowboy are now anonymous. * All processes related to a listener are now part of its supervision tree.
2011-03-29Merge remote-tracking branch 'nox/improve-http-req'Loïc Hoguin
2011-03-29Make the default value the last parameter of HTTP req accessorsAnthony Ramine
This makes cowboy_http_req's qs_val/3, binding/3 and header/3 behave like proplists:get_value/3.
2011-03-29Make HTTP req accessors call themselves with their default default valueAnthony Ramine
Use lists:keyfind/3 in qs_val/3, binding/3 and header/3 and make qs_val/2, binding/2 and header/2 call those.
2011-03-29Fix cowboy_http_req:body with regard to the new accessors default valueAnthony Ramine
header/2 now returns 'undefined' when the header isn't in the request.
2011-03-27Return undefined instead of failing or returning "" when a value doesn't exist.Loïc Hoguin
2011-03-27Use a more efficient variant of string:to_lower to improve performance.Loïc Hoguin
After much testing and experimentation of all kinds I find lists to be both faster and using less memory than binaries for request-line and headers handling. This is more than likely due to the fact that headers are very short and thus do not benefit from the advantages of refc binaries, meaning they're copied, just like lists. The memory usage discrepancy is still a mystery for the most part, although the hoops needed to perform operations on the binaries are probably responsible for the extra memory use. I'm thus giving up on trying to use binaries for request-line and headers. Instead, this commit improves performances even more to the lists code, making lists 5% faster than binaries. Lists are easier to work with too, so I guess it's all a big win for everyone. Of course the request body is still read as a binary, we're using the binary type where it performs best.