aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ssl/doc/src/ssl.xml45
-rw-r--r--lib/ssl/src/ssl.erl75
2 files changed, 10 insertions, 110 deletions
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index 27046a8434..d626748af6 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -252,46 +252,6 @@
<name name="reason"/>
</datatype>
- <datatype>
- <name name="http_packet"/>
- </datatype>
-
- <datatype>
- <name name="http_request"/>
- </datatype>
-
- <datatype>
- <name name="http_response"/>
- </datatype>
-
- <datatype>
- <name name="http_header"/>
- </datatype>
-
- <datatype>
- <name name="http_error"/>
- </datatype>
-
- <datatype>
- <name name="http_method"/>
- </datatype>
-
- <datatype>
- <name name="http_uri"/>
- </datatype>
-
- <datatype>
- <name name="http_version"/>
- </datatype>
-
- <datatype>
- <name name="http_field"/>
- </datatype>
-
- <datatype>
- <name name="http_string"/>
- </datatype>
-
<datatype_title>TLS/DTLS OPTION DESCRIPTIONS - COMMON for SERVER and CLIENT</datatype_title>
<datatype>
@@ -1495,6 +1455,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 65578ebe53..e3bb4df1ac 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -238,73 +238,6 @@
bad_certificate_hash_value |
unknown_psk_identity |
no_application_protocol.
--type http_packet() :: http_request() |
- http_response() |
- http_header() |
- http_eoh |
- http_error().
--type http_request() :: {http_request, http_method(), http_uri(), http_version()}.
--type http_response() :: {http_response, http_version(), integer(), http_string()}.
--type http_header() :: {http_header, integer(), http_field(), Reserved :: term(),
- Value :: http_string()}.
--type http_error() :: {http_error, http_string()}.
--type http_method() :: 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE'.
--type http_uri() :: any().
--type http_version() :: {Major :: integer(), Minor :: integer()}.
--type http_field() :: 'Cache-Control' |
- 'Connection' |
- 'Date' |
- 'Pragma' |
- 'Transfer-Encoding' |
- 'Upgrade' |
- 'Via' |
- 'Accept' |
- 'Accept-Charset' |
- 'Accept-Encoding' |
- 'Accept-Language' |
- 'Authorization' |
- 'From' |
- 'Host' |
- 'If-Modified-Since' |
- 'If-Match' |
- 'If-None-Match' |
- 'If-Range' |
- 'If-Unmodified-Since' |
- 'Max-Forwards' |
- 'Proxy-Authorization' |
- 'Range' |
- 'Referer' |
- 'User-Agent' |
- 'Age' |
- 'Location' |
- 'Proxy-Authenticate' |
- 'Public' |
- 'Retry-After' |
- 'Server' |
- 'Vary' |
- 'Warning' |
- 'Www-Authenticate' |
- 'Allow' |
- 'Content-Base' |
- 'Content-Encoding' |
- 'Content-Language' |
- 'Content-Length' |
- 'Content-Location' |
- 'Content-Md5' |
- 'Content-Range' |
- 'Content-Type' |
- 'Etag' |
- 'Expires' |
- 'Last-Modified' |
- 'Accept-Ranges' |
- 'Set-Cookie' |
- 'Set-Cookie2' |
- 'X-Forwarded-For' |
- 'Cookie' |
- 'Keep-Alive' |
- 'Proxy-Connection' |
- http_string().
--type http_string() :: string() | binary().
%% -------------------------------------------------------------------------------------------------------
-type common_option() :: {protocol, protocol()} |
@@ -835,7 +768,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() | http_packet().
+ Data :: binary() | list() | HttpPacket,
+ HttpPacket :: any().
recv(Socket, Length) ->
recv(Socket, Length, infinity).
@@ -843,8 +777,9 @@ recv(Socket, Length) ->
-spec recv(SslSocket, Length, Timeout) -> {ok, Data} | {error, reason()} when
SslSocket :: sslsocket(),
Length :: integer(),
- Data :: binary() | list() | http_packet(),
- 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)->