diff options
Diffstat (limited to 'doc/man7')
| -rw-r--r-- | doc/man7/libweb_http.7 | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/man7/libweb_http.7 b/doc/man7/libweb_http.7 index a8e315d..63a68da 100644 --- a/doc/man7/libweb_http.7 +++ b/doc/man7/libweb_http.7 @@ -726,6 +726,41 @@ instance. In this case, must be assigned to a function to be later called by .IR libweb . +Functions must assign +.B all unused members +in a +.I struct http_response +instance to +.I 0 +or +.IR NULL . +Otherwise, +.BR "the behaviour is undefined" . +For example, the following assignment sets three members, +namely +.IR status, +.I buf.ro +and +.IR n , +while leaving all unused members to +.I 0 +or +.IR NULL : + +.PP +.in +4n +.EX +static const char body[] = "Hi there!\en"; +*r = (const struct http_response) +{ + .status = HTTP_STATUS_OK, + .buf.ro = body, + .n = sizeof body - 1 +}; +.EE +.in +.PP + .SS Transport Layer Security (TLS) By design, .I libweb |
