From 54ca9088b4a83b1f7dc22db7ec4c16607fdd8850 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 14 Mar 2012 18:09:12 +0100 Subject: [inets] Initial proposal of module http_uri MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This version of the module was provided by Johan Tjäder. It adds support for more methods (more than http and https). OTP-9983 --- lib/inets/src/http_lib/http_uri.erl | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'lib/inets') diff --git a/lib/inets/src/http_lib/http_uri.erl b/lib/inets/src/http_lib/http_uri.erl index 32c6305a79..d0d1033cf6 100644 --- a/lib/inets/src/http_lib/http_uri.erl +++ b/lib/inets/src/http_lib/http_uri.erl @@ -72,12 +72,15 @@ parse_scheme(AbsURI) -> {error, no_scheme} -> {error, no_scheme}; {StrScheme, Rest} -> - case list_to_atom(http_util:to_lower(StrScheme)) of - Scheme when (Scheme =:= http) orelse (Scheme =:= https) -> - {Scheme, Rest}; - Scheme -> - {error, {not_supported_scheme, Scheme}} - end + %% case list_to_atom(http_util:to_lower(StrScheme)) of + %% Scheme when (Scheme =:= http) orelse (Scheme =:= https) -> + %% {Scheme, Rest}; + %% Scheme -> + %% {error, {not_supported_scheme, Scheme}} + %% end + + %% Allow all schemes even if they are unknown + {list_to_atom(http_util:to_lower(StrScheme)), Rest} end. parse_uri_rest(Scheme, "//" ++ URIPart, Opts) -> @@ -133,10 +136,21 @@ maybe_ipv6_host_with_brackets(Host, Opts) -> Host end. -default_port(http) -> +default_port(http) -> 80; -default_port(https) -> - 443. +default_port(https) -> + 443; + +%%% Added some additional default ports +%%% Other protocols would have to be handled by the calling function +default_port(ftp) -> 21; +default_port(ssh) -> 22; +default_port(sftp) -> 22; +default_port(tftp) -> 69; + +default_port(_) -> + undefined. + int_port(Port) when is_integer(Port) -> Port; -- cgit v1.2.3 From 0c11d7235ed1f0f5c595cf3d9a433adf9c61cc8c Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 14 Mar 2012 18:51:03 +0100 Subject: [inets] A more general version of http_uri:parse OTP-9983 --- lib/inets/src/http_client/httpc.erl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/inets') diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index 5ed2d98ba6..2c51c2081c 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -585,6 +585,10 @@ maybe_encode_uri(#http_options{url_encode = true}, URI) -> maybe_encode_uri(_, URI) -> URI. +uri_parse(AbsURI) -> + http_uri:parse(AbsURI, [{scheme_defaults, [{http, 80}, {https, 443}]}]). + + mk_chunkify_fun(ProcessBody) -> fun(eof_body) -> eof; -- cgit v1.2.3 From a366623c674e993667fedbe01ad52dc4fab5b4f0 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 15 Mar 2012 11:59:40 +0100 Subject: [inets] The module http_uri now officially supported The module http_uri now officially supported. Also, the http_uri:parse/1,2 function has been extended with more scheme support and a way to provide your own scheme info. OTP-9983 --- lib/inets/doc/src/Makefile | 1 + lib/inets/doc/src/http_uri.xml | 160 +++++++++++++++++++++++++++ lib/inets/doc/src/notes.xml | 12 ++ lib/inets/doc/src/ref_man.xml | 9 +- lib/inets/src/http_client/httpc.erl | 26 +++-- lib/inets/src/http_client/httpc_manager.erl | 15 ++- lib/inets/src/http_client/httpc_response.erl | 16 ++- lib/inets/src/http_lib/http_uri.erl | 143 ++++++++++++++++-------- lib/inets/test/httpc_SUITE.erl | 6 +- 9 files changed, 326 insertions(+), 62 deletions(-) create mode 100644 lib/inets/doc/src/http_uri.xml (limited to 'lib/inets') diff --git a/lib/inets/doc/src/Makefile b/lib/inets/doc/src/Makefile index 53d505b102..c4152a1d72 100644 --- a/lib/inets/doc/src/Makefile +++ b/lib/inets/doc/src/Makefile @@ -48,6 +48,7 @@ XML_REF3_FILES = \ inets.xml \ ftp.xml \ tftp.xml \ + http_uri.xml\ httpc.xml\ httpd.xml \ httpd_conf.xml \ diff --git a/lib/inets/doc/src/http_uri.xml b/lib/inets/doc/src/http_uri.xml new file mode 100644 index 0000000000..bd31ae42d2 --- /dev/null +++ b/lib/inets/doc/src/http_uri.xml @@ -0,0 +1,160 @@ + + + + +
+ + 20122012 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + http_uri + + + + + +
+ + http_uri + URI utility module + + +

This module provides utility functions for working with URIs, + according to RFC 3986.

+ +
+ +
+ COMMON DATA TYPES +

Type definitions that are used more than once in + this module:

+ + +
+ +
+ URI DATA TYPES +

Type definitions that are related to URI:

+

For more information about URI, see RFC 3986.

+ + + + +
+ + + + scheme_defaults() -> SchemeDefaults + A list of scheme and their default ports + + SchemeDefaults = [{scheme(), default_scheme_port_number()}] + default_scheme_port_number() = pos_integer() + + +

This function provides a list of the scheme and their default + port numbers currently supported (by default) by this utility.

+ + +
+
+ + + parse(URI) -> {ok, Result} | {error, Reason} + parse(URI, Options) -> {ok, Result} | {error, Reason} + Parse an URI + + URI = uri() + Options = [Option] + Option = {ipv6_host_with_brackets, boolean()} | + {scheme_defaults, scheme_defaults()}] + Result = {Scheme, UserInfo, Host, Port, Path, Query} + UserInfo = user_info() + Host = host() + Port = pos_integer() + Path = path() + Query = query() + Reason = term() + + +

This function is used to parse an URI. If no scheme defaults + are provided, the value of + scheme_defaults + function will be used.

+ +

Note that when parsing an URI with an unknown scheme (that is, + a scheme not found in the scheme defaults) a port number must be + provided or else the parsing will fail.

