Skip to content

Commit

Permalink
Optimize code
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
  • Loading branch information
Jianhui Zhao committed Jan 1, 2018
1 parent 4fc1826 commit 89851e3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README_ZH.md
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion example/helloworld.c
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/uhttpd.c
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/uhttpd.h
Expand Up @@ -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);
Expand Down

0 comments on commit 89851e3

Please sign in to comment.