From 289dd67234173c7f4632746f15435ca9a3b6e712 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 6 Nov 2018 19:20:59 -0800 Subject: man page updates for tip --- man/tip/index.html | 6 +- man/tip/nng_http_client_get_tls.3http.html | 18 +- man/tip/nng_http_conn_transact.3http.html | 17 +- man/tip/nng_http_handler_alloc.3http.html | 53 ++- man/tip/nng_http_handler_collect_body.3http.html | 2 +- man/tip/nng_http_server_get_tls.3http.html | 18 +- man/tip/nng_req_open.3.html | 2 +- man/tip/nng_tls.7.html | 8 +- man/tip/nng_tls_config_alloc.3tls.html | 11 +- man/tip/nng_tls_config_hold.3tls.html | 582 +++++++++++++++++++++++ man/tip/nng_ws.7.html | 10 +- 11 files changed, 697 insertions(+), 30 deletions(-) create mode 100644 man/tip/nng_tls_config_hold.3tls.html (limited to 'man') diff --git a/man/tip/index.html b/man/tip/index.html index 8bcecb15..2d5fc31f 100644 --- a/man/tip/index.html +++ b/man/tip/index.html @@ -832,7 +832,7 @@ primary API for building such applications.

nng_req_open(3)

-

create rep socket

+

create req socket

nng_respondent_open(3)

@@ -1535,6 +1535,10 @@ additional support was present and enabled with libnng was built.

deallocate a TLS configuration object

+

nng_tls_config_hold(3tls)

+

hold TLS configuration object

+ +

nng_tls_config_own_cert(3tls)

configure own certificate and key

diff --git a/man/tip/nng_http_client_get_tls.3http.html b/man/tip/nng_http_client_get_tls.3http.html index 61f64e0d..5cc5945f 100644 --- a/man/tip/nng_http_client_get_tls.3http.html +++ b/man/tip/nng_http_client_get_tls.3http.html @@ -541,8 +541,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b saves a pointer to it in the address referenced by cfgp.

-

The configuration will be NULL if the HTTP client instance is not enabled -to use HTTPS.

+

The object will be returned with an extra hold (see +nng_tls_config_hold()) +placed on it on behalf of the caller. +The caller should free this hold by calling +nng_tls_config_free() with it is done +with the TLS configuration.

@@ -561,6 +565,14 @@ to use HTTPS.

+ + + +
+NNG_EINVAL + +

TLS not configured on client.

+
NNG_ENOMEM @@ -587,6 +599,8 @@ to use HTTPS.

nng_http_client_connect(3http), nng_http_client_set_tls(3http), nng_tls_config_alloc(3tls), +nng_tls_config_free(3tls), +nng_tls_config_hold(3tls), nng_strerror(3), nng(7)

diff --git a/man/tip/nng_http_conn_transact.3http.html b/man/tip/nng_http_conn_transact.3http.html index e4d1f569..324b0936 100644 --- a/man/tip/nng_http_conn_transact.3http.html +++ b/man/tip/nng_http_conn_transact.3http.html @@ -563,21 +563,6 @@ exists. That function behaves similarily, but creates a connection on demand for the transaction, and disposes of it when finished.

-
- - - - - -
- - -This function does not support reading data sent using chunked -transfer encoding, and if the server attempts to do so, the underlying -connection will be closed and an NNG_ENOTSUP error will be returned. -This limitation is considered a bug, and a fix is planned for the future. -
-
@@ -666,7 +651,7 @@ That result will either be zero or an error code.