+ + +
+
+ + + encode(URI) -> HexEncodedURI + + Hex encode an URI + + URI = uri() + HexEncodedURI = string() - Hex encoded uri + + + +

Hex encode an URI.

+ + +
+
+ + + decode(HexEncodedURI) -> URI + + Decode a hex encoded URI + + HexEncodedURI = string() - A possibly hex encoded uri + URI = uri() + + + +

Decode a possibly hex encoded URI.

+ +
+
+ +
+ + + +
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml index f2cd03b6a8..dfdeb4016c 100644 --- a/lib/inets/doc/src/notes.xml +++ b/lib/inets/doc/src/notes.xml @@ -70,6 +70,18 @@

Own Id: OTP-9979

+ +

Utility module + http_uri + now officially supported.

+

Also, the + parse + function has been extended with more + scheme support and a way to provide your own scheme info.

+

Own Id: OTP-9983

+

Aux Id: Seq 12022

+
+ diff --git a/lib/inets/doc/src/ref_man.xml b/lib/inets/doc/src/ref_man.xml index 45d5dfcd0e..e44829827c 100644 --- a/lib/inets/doc/src/ref_man.xml +++ b/lib/inets/doc/src/ref_man.xml @@ -1,10 +1,10 @@ - +
- 19972010 + 19972012 Ericsson AB. All Rights Reserved. @@ -30,8 +30,8 @@

Inets is a container for Internet clients and - servers. Currently a FTP client, a HTTP client and server, and - a tftp client and server has been incorporated in Inets.

+ servers. Currently a FTP client, a HTTP client and server, and + a tftp client and server has been incorporated in Inets.

