Permalink
Browse files

Tidied up code and removed warnings

  • Loading branch information...
1 parent f7a54bf commit 77de19d5a836003128bbe285aba690626cd9f571 OJ Reeves committed Aug 25, 2010
Showing with 10 additions and 20 deletions.
  1. +2 −6 src/openid.erl
  2. +4 −0 src/openid.hrl
  3. +2 −6 src/openid_srv.erl
  4. +0 −4 src/openid_utils.erl
  5. +2 −4 src/yadis.erl
View
@@ -11,10 +11,6 @@
-include("openid.hrl").
--define(GV(E, P), proplists:get_value(E, P)).
--define(GVD(E, P, D), proplists:get_value(E, P, D)).
--define(DBG(Term), io:format("~p: ~p~n", [self(), Term])).
-
%% ------------------------------------------------------------
@@ -25,7 +21,7 @@ discover(Identifier) ->
Req = case yadis:retrieve(Identifier) of
{none, Body} -> html_discovery(Body);
#xrds{}=XRDS -> extract_authreq(XRDS);
- {error, Error} ->
+ {error, _Error} ->
%?DBG({error, Error}),
none
end,
@@ -143,7 +139,7 @@ associate(OpURL) ->
%?DBG({pub_priv, Public, Private, size(Public), size(Private)}),
- RollPub = roll(Public),
+ _RollPub = roll(Public),
%?DBG({rolled, RollPub, size(RollPub)}),
Params = [{"openid.ns", "http://specs.openid.net/auth/2.0"},
View
@@ -6,6 +6,10 @@
%%% Created : 18 Sep 2009 by Brendon Hogger <brendonh@dev.brendonh.org>
%%%-------------------------------------------------------------------
+-define(GV(E, P), proplists:get_value(E, P)).
+-define(GVD(E, P, D), proplists:get_value(E, P, D)).
+-define(DBG(Term), io:format("~p: ~p~n", [self(), Term])).
+
-record(xrdService, {
types,
uris,
View
@@ -43,10 +43,6 @@ start_link(Name) ->
%% gen_server callbacks
%%====================================================================
--define(GV(E, P), proplists:get_value(E, P)).
--define(GVD(E, P, D), proplists:get_value(E, P, D)).
--define(DBG(Term), io:format("~p: ~p~n", [self(), Term])).
-
init(_Args) ->
AuthReqs = ets:new(openid_authreqs, [set, private]),
Assocs = ets:new(openid_assocs, [set, private]),
@@ -248,9 +244,9 @@ verify_signature(ClaimedID, Assoc, Fields) ->
Invalidate = ?GVD("openid.invalidate_handle", Fields, false),
verify_signature(ClaimedID, Invalidate, Assoc, Fields).
-verify_signature(_, _, none, Fields) ->
+verify_signature(_, _, none, _Fields) ->
{error, "Direct verification not implemented yet"};
-verify_signature(ClaimedID, false, #assoc{}=Assoc, Fields) ->
+verify_signature(_ClaimedID, false, #assoc{}=Assoc, Fields) ->
KV = lists:flatten([[Key,$:,?GV("openid." ++ Key, Fields),$\n]
|| Key <- string:tokens(?GV("openid.signed", Fields), ",")]),
MAC = Assoc#assoc.mac,
View
@@ -11,10 +11,6 @@
-include("openid.hrl").
--define(GV(E, P), proplists:get_value(E, P)).
--define(GVD(E, P, D), proplists:get_value(E, P, D)).
--define(DBG(Term), io:format("~p: ~p~n", [self(), Term])).
-
get_tags(Content, Tag) ->
find_tags(Content, {[], Tag, none, none}).
View
@@ -12,8 +12,6 @@
-include("openid.hrl").
-include_lib("xmerl/include/xmerl.hrl").
--define(GVD(E, P, D), proplists:get_value(E, P, D)).
-
-define(HTTP_HEADERS, [{"Accept", "application/xrds+xml"},
{"Connection", "close"},
{"User-Agent", "Erlang/openid"}]).
@@ -48,7 +46,7 @@ retrieve(Identifier) ->
false -> Normalized
end,
- case http:request(get, {URL, ?HTTP_HEADERS}, ?HTTP_OPTIONS, ?REQ_OPTIONS) of
+ case httpc:request(get, {URL, ?HTTP_HEADERS}, ?HTTP_OPTIONS, ?REQ_OPTIONS) of
{ok, {_Status, Headers, Body}} ->
DescriptorURL = get_descriptor_url(Headers, Body),
XRDS = handle_response(DescriptorURL, Headers, Body),
@@ -103,7 +101,7 @@ try_descriptor_url(URL) -> retrieve_step_two(URL).
retrieve_step_two(YadisURL) ->
- case http:request(get, {YadisURL, ?HTTP_HEADERS}, ?HTTP_OPTIONS, ?REQ_OPTIONS) of
+ case httpc:request(get, {YadisURL, ?HTTP_HEADERS}, ?HTTP_OPTIONS, ?REQ_OPTIONS) of
{ok, {_Status, Headers, Body}} ->
get_xrds(?GVD("content-type", Headers, none), Body);
Other ->

0 comments on commit 77de19d

Please sign in to comment.