summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/httpd.c b/httpd.c
index 52684cf..e2cfbb0 100644
--- a/httpd.c
+++ b/httpd.c
@@ -537,8 +537,8 @@ static void *background_thread(void *arg)
537void httpd(void) 537void httpd(void)
538/* starts the server */ 538/* starts the server */
539{ 539{
540 char *address; 540 const char *address;
541 int port; 541 const char *port;
542 int rs; 542 int rs;
543 pthread_t threads[MAX_THREADS] = {0}; 543 pthread_t threads[MAX_THREADS] = {0};
544 int n_threads = 0; 544 int n_threads = 0;
@@ -548,10 +548,10 @@ void httpd(void)
548 sem_t anon_job_sem; 548 sem_t anon_job_sem;
549 549
550 address = xs_dict_get(srv_config, "address"); 550 address = xs_dict_get(srv_config, "address");
551 port = xs_number_get(xs_dict_get(srv_config, "port")); 551 port = xs_number_str(xs_dict_get(srv_config, "port"));
552 552
553 if ((rs = xs_socket_server(address, port)) == -1) { 553 if ((rs = xs_socket_server(address, port)) == -1) {
554 srv_log(xs_fmt("cannot bind socket to %s:%d", address, port)); 554 srv_log(xs_fmt("cannot bind socket to %s:%s", address, port));
555 return; 555 return;
556 } 556 }
557 557
@@ -561,7 +561,7 @@ void httpd(void)
561 signal(SIGTERM, term_handler); 561 signal(SIGTERM, term_handler);
562 signal(SIGINT, term_handler); 562 signal(SIGINT, term_handler);
563 563
564 srv_log(xs_fmt("httpd start %s:%d %s", address, port, USER_AGENT)); 564 srv_log(xs_fmt("httpd start %s:%s %s", address, port, USER_AGENT));
565 565
566 /* show the number of usable file descriptors */ 566 /* show the number of usable file descriptors */
567 struct rlimit r; 567 struct rlimit r;
@@ -648,5 +648,5 @@ void httpd(void)
648 648
649 xs *uptime = xs_str_time_diff(time(NULL) - start_time); 649 xs *uptime = xs_str_time_diff(time(NULL) - start_time);
650 650
651 srv_log(xs_fmt("httpd stop %s:%d (run time: %s)", address, port, uptime)); 651 srv_log(xs_fmt("httpd stop %s:%s (run time: %s)", address, port, uptime));
652} 652}