@@ -45,6 +45,7 @@ +
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index 2c51c2081c..0a30fe1e20 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -158,7 +158,7 @@ request(Method, {http_options, HTTPOptions}, {options, Options}, {profile, Profile}]), - case http_uri:parse(Url, Options) of + case uri_parse(Url, Options) of {error, Reason} -> {error, Reason}; {ok, ParsedUrl} -> @@ -179,7 +179,7 @@ request(Method, {http_options, HTTPOptions}, {options, Options}, {profile, Profile}]), - case http_uri:parse(Url, Options) of + case uri_parse(Url, Options) of {error, Reason} -> {error, Reason}; {ok, ParsedUrl} -> @@ -328,7 +328,7 @@ store_cookies(SetCookieHeaders, Url, Profile) %% Since the Address part is not actually used %% by the manager when storing cookies, we dont %% care about ipv6-host-with-brackets. - {ok, {_, _, Host, Port, Path, _}} = http_uri:parse(Url), + {ok, {_, _, Host, Port, Path, _}} = uri_parse(Url), Address = {Host, Port}, ProfileName = profile_name(Profile), Cookies = httpc_cookie:cookies(SetCookieHeaders, Path, Host), @@ -585,10 +585,6 @@ maybe_encode_uri(#http_options{url_encode = true}, URI) -> maybe_encode_uri(_, URI) -> URI. -uri_parse(AbsURI) -> - http_uri:parse(AbsURI, [{scheme_defaults, [{http, 80}, {https, 443}]}]). - - mk_chunkify_fun(ProcessBody) -> fun(eof_body) -> eof; @@ -1202,6 +1198,22 @@ validate_headers(RequestHeaders, _, _) -> RequestHeaders. +%%-------------------------------------------------------------------------- +%% These functions is just simple wrappers to parse specifically HTTP URIs +%%-------------------------------------------------------------------------- + +scheme_defaults() -> + [{http, 80}, {https, 443}]. + +uri_parse(URI) -> + http_uri:parse(URI, [{scheme_defaults, scheme_defaults()}]). + +uri_parse(URI, Opts) -> + http_uri:parse(URI, [{scheme_defaults, scheme_defaults()} | Opts]). + + +%%-------------------------------------------------------------------------- + child_name2info(undefined) -> {error, no_such_service}; child_name2info(httpc_manager) -> diff --git a/lib/inets/src/http_client/httpc_manager.erl b/lib/inets/src/http_client/httpc_manager.erl index 33b5dfe046..b225b43214 100644 --- a/lib/inets/src/http_client/httpc_manager.erl +++ b/lib/inets/src/http_client/httpc_manager.erl @@ -446,7 +446,7 @@ handle_call(which_cookies, _, #state{cookie_db = CookieDb} = State) -> handle_call({which_cookies, Url, Options}, _, #state{cookie_db = CookieDb} = State) -> ?hcrv("which cookies", [{url, Url}, {options, Options}]), - case http_uri:parse(Url, Options) of + case uri_parse(Url, Options) of {ok, {Scheme, _, Host, Port, Path, _}} -> CookieHeaders = httpc_cookie:header(CookieDb, Scheme, {Host, Port}, Path), @@ -894,6 +894,19 @@ make_db_name(ProfileName, Post) -> list_to_atom(atom_to_list(ProfileName) ++ Post). +%%-------------------------------------------------------------------------- +%% These functions is just simple wrappers to parse specifically HTTP URIs +%%-------------------------------------------------------------------------- + +scheme_defaults() -> + [{http, 80}, {https, 443}]. + +uri_parse(URI, Opts) -> + http_uri:parse(URI, [{scheme_defaults, scheme_defaults()} | Opts]). + + +%%-------------------------------------------------------------------------- + call(ProfileName, Msg) -> Timeout = infinity, diff --git a/lib/inets/src/http_client/httpc_response.erl b/lib/inets/src/http_client/httpc_response.erl index 919115a23a..23924e355e 100644 --- a/lib/inets/src/http_client/httpc_response.erl +++ b/lib/inets/src/http_client/httpc_response.erl @@ -342,7 +342,7 @@ redirect(Response = {StatusLine, Headers, Body}, Request) -> RedirUrl -> UrlParseOpts = [{ipv6_host_with_brackets, Request#request.ipv6_host_with_brackets}], - case http_uri:parse(RedirUrl, UrlParseOpts) of + case uri_parse(RedirUrl, UrlParseOpts) of {error, no_scheme} when (Request#request.settings)#http_options.relaxed -> NewLocation = fix_relative_uri(Request, RedirUrl), @@ -437,3 +437,17 @@ format_response({StatusLine, Headers, Body}) -> end, {{StatusLine, http_response:header_list(Headers), NewBody}, Data}. +%%-------------------------------------------------------------------------- +%% These functions is just simple wrappers to parse specifically HTTP URIs +%%-------------------------------------------------------------------------- + +scheme_defaults() -> + [{http, 80}, {https, 443}]. + +uri_parse(URI, Opts) -> + http_uri:parse(URI, [{scheme_defaults, scheme_defaults()} | Opts]). + + +%%-------------------------------------------------------------------------- + + diff --git a/lib/inets/src/http_lib/http_uri.erl b/lib/inets/src/http_lib/http_uri.erl index d0d1033cf6..5962001c3a 100644 --- a/lib/inets/src/http_lib/http_uri.erl +++ b/lib/inets/src/http_lib/http_uri.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2011. All Rights Reserved. +%% Copyright Ericsson AB 2006-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -17,39 +17,95 @@ %% %CopyrightEnd% %% %% -%% RFC 3986 +%% This is from chapter 3, Syntax Components, of RFC 3986: +%% +%% The generic URI syntax consists of a hierarchical sequence of +%% components referred to as the scheme, authority, path, query, and +%% fragment. +%% +%% URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] +%% +%% hier-part = "//" authority path-abempty +%% / path-absolute +%% / path-rootless +%% / path-empty +%% +%% The scheme and path components are required, though the path may be +%% empty (no characters). When authority is present, the path must +%% either be empty or begin with a slash ("/") character. When +%% authority is not present, the path cannot begin with two slash +%% characters ("//"). These restrictions result in five different ABNF +%% rules for a path (Section 3.3), only one of which will match any +%% given URI reference. +%% +%% The following are two example URIs and their component parts: +%% +%% foo://example.com:8042/over/there?name=ferret#nose +%% \_/ \______________/\_________/ \_________/ \__/ +%% | | | | | +%% scheme authority path query fragment +%% | _____________________|__ +%% / \ / \ +%% urn:example:animal:ferret:nose +%% +%% scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) +%% authority = [ userinfo "@" ] host [ ":" port ] +%% userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) +%% %% -module(http_uri). -export([parse/1, parse/2, + scheme_defaults/0, encode/1, decode/1]). +-export_type([scheme/0, default_scheme_port_number/0]). + %%%========================================================================= %%% API %%%========================================================================= + +-type scheme() :: atom(). +-type default_scheme_port_number() :: pos_integer(). + +-spec scheme_defaults() -> + [{scheme(), default_scheme_port_number()}]. + +scheme_defaults() -> + [{http, 80}, + {https, 443}, + {ftp, 21}, + {ssh, 22}, + {sftp, 22}, + {tftp, 69}]. + parse(AbsURI) -> parse(AbsURI, []). parse(AbsURI, Opts) -> - case parse_scheme(AbsURI) of + case parse_scheme(AbsURI, Opts) of {error, Reason} -> {error, Reason}; - {Scheme, Rest} -> - case (catch parse_uri_rest(Scheme, Rest, Opts)) of - {UserInfo, Host, Port, Path, Query} -> + {Scheme, DefaultPort, Rest} -> + case (catch parse_uri_rest(Scheme, DefaultPort, Rest, Opts)) of + {ok, {UserInfo, Host, Port, Path, Query}} -> {ok, {Scheme, UserInfo, Host, Port, Path, Query}}; + {error, Reason} -> + {error, {Reason, Scheme, AbsURI}}; _ -> - {error, {malformed_url, AbsURI}} + {error, {malformed_url, Scheme, AbsURI}} end end. +reserved() -> + sets:from_list([$;, $:, $@, $&, $=, $+, $,, $/, $?, + $#, $[, $], $<, $>, $\", ${, $}, $|, + $\\, $', $^, $%, $ ]). + encode(URI) -> - Reserved = sets:from_list([$;, $:, $@, $&, $=, $+, $,, $/, $?, - $#, $[, $], $<, $>, $\", ${, $}, $|, - $\\, $', $^, $%, $ ]), - %% lists:append(lists:map(fun(Char) -> uri_encode(Char, Reserved) end, URI)). + Reserved = reserved(), lists:append([uri_encode(Char, Reserved) || Char <- URI]). decode(String) -> @@ -67,23 +123,31 @@ do_decode([]) -> %%% Internal functions %%%======================================================================== -parse_scheme(AbsURI) -> +which_scheme_defaults(Opts) -> + Key = scheme_defaults, + case lists:keysearch(Key, 1, Opts) of + {value, {Key, SchemeDefaults}} -> + SchemeDefaults; + false -> + scheme_defaults() + end. + +parse_scheme(AbsURI, Opts) -> case split_uri(AbsURI, ":", {error, no_scheme}, 1, 1) of {error, no_scheme} -> {error, no_scheme}; - {StrScheme, Rest} -> - %% case list_to_atom(http_util:to_lower(StrScheme)) of - %% Scheme when (Scheme =:= http) orelse (Scheme =:= https) -> - %% {Scheme, Rest}; - %% Scheme -> - %% {error, {not_supported_scheme, Scheme}} - %% end - - %% Allow all schemes even if they are unknown - {list_to_atom(http_util:to_lower(StrScheme)), Rest} + {SchemeStr, Rest} -> + Scheme = list_to_atom(http_util:to_lower(SchemeStr)), + SchemeDefaults = which_scheme_defaults(Opts), + case lists:keysearch(Scheme, 1, SchemeDefaults) of + {value, {Scheme, DefaultPort}} -> + {Scheme, DefaultPort, Rest}; + false -> + {Scheme, no_default_port, Rest} + end end. -parse_uri_rest(Scheme, "//" ++ URIPart, Opts) -> +parse_uri_rest(Scheme, DefaultPort, "//" ++ URIPart, Opts) -> {Authority, PathQuery} = case split_uri(URIPart, "/", URIPart, 1, 0) of Split = {_, _} -> @@ -96,26 +160,25 @@ parse_uri_rest(Scheme, "//" ++ URIPart, Opts) -> {URIPart,""} end end, - {UserInfo, HostPort} = split_uri(Authority, "@", {"", Authority}, 1, 1), - {Host, Port} = parse_host_port(Scheme, HostPort, Opts), + {Host, Port} = parse_host_port(Scheme, DefaultPort, HostPort, Opts), {Path, Query} = parse_path_query(PathQuery), - {UserInfo, Host, Port, Path, Query}. + {ok, {UserInfo, Host, Port, Path, Query}}. parse_path_query(PathQuery) -> {Path, Query} = split_uri(PathQuery, "\\?", {PathQuery, ""}, 1, 0), {path(Path), Query}. -parse_host_port(Scheme,"[" ++ HostPort, Opts) -> %ipv6 - DefaultPort = default_port(Scheme), +%% In this version of the function, we no longer need +%% the Scheme argument, but just in case... +parse_host_port(_Scheme, DefaultPort, "[" ++ HostPort, Opts) -> %ipv6 {Host, ColonPort} = split_uri(HostPort, "\\]", {HostPort, ""}, 1, 1), Host2 = maybe_ipv6_host_with_brackets(Host, Opts), {_, Port} = split_uri(ColonPort, ":", {"", DefaultPort}, 0, 1), {Host2, int_port(Port)}; -parse_host_port(Scheme, HostPort, _Opts) -> - DefaultPort = default_port(Scheme), +parse_host_port(_Scheme, DefaultPort, HostPort, _Opts) -> {Host, Port} = split_uri(HostPort, ":", {HostPort, DefaultPort}, 1, 1), {Host, int_port(Port)}. @@ -136,26 +199,14 @@ maybe_ipv6_host_with_brackets(Host, Opts) -> Host end. -default_port(http) -> - 80; -default_port(https) -> - 443; - -%%% Added some additional default ports -%%% Other protocols would have to be handled by the calling function -default_port(ftp) -> 21; -default_port(ssh) -> 22; -default_port(sftp) -> 22; -default_port(tftp) -> 69; - -default_port(_) -> - undefined. - int_port(Port) when is_integer(Port) -> Port; int_port(Port) when is_list(Port) -> - list_to_integer(Port). + list_to_integer(Port); +%% This is the case where no port was found and there was no default port +int_port(no_default_port) -> + throw({error, no_default_port}). path("") -> "/"; diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index 61bb5214f3..a116edef77 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -1974,7 +1974,7 @@ parse_url(Config) when is_list(Config) -> http_uri:parse("http://[2010:836B:4179::836B:4179]/foobar.html", [{foo, false}]), {error, - {malformed_url,"http://2010:836B:4179::836B:4179/foobar.html"}} = + {malformed_url, _, "http://2010:836B:4179::836B:4179/foobar.html"}} = http_uri:parse("http://2010:836B:4179::836B:4179/foobar.html"), %% ipv4 @@ -1990,8 +1990,8 @@ parse_url(Config) when is_list(Config) -> http_uri:parse("http://nisse:foobar@localhost:8888/foobar.html"), %% Scheme error - {error,no_scheme} = http_uri:parse("localhost/foobar.html"), - {error,{not_supported_scheme,localhost}} = + {error, no_scheme} = http_uri:parse("localhost/foobar.html"), + {error, {malformed_url, _, _}} = http_uri:parse("localhost:8888/foobar.html"), %% Query -- cgit v1.2.3 From dbf9c223cf7efd8fc6143b573fcc12637d5ae9ae Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 15 Mar 2012 12:00:58 +0100 Subject: [inets] Some documentation cleanup OTP-9983 --- lib/inets/doc/src/book.xml | 4 +- lib/inets/doc/src/fascicules.xml | 2 +- lib/inets/doc/src/ftp_client.xml | 4 +- lib/inets/doc/src/httpd_conf.xml | 58 ++++++---- lib/inets/doc/src/httpd_socket.xml | 29 +++-- lib/inets/doc/src/httpd_util.xml | 4 +- lib/inets/doc/src/inets_services.xml | 4 +- lib/inets/doc/src/mod_alias.xml | 92 +++++++++------ lib/inets/doc/src/mod_auth.xml | 133 +++++++++++++-------- lib/inets/doc/src/notes_history.xml | 4 +- lib/inets/doc/src/part.xml | 4 +- lib/inets/doc/src/part_notes.xml | 4 +- lib/inets/doc/src/part_notes_history.xml | 4 +- lib/inets/doc/src/tftp.xml | 191 +++++++++++++++++++------------ 14 files changed, 331 insertions(+), 206 deletions(-) (limited to 'lib/inets') diff --git a/lib/inets/doc/src/book.xml b/lib/inets/doc/src/book.xml index 7da0abd98f..51cbb2d963 100644 --- a/lib/inets/doc/src/book.xml +++ b/lib/inets/doc/src/book.xml @@ -1,10 +1,10 @@ - +
- 19972009 + 19972012 Ericsson AB. All Rights Reserved. diff --git a/lib/inets/doc/src/fascicules.xml b/lib/inets/doc/src/fascicules.xml index 101e745722..ea3b988882 100644 --- a/lib/inets/doc/src/fascicules.xml +++ b/lib/inets/doc/src/fascicules.xml @@ -1,4 +1,4 @@ - + diff --git a/lib/inets/doc/src/ftp_client.xml b/lib/inets/doc/src/ftp_client.xml index 7f62a453a6..b44674d997 100644 --- a/lib/inets/doc/src/ftp_client.xml +++ b/lib/inets/doc/src/ftp_client.xml @@ -1,10 +1,10 @@ - +
- 20042009 + 20042012 Ericsson AB. All Rights Reserved. diff --git a/lib/inets/doc/src/httpd_conf.xml b/lib/inets/doc/src/httpd_conf.xml index a1ad76a8ae..fc34f14ec3 100644 --- a/lib/inets/doc/src/httpd_conf.xml +++ b/lib/inets/doc/src/httpd_conf.xml @@ -1,10 +1,10 @@ - +
- 19972009 + 19972012 Ericsson AB. All Rights Reserved. @@ -33,11 +33,14 @@ Web server API programmer.

This module provides the Erlang Webserver API programmer with - utility functions for adding run-time configuration directives.

+ utility functions for adding run-time configuration directives.

+ +
+ - check_enum(EnumString,ValidEnumStrings) -> Result + check_enum(EnumString, ValidEnumStrings) -> Result Check if string is a valid enumeration. EnumString = string() @@ -47,10 +50,13 @@

check_enum/2 checks if EnumString is a valid - enumeration of ValidEnumStrings in which case it is - returned as an atom.

+ enumeration of ValidEnumStrings in which case it is + returned as an atom.

+ +
+ clean(String) -> Stripped Remove leading and/or trailing white spaces. @@ -60,9 +66,12 @@

clean/1 removes leading and/or trailing white spaces - from String.

+ from String.

+ +
+ custom_clean(String,Before,After) -> Stripped Remove leading and/or trailing white spaces and custom characters. @@ -73,11 +82,14 @@

custom_clean/3 removes leading and/or trailing white - spaces and custom characters from String. Before - and After are regular expressions, as defined in - regexp(3), describing the custom characters.

+ spaces and custom characters from String. Before + and After are regular expressions, as defined in + regexp(3), describing the custom characters.

+ +
+ is_directory(FilePath) -> Result Check if a file path is a directory. @@ -91,13 +103,16 @@

is_directory/1 checks if FilePath is a - directory in which case it is returned. Please read - file(3) for a description of enoent, - eaccess and enotdir. The definition of - the file info record can be found by including file.hrl - from the kernel application, see file(3).

+ directory in which case it is returned. Please read + file(3) for a description of enoent, + eaccess and enotdir. The definition of + the file info record can be found by including file.hrl + from the kernel application, see file(3).

+ +
+ is_file(FilePath) -> Result Check if a file path is a regular file. @@ -111,13 +126,16 @@

is_file/1 checks if FilePath is a regular - file in which case it is returned. Read file(3) for a - description of enoent, eaccess and - enotdir. The definition of the file info record can be - found by including file.hrl from the kernel application, - see file(3).

+ file in which case it is returned. Read file(3) for a + description of enoent, eaccess and + enotdir. The definition of the file info record can be + found by including file.hrl from the kernel application, + see file(3).

+ +
+ make_integer(String) -> Result Return an integer representation of a string. diff --git a/lib/inets/doc/src/httpd_socket.xml b/lib/inets/doc/src/httpd_socket.xml index fba1a58d3a..58cd2ec575 100644 --- a/lib/inets/doc/src/httpd_socket.xml +++ b/lib/inets/doc/src/httpd_socket.xml @@ -1,10 +1,10 @@ - +
- 19972009 + 19972012 Ericsson AB. All Rights Reserved. @@ -33,10 +33,13 @@ Web server API programmer.

This module provides the Erlang Web server API module programmer - with utility functions for generic sockets communication. The - appropriate communication mechanism is transparently used, that - is ip_comm or ssl.

+ with utility functions for generic sockets communication. The + appropriate communication mechanism is transparently used, that + is ip_comm or ssl.

+ +
+ deliver(SocketType, Socket, Data) -> Result @@ -50,11 +53,14 @@

deliver/3 sends the Binary over the - Socket using the specified SocketType. Socket - and SocketType should be the socket and the socket_type form - the mod record as defined in httpd.hrl

+ Socket using the specified SocketType. Socket + and SocketType should be the socket and the socket_type form + the mod record as defined in httpd.hrl

+ +
+ peername(SocketType,Socket) -> {Port,IPAddress} Return the port and IP-address of the remote socket. @@ -67,9 +73,12 @@

peername/3 returns the Port and - IPAddress of the remote Socket.

+ IPAddress of the remote Socket.

+ +
+ resolve() -> HostName Return the official name of the current host. @@ -79,7 +88,7 @@

resolve/0 returns the official HostName of - the current host.

+ the current host.

diff --git a/lib/inets/doc/src/httpd_util.xml b/lib/inets/doc/src/httpd_util.xml index 6ac2b13c72..9f290084d2 100644 --- a/lib/inets/doc/src/httpd_util.xml +++ b/lib/inets/doc/src/httpd_util.xml @@ -1,10 +1,10 @@ - +
- 19972010 + 19972012 Ericsson AB. All Rights Reserved. diff --git a/lib/inets/doc/src/inets_services.xml b/lib/inets/doc/src/inets_services.xml index c274d67f19..e282050b12 100644 --- a/lib/inets/doc/src/inets_services.xml +++ b/lib/inets/doc/src/inets_services.xml @@ -1,10 +1,10 @@ - +
- 19972009 + 19972012 Ericsson AB. All Rights Reserved. diff --git a/lib/inets/doc/src/mod_alias.xml b/lib/inets/doc/src/mod_alias.xml index c783b99b23..265a1b8e76 100644 --- a/lib/inets/doc/src/mod_alias.xml +++ b/lib/inets/doc/src/mod_alias.xml @@ -1,10 +1,10 @@ - +
- 19972009 + 19972012 Ericsson AB. All Rights Reserved. @@ -32,8 +32,11 @@ URL aliasing.

Erlang Webserver Server internal API for handling of things - such as interaction data exported by the mod_alias module.

+ such as interaction data exported by the mod_alias module.

+ +
+ default_index(ConfigDB, Path) -> NewPath @@ -45,17 +48,20 @@

If Path is a directory, default_index/2, it starts - searching for resources or files that are specified in the config - directive DirectoryIndex. - If an appropriate resource or file is found, it is appended to - the end of Path and then returned. Path is - returned unaltered, if no appropriate - file is found, or if Path is not a directory. - config_db() is the server config file in ETS table format - as described in - Inets Users Guide..

+ searching for resources or files that are specified in the config + directive DirectoryIndex. + If an appropriate resource or file is found, it is appended to + the end of Path and then returned. Path is + returned unaltered, if no appropriate + file is found, or if Path is not a directory. + config_db() is the server config file in ETS table format + as described in + Inets Users Guide..

+ +
+ path(PathData, ConfigDB, RequestURI) -> Path Return the actual file path to a URL. @@ -67,15 +73,19 @@

path/3 returns the actual file Path in the - RequestURI (See RFC 1945). If the interaction data - {real_name,{Path,AfterPath}} has been exported by - mod_alias; - Path is returned. If no interaction data has been - exported, ServerRoot is used to - generate a file Path. config_db() and - interaction_data() are as defined in Inets Users Guide.

+ RequestURI (See RFC 1945). If the interaction data + {real_name,{Path,AfterPath}} has been exported by + mod_alias; + Path is returned. If no interaction data has been + exported, ServerRoot is used to + generate a file Path. config_db() and + interaction_data() are as defined in + Inets Users Guide.

+ +
+ real_name(ConfigDB, RequestURI, Aliases) -> Ret Expand a request uri using Alias config directives. @@ -89,18 +99,24 @@

real_name/3 traverses Aliases, typically - extracted from ConfigDB, and matches each - FakeName with RequestURI. If a match is found - FakeName is replaced with RealName in the - match. The resulting path is split into two parts, that - is ShortPath and AfterPath as defined in httpd_util:split_path/1. - Path is generated from ShortPath, that is - the result from default_index/2 with - ShortPath as an argument. - config_db() is the server config file in ETS table - format as described in Inets User Guide..

+ extracted from ConfigDB, and matches each + FakeName with RequestURI. If a match is found + FakeName is replaced with RealName in the + match. The resulting path is split into two parts, that + is ShortPath and AfterPath as defined in + httpd_util:split_path/1. + Path is generated from ShortPath, that is + the result from + default_index/2 with + ShortPath as an argument. + config_db() is the server config file in ETS table + format as described in + Inets User Guide..

+ +
+ real_script_name(ConfigDB,RequestURI,ScriptAliases) -> Ret Expand a request uri using ScriptAlias config directives. @@ -114,15 +130,15 @@

real_name/3 traverses ScriptAliases, - typically extracted from ConfigDB, and matches each - FakeName with RequestURI. If a match is found - FakeName is replaced with RealName in the - match. If the resulting match is not an executable script - not_a_script is returned. If it is a script the - resulting script path is in two parts, that is - ShortPath and AfterPath as defined in httpd_util:split_script_path/1. - config_db() is the server config file in ETS table - format as described in Inets Users Guide..

+ typically extracted from ConfigDB, and matches each + FakeName with RequestURI. If a match is found + FakeName is replaced with RealName in the + match. If the resulting match is not an executable script + not_a_script is returned. If it is a script the + resulting script path is in two parts, that is + ShortPath and AfterPath as defined in httpd_util:split_script_path/1. + config_db() is the server config file in ETS table + format as described in Inets Users Guide..

diff --git a/lib/inets/doc/src/mod_auth.xml b/lib/inets/doc/src/mod_auth.xml index 2134ebeeae..7801567862 100644 --- a/lib/inets/doc/src/mod_auth.xml +++ b/lib/inets/doc/src/mod_auth.xml @@ -1,4 +1,4 @@ - + @@ -32,8 +32,11 @@ User authentication using text files, dets or mnesia database.

This module provides for basic user authentication using - textual files, dets databases as well as mnesia databases.

+ textual files, dets databases as well as mnesia databases.

+ +
+ add_user(UserName, Options) -> true| {error, Reason} @@ -55,12 +58,17 @@ -

add_user/2, add_user/5 and add_user/6 adds a user to the user - database. If the operation is successful, this function returns - true. If an error occurs, {error,Reason} is returned. When add_user/2 - is called the Password, UserData Port and Dir options is mandatory.

+

add_user/2, add_user/5 and add_user/6 adds a + user to the user + database. If the operation is successful, this function returns + true. If an error occurs, {error,Reason} is returned. + When add_user/2 is called the Password, + UserData Port and Dir options is mandatory.

+ +
+ delete_user(UserName,Options) -> true | {error, Reason} delete_user(UserName, Port, Dir) -> true | {error, Reason} @@ -79,13 +87,16 @@

delete_user/2, delete_user/3 and delete_user/4 - deletes a user - from the user database. If the operation is successful, this - function returns true. If an error occurs, - {error,Reason} is returned. When delete_user/2 is - called the Port and Dir options are mandatory.

+ deletes a user from the user database. + If the operation is successful, this function returns true. + If an error occurs, {error,Reason} is returned. + When delete_user/2 is called the Port and Dir options + are mandatory.

+ +
+ get_user(UserName,Options) -> {ok, #httpd_user} |{error, Reason} get_user(UserName, Port, Dir) -> {ok, #httpd_user} | {error, Reason} @@ -104,12 +115,15 @@

get_user/2, get_user/3 and get_user/4 returns a - httpd_user record containing the userdata for a - specific user. If the user cannot be found, {error, Reason} - is returned. When get_user/2 is called the Port and Dir - options are mandatory.

+ httpd_user record containing the userdata for a + specific user. If the user cannot be found, {error, Reason} + is returned. When get_user/2 is called the Port and Dir + options are mandatory.

+ +
+ list_users(Options) -> {ok, Users} | {error, Reason} list_users(Port, Dir) -> {ok, Users} | {error, Reason} @@ -127,12 +141,16 @@ -

list_users/1, list_users/2 and list_users/3 returns a list - of users in the user database for a specific Port/Dir. - When list_users/1 is called the Port and Dir - options are mandatory.

+

list_users/1, list_users/2 and list_users/3 + returns a list + of users in the user database for a specific Port/Dir. + When list_users/1 is called the Port and Dir + options are mandatory.

+ +
+ add_group_member(GroupName, UserName, Options) -> true | {error, Reason} add_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason} @@ -151,13 +169,18 @@ -

add_group_member/3, add_group_member/4 and add_group_member/5 - adds a user to a group. If the group does not exist, it - is created and the user is added to the group. Upon successful - operation, this function returns true. When add_group_members/3 - is called the Port and Dir options are mandatory.

+

add_group_member/3, add_group_member/4 and + add_group_member/5 + adds a user to a group. If the group does not exist, it + is created and the user is added to the group. Upon successful + operation, this function returns true. + When add_group_members/3 + is called the Port and Dir options are mandatory.

+ +
+ delete_group_member(GroupName, UserName, Options) -> true | {error, Reason} delete_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason} @@ -176,13 +199,17 @@ -

