diff --git a/example/helloworld.c b/example/helloworld.c index d95b543..79e0662 100755 --- a/example/helloworld.c +++ b/example/helloworld.c @@ -19,7 +19,7 @@ //#define EXAMPLE_SSL -#define port "8000" +#define port 8000 static void hello_action(struct uh_client *cl) { diff --git a/src/uhttpd.c b/src/uhttpd.c index d026f28..0f3ece9 100755 --- a/src/uhttpd.c +++ b/src/uhttpd.c @@ -57,12 +57,12 @@ static void uh_accept_cb(struct uloop_fd *fd, unsigned int events) uh_accept_client(srv, srv->ssl); } -struct uh_server *uh_server_new(const char *host, const char *port) +struct uh_server *uh_server_new(const char *host, int port) { struct uh_server *srv = NULL; int sock = -1; - sock = usock(USOCK_TCP | USOCK_SERVER | USOCK_IPV4ONLY, host, port); + sock = usock(USOCK_TCP | USOCK_SERVER | USOCK_IPV4ONLY, host, usock_port(port)); if (sock < 0) { uh_log_err("usock"); return NULL; diff --git a/src/uhttpd.h b/src/uhttpd.h index 3c99288..2fd26d3 100755 --- a/src/uhttpd.h +++ b/src/uhttpd.h @@ -41,6 +41,6 @@ struct uh_server { #endif }; -struct uh_server *uh_server_new(const char *host, const char *port); +struct uh_server *uh_server_new(const char *host, int port); #endif