Browse Source

Rename dispatch() into dispatch_rules().

Loïc Hoguin 14 years ago
parent
commit
ef2673b61e
3 changed files with 4 additions and 3 deletions
  1. 1 1
      include/types.hrl
  2. 2 1
      src/cowboy_dispatcher.erl
  3. 1 1
      src/cowboy_http_protocol.erl

+ 1 - 1
include/types.hrl

@@ -24,4 +24,4 @@
 
 
 -type dispatch_rule() :: {Host::match(), list({Path::match(),
 -type dispatch_rule() :: {Host::match(), list({Path::match(),
 	Handler::module(), Opts::term()})}.
 	Handler::module(), Opts::term()})}.
--type dispatch() :: list(dispatch_rule()).
+-type dispatch_rules() :: list(dispatch_rule()).

+ 2 - 1
src/cowboy_dispatcher.erl

@@ -39,7 +39,8 @@ split_path(Path) ->
 			{string:tokens(Path2, "/"), Path2, Qs}
 			{string:tokens(Path2, "/"), Path2, Qs}
 	end.
 	end.
 
 
--spec match(Host::path_tokens(), Path::path_tokens(), Dispatch::dispatch())
+-spec match(Host::path_tokens(), Path::path_tokens(),
+	Dispatch::dispatch_rules())
 	-> {ok, Handler::module(), Opts::term(), Binds::bindings()}
 	-> {ok, Handler::module(), Opts::term(), Binds::bindings()}
 	| {error, notfound, host} | {error, notfound, path}.
 	| {error, notfound, host} | {error, notfound, path}.
 match(_Host, _Path, []) ->
 match(_Host, _Path, []) ->

+ 1 - 1
src/cowboy_http_protocol.erl

@@ -22,7 +22,7 @@
 -record(state, {
 -record(state, {
 	socket :: inet:socket(),
 	socket :: inet:socket(),
 	transport :: module(),
 	transport :: module(),
-	dispatch :: dispatch(),
+	dispatch :: dispatch_rules(),
 	handler :: {Handler::module(), Opts::term()},
 	handler :: {Handler::module(), Opts::term()},
 	req_empty_lines = 0 :: integer(),
 	req_empty_lines = 0 :: integer(),
 	max_empty_lines :: integer(),
 	max_empty_lines :: integer(),