delete_group_member/3, delete_group_member/4 and delete_group_member/5 deletes a user from a group. - If the group or the user does not exist, - this function returns an error, otherwise it returns true. - When delete_group_member/3 is called the Port and Dir options - are mandatory.

+

delete_group_member/3, delete_group_member/4 and + delete_group_member/5 deletes a user from a group. + If the group or the user does not exist, + this function returns an error, otherwise it returns true. + When delete_group_member/3 is called the Port and Dir options + are mandatory.

+ +
+ list_group_members(GroupName, Options) -> {ok, Users} | {error, Reason} list_group_members(GroupName, Port, Dir) -> {ok, Users} | {error, Reason} @@ -201,13 +228,17 @@ -

list_group_members/2, list_group_members/3 and list_group_members/4 - lists the members of a specified group. If the group does not - exist or there is an error, {error, Reason} is returned. - When list_group_members/2 is called the Port and Dir options - are mandatory.

+

list_group_members/2, list_group_members/3 and + list_group_members/4 + lists the members of a specified group. If the group does not + exist or there is an error, {error, Reason} is returned. + When list_group_members/2 is called the Port and Dir options + are mandatory.

+ +
+ list_groups(Options) -> {ok, Groups} | {error, Reason} list_groups(Port, Dir) -> {ok, Groups} | {error, Reason} @@ -225,12 +256,16 @@ -

