aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_ssl_transport.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-04-18 13:32:35 +0200
committerLoïc Hoguin <[email protected]>2011-04-18 13:32:35 +0200
commit731d839323e74b95a326001e4e424a1f2b18902e (patch)
tree651bd6c94a3448ca46371d38b3899c88fcbb78b4 /src/cowboy_ssl_transport.erl
parentdb7833f5e8f407ad6f61eadc970966c35d030ead (diff)
downloadcowboy-731d839323e74b95a326001e4e424a1f2b18902e.tar.gz
cowboy-731d839323e74b95a326001e4e424a1f2b18902e.tar.bz2
cowboy-731d839323e74b95a326001e4e424a1f2b18902e.zip
Replace posix() by atom(), for now.
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.
Diffstat (limited to 'src/cowboy_ssl_transport.erl')
-rw-r--r--src/cowboy_ssl_transport.erl16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cowboy_ssl_transport.erl b/src/cowboy_ssl_transport.erl
index 1a85f05..3909409 100644
--- a/src/cowboy_ssl_transport.erl
+++ b/src/cowboy_ssl_transport.erl
@@ -30,7 +30,7 @@ messages() -> {ssl, ssl_closed, ssl_error}.
-spec listen([{port, Port::port_number()} | {certfile, CertPath::string()}
| {keyfile, KeyPath::string()} | {password, Password::string()}])
- -> {ok, LSocket::sslsocket()} | {error, Reason::posix()}.
+ -> {ok, LSocket::sslsocket()} | {error, Reason::atom()}.
listen(Opts) ->
{port, Port} = lists:keyfind(port, 1, Opts),
{certfile, CertFile} = lists:keyfind(certfile, 1, Opts),
@@ -41,7 +41,7 @@ listen(Opts) ->
{certfile, CertFile}, {keyfile, KeyFile}, {password, Password}]).
-spec accept(LSocket::sslsocket(), Timeout::timeout())
- -> {ok, Socket::sslsocket()} | {error, Reason::closed | timeout | posix()}.
+ -> {ok, Socket::sslsocket()} | {error, Reason::closed | timeout | atom()}.
accept(LSocket, Timeout) ->
case ssl:transport_accept(LSocket, Timeout) of
{ok, CSocket} ->
@@ -51,27 +51,27 @@ accept(LSocket, Timeout) ->
end.
-spec recv(Socket::sslsocket(), Length::integer(), Timeout::timeout())
- -> {ok, Packet::term()} | {error, Reason::closed | posix()}.
+ -> {ok, Packet::term()} | {error, Reason::closed | atom()}.
recv(Socket, Length, Timeout) ->
ssl:recv(Socket, Length, Timeout).
-spec send(Socket::sslsocket(), Packet::iolist())
- -> ok | {error, Reason::posix()}.
+ -> ok | {error, Reason::atom()}.
send(Socket, Packet) ->
ssl:send(Socket, Packet).
-spec setopts(Socket::sslsocket(), Opts::list(term()))
- -> ok | {error, Reason::posix()}.
+ -> ok | {error, Reason::atom()}.
setopts(Socket, Opts) ->
ssl:setopts(Socket, Opts).
-spec controlling_process(Socket::sslsocket(), Pid::pid())
- -> ok | {error, Reason::closed | not_owner | posix()}.
+ -> ok | {error, Reason::closed | not_owner | atom()}.
controlling_process(Socket, Pid) ->
ssl:controlling_process(Socket, Pid).
-spec peername(Socket::sslsocket())
- -> {ok, {Address::inet:ip_address(), Port::port_number()}} | {error, posix()}.
+ -> {ok, {Address::inet:ip_address(), Port::port_number()}} | {error, atom()}.
peername(Socket) ->
ssl:peername(Socket).
@@ -82,7 +82,7 @@ close(Socket) ->
%% Internal.
-spec ssl_accept(CSocket::sslsocket(), Timeout::timeout())
- -> {ok, Socket::sslsocket()} | {error, Reason::closed | timeout | posix()}.
+ -> {ok, Socket::sslsocket()} | {error, Reason::closed | timeout | atom()}.
ssl_accept(CSocket, Timeout) ->
case ssl:ssl_accept(CSocket, Timeout) of
ok ->