Optimize code

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
This commit is contained in:
Jianhui Zhao committed 2018-01-01 10:30:41 +08:00
1 parent 4fc1826889
commit 89851e3f33
5 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -98,7 +98,7 @@ int main(int argc, char **argv)
goto done;
#endif
uh_add_action(srv, "/hello", hello_action);
srv->add_action(srv, "/hello", hello_action);
uloop_run();
done:
+1 -1
View File
@@ -99,7 +99,7 @@ int main(int argc, char **argv)
goto done;
#endif
uh_add_action(srv, "/hello", hello_action);
srv->add_action(srv, "/hello", hello_action);
uloop_run();
done:
+1 -1
View File
@@ -54,7 +54,7 @@ int main(int argc, char **argv)
goto done;
#endif
uh_add_action(srv, "/hello", hello_action);
srv->add_action(srv, "/hello", hello_action);
uloop_run();
done:
+1
View File
@@ -87,6 +87,7 @@ struct uh_server *uh_server_new(const char *host, const char *port)
srv->free = uh_server_free;
srv->set_docroot = uh_set_docroot;
srv->set_index_file = uh_set_index_file;
srv->add_action = uh_add_action;
#if (UHTTPD_SSL_SUPPORT)
srv->ssl_init = uh_ssl_init;
+1
View File
@@ -34,6 +34,7 @@ struct uh_server {
void (*set_docroot)(struct uh_server *srv, const char *docroot);
void (*set_index_file)(struct uh_server *srv, const char *index_file);
void (*error404_cb)(struct uh_client *cl);
int (*add_action)(struct uh_server *srv, const char *path, action_cb_t cb);
#if (UHTTPD_SSL_SUPPORT)
int (*ssl_init)(struct uh_server *srv, const char *key, const char *crt);