summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--httpd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/httpd.c b/httpd.c
index 7aae6ca..287965e 100644
--- a/httpd.c
+++ b/httpd.c
@@ -763,6 +763,7 @@ void httpd(void)
763{ 763{
764 const char *address; 764 const char *address;
765 const char *port; 765 const char *port;
766 xs *full_address = NULL;
766 int rs; 767 int rs;
767 pthread_t threads[MAX_THREADS] = {0}; 768 pthread_t threads[MAX_THREADS] = {0};
768 int n; 769 int n;
@@ -773,8 +774,10 @@ void httpd(void)
773 address = xs_dict_get(srv_config, "address"); 774 address = xs_dict_get(srv_config, "address");
774 port = xs_number_str(xs_dict_get(srv_config, "port")); 775 port = xs_number_str(xs_dict_get(srv_config, "port"));
775 776
777 full_address = xs_fmt("%s:%s", address, port);
778
776 if ((rs = xs_socket_server(address, port)) == -1) { 779 if ((rs = xs_socket_server(address, port)) == -1) {
777 srv_log(xs_fmt("cannot bind socket to %s:%s", address, port)); 780 srv_log(xs_fmt("cannot bind socket to %s", full_address));
778 return; 781 return;
779 } 782 }
780 783
@@ -791,13 +794,13 @@ void httpd(void)
791 signal(SIGTERM, term_handler); 794 signal(SIGTERM, term_handler);
792 signal(SIGINT, term_handler); 795 signal(SIGINT, term_handler);
793 796
794 srv_log(xs_fmt("httpd%s start %s:%s %s", p_state->use_fcgi ? " (FastCGI)" : "", 797 srv_log(xs_fmt("httpd%s start %s %s", p_state->use_fcgi ? " (FastCGI)" : "",
795 address, port, USER_AGENT)); 798 full_address, USER_AGENT));
796 799
797 /* show the number of usable file descriptors */ 800 /* show the number of usable file descriptors */
798 struct rlimit r; 801 struct rlimit r;
799 getrlimit(RLIMIT_NOFILE, &r); 802 getrlimit(RLIMIT_NOFILE, &r);
800 srv_debug(0, xs_fmt("available (rlimit) fds: %d (cur) / %d (max)", 803 srv_debug(1, xs_fmt("available (rlimit) fds: %d (cur) / %d (max)",
801 (int) r.rlim_cur, (int) r.rlim_max)); 804 (int) r.rlim_cur, (int) r.rlim_max));
802 805
803 /* initialize the job control engine */ 806 /* initialize the job control engine */
@@ -876,7 +879,7 @@ void httpd(void)
876 879
877 xs *uptime = xs_str_time_diff(time(NULL) - p_state->srv_start_time); 880 xs *uptime = xs_str_time_diff(time(NULL) - p_state->srv_start_time);
878 881
879 srv_log(xs_fmt("httpd%s stop %s:%s (run time: %s)", 882 srv_log(xs_fmt("httpd%s stop %s (run time: %s)",
880 p_state->use_fcgi ? " (FastCGI)" : "", 883 p_state->use_fcgi ? " (FastCGI)" : "",
881 address, port, uptime)); 884 full_address, uptime));
882} 885}