diff options
author | Alfred E. Heggestad <aeh@db.org> | 2014-11-30 20:13:16 +0100 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2014-11-30 20:13:16 +0100 |
commit | 30c79f2bc4e2f768c65ac0e806ae2e3f5eb9e1bf (patch) | |
tree | c77fc6a77badb1cb3ff198a9596a0046232a3a68 /modules/httpd/httpd.c | |
parent | bd6f59b75faa60a27d4f7bcc87ac72c54f0ceb71 (diff) |
httpd: register UI handlers
Diffstat (limited to 'modules/httpd/httpd.c')
-rw-r--r-- | modules/httpd/httpd.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/httpd/httpd.c b/modules/httpd/httpd.c index 12ef9dd..a837b35 100644 --- a/modules/httpd/httpd.c +++ b/modules/httpd/httpd.c @@ -68,6 +68,22 @@ static void http_req_handler(struct http_conn *conn, } +static int output_handler(const char *str) +{ + (void)str; + + /* TODO: print 'str' to all active HTTP connections */ + + return 0; +} + + +static struct ui ui_http = { + .name = "http", + .outputh = output_handler +}; + + static int module_init(void) { struct sa laddr; @@ -81,6 +97,8 @@ static int module_init(void) if (err) return err; + ui_register(&ui_http); + info("httpd: listening on %J\n", &laddr); return 0; @@ -89,6 +107,8 @@ static int module_init(void) static int module_close(void) { + ui_unregister(&ui_http); + httpsock = mem_deref(httpsock); return 0; |