aboutsummaryrefslogtreecommitdiff
path: root/doc/man7/libweb_handler.7
diff options
context:
space:
mode:
authorxavi <xavi@noreply.localhost>2023-11-20 16:24:15 +0100
committerxavi <xavi@noreply.localhost>2023-11-20 16:24:15 +0100
commit44676b84fd9aa689e4abbb588bead19a36061fa1 (patch)
tree388e86e26531b1b6612e0a178fbd29cd89c86814 /doc/man7/libweb_handler.7
parent65031ca3502e0c27780be847fd97c112546741a9 (diff)
parent2561ec32fe24e9cc81151193fbf2c55c94078816 (diff)
Merge pull request 'Allow `listen_port` to return selected port number' (#1) from midokura-xavi/libweb:listen-port into master
Reviewed-on: https://gitea.privatedns.org/xavi/libweb/pulls/1
Diffstat (limited to 'doc/man7/libweb_handler.7')
-rw-r--r--doc/man7/libweb_handler.719
1 files changed, 16 insertions, 3 deletions
diff --git a/doc/man7/libweb_handler.7 b/doc/man7/libweb_handler.7
index b9fd53f..1548b6b 100644
--- a/doc/man7/libweb_handler.7
+++ b/doc/man7/libweb_handler.7
@@ -51,9 +51,15 @@ operation.
.IP \(bu 2
.IR handler_listen (3):
+initializes the server on a
+.I "struct handler"
+object to listen on a given port.
+
+.IP \(bu 2
+.IR handler_loop (3):
puts a
.I "struct handler"
-object to initialize the server and handle connections in a loop.
+object to handle connections in a loop.
The
.IR handler_alloc (3)
@@ -200,11 +206,16 @@ int main(int argc, char *argv[])
goto end;
}
- if (handler_listen(h, port))
+ if (handler_listen(h, port, NULL))
{
fprintf(stderr, "%s: handler_listen failed\en", __func__);
goto end;
}
+ else if (handler_loop(h))
+ {
+ fprintf(stderr, "%s: handler_loop failed\en", __func__);
+ goto end;
+ }
ret = EXIT_SUCCESS;
@@ -220,10 +231,12 @@ end:
.BR handler_alloc (3),
.BR handler_add (3),
.BR handler_free (3),
+.BR handler_listen (3),
+.BR handler_loop (3),
.BR libweb_http (7).
.SH COPYRIGHT
-Copyright (C) 2023 Xavier Del Campo Romero.
+Copyright (C) 2023 libweb contributors.
.P
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by