list_groups/1, list_groups/2 and list_groups/3 lists all - the groups available. If there is an error, {error, Reason} - is returned. When list_groups/1 is called the Port and Dir options - are mandatory.

+

list_groups/1, list_groups/2 and list_groups/3 + lists all the groups available. + If there is an error, {error, Reason} is returned. + When list_groups/1 is called the Port and Dir options + are mandatory.

+ +
+ delete_group(GroupName, Options) -> true | {error,Reason} <name>delete_group(GroupName, Port, Dir) -> true | {error, Reason} delete_group(GroupName, Address, Port, Dir) -> true | {error, Reason} @@ -247,12 +282,16 @@ -

delete_group/2, delete_group/3 and delete_group/4 deletes the - group specified and returns true. If there is an error, - {error, Reason} is returned. When delete_group/2 is called the - Port and Dir options are mandatory.

+

delete_group/2, delete_group/3 and delete_group/4 + deletes the group specified and returns true. + If there is an error, {error, Reason} is returned. + When delete_group/2 is called the + Port and Dir options are mandatory.

+ +
+ update_password(Port, Dir, OldPassword, NewPassword, NewPassword) -> ok | {error, Reason} update_password(Address,Port, Dir, OldPassword, NewPassword, NewPassword) -> ok | {error, Reason} @@ -268,10 +307,12 @@ -

