From 3e55cb62c9053895412b1cf2a65d54ef90eda34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 25 May 2011 23:02:40 +0200 Subject: Refresh the type specifications. Following discussions on #erlounge. Also fixes compilation in R14B03 and fixes a few underspecs dialyzer warnings. --- include/http.hrl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/http.hrl b/include/http.hrl index 7af6a7e..ff41543 100644 --- a/include/http.hrl +++ b/include/http.hrl @@ -13,15 +13,13 @@ %% ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF %% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --include_lib("kernel/include/inet.hrl"). - -type http_method() :: 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | binary(). -type http_uri() :: '*' | {absoluteURI, http | https, Host::binary(), Port::integer() | undefined, Path::binary()} | {scheme, Scheme::binary(), binary()} | {abs_path, binary()} | binary(). --type http_version() :: {Major::integer(), Minor::integer()}. +-type http_version() :: {Major::non_neg_integer(), Minor::non_neg_integer()}. -type http_header() :: 'Cache-Control' | 'Connection' | 'Date' | 'Pragma' | 'Transfer-Encoding' | 'Upgrade' | 'Via' | 'Accept' | 'Accept-Charset' | 'Accept-Encoding' | 'Accept-Language' | 'Authorization' | 'From' | 'Host' @@ -48,16 +46,15 @@ %% Request. method = 'GET' :: http_method(), version = {1, 1} :: http_version(), - peer = undefined :: undefined | {Address::ip_address(), Port::ip_port()}, + peer = undefined :: undefined | {inet:ip_address(), inet:ip_port()}, host = undefined :: undefined | cowboy_dispatcher:path_tokens(), host_info = undefined :: undefined | cowboy_dispatcher:path_tokens(), raw_host = undefined :: undefined | binary(), - port = undefined :: undefined | ip_port(), + port = undefined :: undefined | inet:ip_port(), path = undefined :: undefined | '*' | cowboy_dispatcher:path_tokens(), path_info = undefined :: undefined | cowboy_dispatcher:path_tokens(), raw_path = undefined :: undefined | binary(), - qs_vals = undefined :: undefined - | list({Name::binary(), Value::binary() | true}), + qs_vals = undefined :: undefined | list({binary(), binary() | true}), raw_qs = undefined :: undefined | binary(), bindings = undefined :: undefined | cowboy_dispatcher:bindings(), headers = [] :: http_headers(), -- cgit v1.2.3