[erlang-bugs] ssl:ssl_accept/1 discrepancy in spec and doc

Ingela Anderton Andin <>
Mon Jan 10 16:24:08 CET 2011


Hi!

Changed the specs to:

-spec ssl_accept(#sslsocket{}) -> ok | {error, reason()}.
-spec ssl_accept(#sslsocket{} | port(), timeout()| [option()]) ->
            ok | {ok, #sslsocket{}} | {error, reason()}.
-spec ssl_accept(port(), [option()], timeout()) -> {ok, #sslsocket{}} | 
{error, reason()}.

(Not showing the option()-type, here in this mail, it is according to 
the documentation).

I know the functions return value is a bit "schizophrenic" it is due to 
backwards compatibility reasons.

Regards Ingela Erlang/OTP team - Ericsson AB

Kostis Sagonas wrote:
> ssl's published documentation states:
>
>    ssl_accept(ListenSocket) ->
>    ssl_accept(ListenSocket, Timeout) -> ok | {error, Reason}
>
> (see http://www.erlang.org/doc/man/ssl.html#ssl_accept-1)
>
> while its code has the specs:
>
> -spec ssl_accept(#sslsocket{}) -> {ok, #sslsocket{}} | {error, reason()}.
> -spec ssl_accept(#sslsocket{}, list() | timeout()) -> {ok, 
> #sslsocket{}} | {error, reason()}.
>
> One of the two cannot be right.  This should be fixed.
>
>
> Moreover, I do not see why the spec just mentions list() for the 
> options when the documentation explicitly mentions the options of ssl.
>
> Kostis
>
> ________________________________________________________________
> erlang-bugs (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>



More information about the erlang-bugs mailing list