update_password/5 and update_password/6 Updates the AuthAccessPassword - for the specified directory. If NewPassword is equal to "NoPassword" no password is requires to - change authorisation data. If NewPassword is equal to "DummyPassword" no changes can be done - without changing the password first.

+

update_password/5 and update_password/6 + Updates the AuthAccessPassword for the specified directory. + If NewPassword is equal to "NoPassword" no password is requires to + change authorisation data. + If NewPassword is equal to "DummyPassword" no changes can be done + without changing the password first.

diff --git a/lib/inets/doc/src/notes_history.xml b/lib/inets/doc/src/notes_history.xml index 151bec375e..bd59c1ba47 100644 --- a/lib/inets/doc/src/notes_history.xml +++ b/lib/inets/doc/src/notes_history.xml @@ -1,10 +1,10 @@ - +
- 20042011 + 20042012 Ericsson AB. All Rights Reserved. diff --git a/lib/inets/doc/src/part.xml b/lib/inets/doc/src/part.xml index 36955df6b3..3b6734a9b8 100644 --- a/lib/inets/doc/src/part.xml +++ b/lib/inets/doc/src/part.xml @@ -1,10 +1,10 @@ - +
- 20042009 + 20042012 Ericsson AB. All Rights Reserved. diff --git a/lib/inets/doc/src/part_notes.xml b/lib/inets/doc/src/part_notes.xml index 21f464318b..81b0dedbfa 100644 --- a/lib/inets/doc/src/part_notes.xml +++ b/lib/inets/doc/src/part_notes.xml @@ -1,10 +1,10 @@ - +
- 20022009 + 20022012 Ericsson AB. All Rights Reserved. diff --git a/lib/inets/doc/src/part_notes_history.xml b/lib/inets/doc/src/part_notes_history.xml index 3c1e6f5232..f714a6d2e3 100644 --- a/lib/inets/doc/src/part_notes_history.xml +++ b/lib/inets/doc/src/part_notes_history.xml @@ -1,10 +1,10 @@ - +
- 20042009 + 20042012 Ericsson AB. All Rights Reserved. diff --git a/lib/inets/doc/src/tftp.xml b/lib/inets/doc/src/tftp.xml index 96d6ae0dd5..0b3e93a153 100644 --- a/lib/inets/doc/src/tftp.xml +++ b/lib/inets/doc/src/tftp.xml @@ -1,10 +1,10 @@ - +
- 20062009 + 20062012 Ericsson AB. All Rights Reserved. @@ -218,6 +218,8 @@ 5 times when the timeout expires.

