aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ssl/doc/src/ssl.xml5
-rw-r--r--lib/ssl/src/ssl.erl9
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index 9c170d08af..2ab21f43e0 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -1425,6 +1425,11 @@ fun(srp, Username :: string(), UserState :: term()) ->
<name since="" name="recv" arity="2" />
<name since="" name="recv" arity="3" />
<fsummary>Receives data on a socket.</fsummary>
+ <type_desc variable="HttpPacket">See the description of
+ <c>HttpPacket</c> in
+ <seealso marker="erts:erlang#decode_packet/3"><c>erlang:decode_packet/3</c></seealso>
+ in ERTS.
+ </type_desc>
<desc>
<p>Receives a packet from a socket in passive
mode. A closed socket is indicated by return value
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index bd619d7a0a..51e3b9e6ab 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -217,6 +217,7 @@
bad_certificate_hash_value |
unknown_psk_identity |
no_application_protocol.
+
%% -------------------------------------------------------------------------------------------------------
-type common_option() :: {protocol, protocol()} |
{handshake, handshake_completion()} |
@@ -733,7 +734,8 @@ send(#sslsocket{pid = {ListenSocket, #config{transport_info = Info}}}, Data) ->
-spec recv(SslSocket, Length) -> {ok, Data} | {error, reason()} when
SslSocket :: sslsocket(),
Length :: integer(),
- Data :: binary() | list().
+ Data :: binary() | list() | HttpPacket,
+ HttpPacket :: any().
recv(Socket, Length) ->
recv(Socket, Length, infinity).
@@ -741,8 +743,9 @@ recv(Socket, Length) ->
-spec recv(SslSocket, Length, Timeout) -> {ok, Data} | {error, reason()} when
SslSocket :: sslsocket(),
Length :: integer(),
- Data :: binary() | list(),
- Timeout :: timeout().
+ Data :: binary() | list() | HttpPacket,
+ Timeout :: timeout(),
+ HttpPacket :: any().
recv(#sslsocket{pid = [Pid|_]}, Length, Timeout) when is_pid(Pid),
(is_integer(Timeout) andalso Timeout >= 0) or (Timeout == infinity)->