aboutsummaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/libweb/handler.h4
-rw-r--r--include/libweb/server.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/include/libweb/handler.h b/include/libweb/handler.h
index f7bc76a..493e24c 100644
--- a/include/libweb/handler.h
+++ b/include/libweb/handler.h
@@ -20,6 +20,8 @@ struct handler *handler_alloc(const struct handler_cfg *cfg);
void handler_free(struct handler *h);
int handler_add(struct handler *h, const char *url, enum http_op op,
handler_fn f, void *user);
-int handler_listen(struct handler *h, unsigned short port);
+int handler_listen(struct handler *h, unsigned short port,
+ unsigned short *outport);
+int handler_loop(struct handler *h);
#endif /* HANDLER_H */
diff --git a/include/libweb/server.h b/include/libweb/server.h
index 74f06ae..b3691aa 100644
--- a/include/libweb/server.h
+++ b/include/libweb/server.h
@@ -4,7 +4,7 @@
#include <stdbool.h>
#include <stddef.h>
-struct server *server_init(unsigned short port);
+struct server *server_init(unsigned short port, unsigned short *outport);
struct server_client *server_poll(struct server *s, bool *io, bool *exit);
int server_read(void *buf, size_t n, struct server_client *c);
int server_write(const void *buf, size_t n, struct server_client *c);