NNG_ENOTSUP diff --git a/man/tip/nng_http_handler_alloc.3http.html b/man/tip/nng_http_handler_alloc.3http.html index c2965f8c..6d81708c 100644 --- a/man/tip/nng_http_handler_alloc.3http.html +++ b/man/tip/nng_http_handler_alloc.3http.html @@ -513,6 +513,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
  • Custom Handler
  • Directory Handler
  • File Handler
  • +
  • Redirect Handler
  • Static Handler
  • @@ -546,6 +547,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b intnng_http_handler_alloc_file(nng_http_handler**hp,constchar*path,constchar*filename); +intnng_http_handler_alloc_redirect(nng_http_handler**hp,constchar*path, + uint16_tstatus,constchar*location); + intnng_http_handler_alloc_static(nng_http_handler**hp,constchar*path,constvoid*data,size_tsize,constchar*content_type); @@ -569,7 +573,7 @@ considered when determining whether the handler should be called.

    Additionally each handler has a method it is registered to handle -(the default is "GET", see +(the default is GET, see nng_http_handler_set_method()), and optionally a 'Host' header it can be matched against (see nng_http_handler_set_host()).

    @@ -682,9 +686,52 @@ the extension, then application/octet-stream is used.

    +

    Redirect Handler

    +
    +

    The fourth member is used to arrange for a server redirect from one +URL to another. +The reply will be with status code status, which should be a 3XX +code such as 301, and a Location: header will contain the URL +referenced by location, with any residual suffix from the request +URI appended.

    +
    +
    +
    -

    HTTP operations are not supported, or peer sent chunked encoding.

    +

    HTTP operations are not supported.

    + + + + +
    + + +Use nng_http_handler_set_tree() +to redirect an entire tree. +For example, it is possible to redirect an entire HTTP site to another +HTTPS site by specifying / as the path and then using the base +of the new site, such as https://newsite.example.com as the +new location. +
    +
    +
    + + + + + +
    + + +Be sure to use the appropriate value for status. +Permanent redirection should use 301 and temporary redirections should use 307. +In REST APIs, using a redirection to supply the new location of an object +created with POST should use 303. +
    +
    + +

    Static Handler

    -

    The fourth member of this family, nng_http_handler_alloc_static(), creates +

    The fifth member of this family, nng_http_handler_alloc_static(), creates a handler to serve up fixed content located in program data. The client is sent the data, with Content-Length of size bytes, and Content-Type of @@ -697,7 +744,7 @@ sent the data, with Content-Length of size bytes,

    RETURN VALUES

    -

    This function returns 0 on success, and non-zero otherwise.

    +

    These functions return 0 on success, and non-zero otherwise.

    diff --git a/man/tip/nng_http_handler_collect_body.3http.html b/man/tip/nng_http_handler_collect_body.3http.html index dea2ce32..1d49bcf5 100644 --- a/man/tip/nng_http_handler_collect_body.3http.html +++ b/man/tip/nng_http_handler_collect_body.3http.html @@ -601,7 +601,7 @@ If this header is absent, the request is assumed not to contain any data. This specifically does not support the Chunked transfer-encoding. This is considered a bug, and is a deficiency for full HTTP/1.1 compliance. However, few clients send data in this format, so in practice this should -not create few limitations. +create few limitations.
    diff --git a/man/tip/nng_http_server_get_tls.3http.html b/man/tip/nng_http_server_get_tls.3http.html index f506f99f..a89218ee 100644 --- a/man/tip/nng_http_server_get_tls.3http.html +++ b/man/tip/nng_http_server_get_tls.3http.html @@ -541,8 +541,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b saves a pointer to it in the address referenced by cfgp.

    -

    The configuration will be NULL if the HTTP server instance is not enabled -to use HTTPS.

    +

    The object will be returned with an extra hold (see +nng_tls_config_hold()) +placed on it on behalf of the caller. +The caller should free this hold by calling +nng_tls_config_free() with it is done +with the TLS configuration.

    @@ -561,6 +565,14 @@ to use HTTPS.

    + + + +
    +NNG_EINVAL + +

    TLS not configured on server.

    +
    NNG_ENOMEM @@ -587,6 +599,8 @@ to use HTTPS.

    nng_http_server_set_tls(3http), nng_http_server_start(3http), nng_tls_config_alloc(3tls), +nng_tls_config_free(3tls), +nng_tls_config_hold(3tls), nng_strerror(3), nng(7)

    diff --git a/man/tip/nng_req_open.3.html b/man/tip/nng_req_open.3.html index 6b213e66..700f2e76 100644 --- a/man/tip/nng_req_open.3.html +++ b/man/tip/nng_req_open.3.html @@ -516,7 +516,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

    NAME

    -

    nng_req_open - create rep socket

    +

    nng_req_open - create req socket

    diff --git a/man/tip/nng_tls.7.html b/man/tip/nng_tls.7.html index 25e4e389..aecea2e1 100644 --- a/man/tip/nng_tls.7.html +++ b/man/tip/nng_tls.7.html @@ -742,7 +742,13 @@ The value is of type bool and defaults to true.

    This option is used on an endpoint to access the underlying TLS configuration object. -The value is of type nng_tls_config *.

    +The value is of type nng_tls_config *. +If the value is not NULL, a hold is placed on the underlying +configuration object before returning it (see +nng_tls_config_hold()). +The caller should release the object with +nng_tls_config_free() when it no +longer needs the TLS configuration object.

    diff --git a/man/tip/nng_tls_config_alloc.3tls.html b/man/tip/nng_tls_config_alloc.3tls.html index 9a2cf0f3..aa32e7f9 100644 --- a/man/tip/nng_tls_config_alloc.3tls.html +++ b/man/tip/nng_tls_config_alloc.3tls.html @@ -563,7 +563,15 @@ The underlying system uses reference counting to ensure that object is not inadvertently freed while in use.

    -

    Also note that a TLS configuration object becomes "read-only" after it +

    A configuration object created with nng_tls_config_alloc() starts +with a reference count of one. +The reference count may be incremented using +nng_tls_config_hold() and may be +decremented with +nng_tls_config_free().

    +
    +
    +

    Also note that a TLS configuration object becomes “read-only” after it is first used with a service. After this points, attempts to apply further changes to the configuration will result in NNG_EBUSY.

    @@ -612,6 +620,7 @@ further changes to the configuration will result in NNG_EBUSY.

    nng_tls_config_ca_chain(3tls), nng_tls_config_own_cert(3tls), nng_tls_config_free(3tls), +nng_tls_config_hold(3tls), nng_tls_config_server_name(3tls), nng(7)

    diff --git a/man/tip/nng_tls_config_hold.3tls.html b/man/tip/nng_tls_config_hold.3tls.html new file mode 100644 index 00000000..b52e0209 --- /dev/null +++ b/man/tip/nng_tls_config_hold.3tls.html @@ -0,0 +1,582 @@ +--- +version: tip +layout: refman +--- + + + + + + + +nng_tls_config_hold(3tls) + + + + + + + +
    +
    +

    SYNOPSIS

    +
    +
    +
    +
    #include <nng/nng.h>
    +#include <nng/supplemental/tls/tls.h>
    +
    +void nng_tls_config_alloc(nng_tls_config *cfg);
    +
    +
    +
    +
    +
    +

    DESCRIPTION

    +
    +
    +

    The nng_tls_config_hold() increments the reference count on +the configuration object named by cfg, thereby preventing it +from being freed while in use.

    +
    +
    +

    The hold can be released by calling +nng_tls_config_free().

    +
    +
    +

    Multiple holds can be placed on a configuration object; the object +will not be freed until the last hold is released.

    +
    +
    +
    +
    +

    RETURN VALUES

    +
    +
    +

    None.

    +
    +
    +
    +
    +

    ERRORS

    +
    +
    +

    None.

    +
    +
    +
    + +
    + + diff --git a/man/tip/nng_ws.7.html b/man/tip/nng_ws.7.html index 2ee5551d..ff8f464f 100644 --- a/man/tip/nng_ws.7.html +++ b/man/tip/nng_ws.7.html @@ -687,8 +687,14 @@ This option can be set on listeners, and retrieved from pipes.

    NNG_OPT_TLS_CONFIG

    (opaque) This option is used on an endpoint to access the underlying TLS -configuration object. -The value is of type nng_tls_config *.

    +configuration object for wss:// endpoints. +The value is of type nng_tls_config *. +A hold is placed on the underlying +configuration object before returning it (see +nng_tls_config_hold()). +The caller should release the object with +nng_tls_config_free() when it no +longer needs the TLS configuration.

    -- cgit v1.2.3-70-g09d2