+ + @@ -231,11 +233,14 @@

Starts a daemon process which listens for udp packets on a - port. When it receives a request for read or write it spawns - a temporary server process which handles the actual transfer - of the (virtual) file.

+ port. When it receives a request for read or write it spawns + a temporary server process which handles the actual transfer + of the (virtual) file.

+ +
+ read_file(RemoteFilename, LocalFilename, Options) -> {ok, LastCallbackState} | {error, Reason} Read a (virtual) file from a TFTP server @@ -248,23 +253,26 @@

Reads a (virtual) file RemoteFilename from a TFTP - server.

-

If LocalFilename is the atom binary, - tftp_binary is used as callback module. It concatenates - all transferred blocks and returns them as one single binary - in LastCallbackState.

-

If LocalFilename is a string and there are no - registered callback modules, tftp_file is used as - callback module. It writes each transferred block to the file - named LocalFilename and returns the number of - transferred bytes in LastCallbackState.

-

If LocalFilename is a string and there are registered - callback modules, LocalFilename is tested against - the regexps of these and the callback module corresponding to - the first match is used, or an error tuple is returned if no - matching regexp is found.

+ server.

+

If LocalFilename is the atom binary, + tftp_binary is used as callback module. It concatenates + all transferred blocks and returns them as one single binary + in LastCallbackState.

+

If LocalFilename is a string and there are no + registered callback modules, tftp_file is used as + callback module. It writes each transferred block to the file + named LocalFilename and returns the number of + transferred bytes in LastCallbackState.

