Skip to content

Commit

Permalink
Change prot to protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
couchemar committed Oct 12, 2012
1 parent eb2463c commit b8ea45b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/erlcloud_aws.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
mturk_host="mechanicalturk.amazonaws.com"::string(),
mon_host="monitoring.amazonaws.com"::string(),
mon_port=undefined::non_neg_integer()|undefined,
mon_prot=undefined::string()|undefined,
mon_protocol=undefined::string()|undefined,
access_key_id::string(),
secret_access_key::string()
}).
Expand Down
16 changes: 8 additions & 8 deletions src/erlcloud_aws.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
aws_request_xml(Method, Host, Path, Params, AccessKeyID, SecretAccessKey) ->
Body = aws_request(Method, Host, Path, Params, AccessKeyID, SecretAccessKey),
element(1, xmerl_scan:string(Body)).
aws_request_xml(Method, Prot, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) ->
Body = aws_request(Method, Prot, Host, Port, Path, Params, AccessKeyID, SecretAccessKey),
aws_request_xml(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) ->
Body = aws_request(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey),
element(1, xmerl_scan:string(Body)).

aws_request(Method, Host, Path, Params, AccessKeyID, SecretAccessKey) ->
aws_request(Method, undefined, Host, undefined, Path, Params, AccessKeyID, SecretAccessKey).
aws_request(Method, Prot, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) ->
aws_request(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) ->
Timestamp = format_timestamp(erlang:universaltime()),
QParams = lists:sort([{"Timestamp", Timestamp},
{"SignatureVersion", "2"},
Expand All @@ -30,14 +30,14 @@ aws_request(Method, Prot, Host, Port, Path, Params, AccessKeyID, SecretAccessKey

Query = [QueryToSign, "&Signature=", erlcloud_http:url_encode(Signature)],

case Prot of
undefined -> UProt = "https://";
_ -> UProt = [Prot, "://"]
case Protocol of
undefined -> UProtocol = "https://";
_ -> UProtocol = [Protocol, "://"]
end,

case Port of
undefined -> URL = [UProt, Host, Path];
_ -> URL = [UProt, Host, $:, port_to_str(Port), Path]
undefined -> URL = [UProtocol, Host, Path];
_ -> URL = [UProtocol, Host, $:, port_to_str(Port), Path]
end,

Response =
Expand Down
4 changes: 2 additions & 2 deletions src/erlcloud_mon.erl
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ mon_query(Config, Action, Params) ->
mon_query(Config, Action, Params, ApiVersion) ->
QParams = [{"Action", Action}, {"Version", ApiVersion}|Params],
erlcloud_aws:aws_request_xml(get,
Config#aws_config.mon_prot,
Config#aws_config.mon_protocol,
Config#aws_config.mon_host,
Config#aws_config.mon_port,
"/",
Expand All @@ -266,7 +266,7 @@ configure_host(Host, Port, Protocol) ->
Config = default_config(),
NewConfig = Config#aws_config{mon_host=Host,
mon_port=Port,
mon_prot=Protocol},
mon_protocol=Protocol},
put(aws_config, NewConfig).


Expand Down

0 comments on commit b8ea45b

Please sign in to comment.