From 490bc97dbf76fae2a99c8bacd5fd9be332d68b90 Mon Sep 17 00:00:00 2001
From: Garrett D'Amore <garrett@damore.org>
Date: Fri, 2 Feb 2018 10:57:18 -0800
Subject: Add, and document, the url->u_requri member.

This member is the value passed in actual HTTP protocol, so it
is useful with the function nng_http_req_set_uri().
---
 docs/nng_url_parse.adoc | 42 ++++++++++++++++++------------------------
 1 file changed, 18 insertions(+), 24 deletions(-)

(limited to 'docs/nng_url_parse.adoc')

diff --git a/docs/nng_url_parse.adoc b/docs/nng_url_parse.adoc
index 0ea0cd1d..9d4be764 100644
--- a/docs/nng_url_parse.adoc
+++ b/docs/nng_url_parse.adoc
@@ -33,30 +33,21 @@ is stored in _urlp_.
 
 The `nng_url` structure has at least the following members:
 
-`char *u_scheme`::   The scheme, such as `http`.  Always lower case.
-
-`char *u_rawurl`::   An unparsed form of the raw URL, with only minimal
-                     canonicalization performed.
-
-`char *u_userinfo`:: The userinfo component if one was present,
-                     `NULL` otherwise.
-
-`char *u_host`:: The full host, including hostname, and colon and port
-                 if present, otehrwise the empty string.
-
-`char *u_hostname`:: The hostname if present, otherwise the empty string.
-                     Always lower case.
-
-`char *u_port`:: The port if present.  If not present, a default port
-                 will be stored here.  If no default is available, then
-                 the empty string.
-
-`char *u_path`:: The path component if present, or the empty string
-                 otherwise.
-
-`char *u_query`:: The query component if present, NULL otherwise.
-
-`char *u_fragment`:: The fragment if present, NULL otherwise.
+[source, c]
+----
+struct nng_url {
+    char *u_scheme;   // Scheme, such as "http"; always lower case.
+    char *u_rawurl;   // Unparsed URL, with minimal canonicalization.
+    char *u_userinfo; // Userinfo component, or NULL.
+    char *u_host;     // Full host, including port if present.
+    char *u_hostname; // Hostname only (or address), or empy string.
+    char *u_port;     // Port number, may be default or empty string.
+    char *u_path;     // Path if present, empty string otherwise.
+    char *u_query;    // Query info if present, NULL otherwise.
+    char *u_fragment; // Fragment if present, NULL otherwise.
+    char *u_requri;   // Request-URI (path[?query][#fragment])
+};
+----
 
 === URL Canonicalization
 
@@ -82,6 +73,9 @@ follows:
   8. If a port was not specified, but the scheme defines a default
      port, then `u_port` will be filled in with the value of the default port.
 
+TIP: Only the `u_userinfo`, `u_query`, and `u_fragment` members will ever be
+     `NULL`.  The other members will be filled in with either default values
+     or the empty string if they cannot be determined from _str_.
 
 == RETURN VALUES
 
-- 
cgit v1.2.3-70-g09d2