+

If LocalFilename is a string and there are registered + callback modules, LocalFilename is tested against + the regexps of these and the callback module corresponding to + the first match is used, or an error tuple is returned if no + matching regexp is found.

+ +
+ write_file(RemoteFilename, LocalFilename, Options) -> {ok, LastCallbackState} | {error, Reason} Write a (virtual) file to a TFTP server @@ -288,10 +296,12 @@ block by block and returns the number of transferred bytes in LastCallbackState.

If LocalFilename is a string and there are registered - callback modules, LocalFilename is tested against - the regexps of these and the callback module corresponding to - the first match is used, or an error tuple is returned if no - matching regexp is found.

+ callback modules, LocalFilename is tested against + the regexps of these and the callback module corresponding to + the first match is used, or an error tuple is returned if no + matching regexp is found.

+ +
@@ -304,8 +314,9 @@ Reason = term() -

Returns info about all TFTP daemon processes. -

+

Returns info about all TFTP daemon processes.

+ +
@@ -318,8 +329,9 @@ Reason = term() -

Returns info about all TFTP server processes. -

+

Returns info about all TFTP server processes.

+ +
@@ -332,6 +344,8 @@

Returns info about a TFTP daemon, server or client process.

+ +
@@ -346,8 +360,9 @@ Reason = term() -

Changes config for all TFTP daemon processes -

+

Changes config for all TFTP daemon processes.

+ +
@@ -362,8 +377,9 @@ Reason = term() -

Changes config for all TFTP server processes -

+

Changes config for all TFTP server processes.

+ +
@@ -378,8 +394,11 @@

Changes config for a TFTP daemon, server or client process

+ +
+ start() -> ok | {error, Reason} Start the Inets application @@ -442,8 +461,9 @@ by the already ongoing connection on the server side. By not setting up yet another connection, in parallel with the ongoing one, the server will - consumer lesser resources. -

+ consumer lesser resources.

+ + @@ -468,17 +488,20 @@ Text = string() -

Prepares to open a file on the client side.

-

No new options may be added, but the ones that are present in - SuggestedOptions may be omitted or replaced with new - values in AcceptedOptions.

-

Will be followed by a call to open/4 before any - read/write access is performed. AcceptedOptions is - sent to the server which replies with those options that it - accepts. These will be forwarded to open/4 as - SuggestedOptions.

+

Prepares to open a file on the client side.

+

No new options may be added, but the ones that are present in + SuggestedOptions may be omitted or replaced with new + values in AcceptedOptions.

+

Will be followed by a call to open/4 before any + read/write access is performed. AcceptedOptions is + sent to the server which replies with those options that it + accepts. These will be forwarded to open/4 as + SuggestedOptions.

+ +
+ open(Peer, Access, Filename, Mode, SuggestedOptions, State) -> {ok, AcceptedOptions, NewState} | {error, {Code, Text}} Open a file for read or write access @@ -503,14 +526,17 @@

Opens a file for read or write access.

On the client side where the open/5 call has been - preceded by a call to prepare/5, all options must be - accepted or rejected.

-

On the server side, where there is no preceding - prepare/5 call, no new options may be added, but - the ones that are present in SuggestedOptions may be - omitted or replaced with new values in AcceptedOptions.

+ preceded by a call to prepare/5, all options must be + accepted or rejected.

+

On the server side, where there is no preceding + prepare/5 call, no new options may be added, but + the ones that are present in SuggestedOptions may be + omitted or replaced with new values in AcceptedOptions.

+ +
+ read(State) -> {more, Bin, NewState} | {last, Bin, FileSize} | {error, {Code, Text}} Read a chunk from the file @@ -526,15 +552,18 @@

Read a chunk from the file.

The callback function is expected to close - the file when the last file chunk is - encountered. When an error is encountered - the callback function is expected to clean - up after the aborted file transfer, such as - closing open file descriptors etc. In both - cases there will be no more calls to any of - the callback functions.

+ the file when the last file chunk is + encountered. When an error is encountered + the callback function is expected to clean + up after the aborted file transfer, such as + closing open file descriptors etc. In both + cases there will be no more calls to any of + the callback functions.

+ +
+ write(Bin, State) -> {more, NewState} | {last, FileSize} | {error, {Code, Text}} Write a chunk to the file @@ -550,15 +579,18 @@

Write a chunk to the file.

The callback function is expected to close - the file when the last file chunk is - encountered. When an error is encountered - the callback function is expected to clean - up after the aborted file transfer, such as - closing open file descriptors etc. In both - cases there will be no more calls to any of - the callback functions.

+ the file when the last file chunk is + encountered. When an error is encountered + the callback function is expected to clean + up after the aborted file transfer, such as + closing open file descriptors etc. In both + cases there will be no more calls to any of + the callback functions.

+ +
+ abort(Code, Text, State) -> ok Abort the file transfer @@ -572,14 +604,14 @@

Invoked when the file transfer is aborted.

The callback function is expected to clean - up its used resources after the aborted file - transfer, such as closing open file - descriptors etc. The function will not be - invoked if any of the other callback - functions returns an error, as it is - expected that they already have cleaned up - the necessary resources. It will however be - invoked if the functions fails (crashes).

+ up its used resources after the aborted file + transfer, such as closing open file + descriptors etc. The function will not be + invoked if any of the other callback + functions returns an error, as it is + expected that they already have cleaned up + the necessary resources. It will however be + invoked if the functions fails (crashes).

@@ -589,7 +621,9 @@ LOGGER FUNCTIONS

A tftp_logger callback module should be implemented as a - tftp_logger behavior and export the functions listed below.

+ tftp_logger behavior and export the functions listed below.

+ + @@ -602,7 +636,10 @@ Reason = term() -

Log an error message. See error_logger:error_msg/2 for details.

+

Log an error message. + See error_logger:error_msg/2 for details.

+ +
@@ -615,7 +652,10 @@ Reason = term() -

Log a warning message. See error_logger:warning_msg/2 for details.

+

Log a warning message. + See error_logger:warning_msg/2 for details.

+ +
@@ -628,7 +668,8 @@ Reason = term() -

Log an info message. See error_logger:info_msg/2 for details.

+

Log an info message. + See error_logger:info_msg/2 for details.

-- cgit v1.2.3