diff options
| author | 2024-08-05 05:35:10 +0200 | |
|---|---|---|
| committer | 2024-08-05 05:35:10 +0200 | |
| commit | e9b108a6e0f09d74ee605f1a854ecbdc12a65c92 (patch) | |
| tree | 1b62e6b2c4ee83275b80b52bf4adae90aad78bfd /httpd.c | |
| parent | Updated documentation. (diff) | |
| download | penes-snac2-e9b108a6e0f09d74ee605f1a854ecbdc12a65c92.tar.gz penes-snac2-e9b108a6e0f09d74ee605f1a854ecbdc12a65c92.tar.xz penes-snac2-e9b108a6e0f09d74ee605f1a854ecbdc12a65c92.zip | |
Minor logging tweaks.
Diffstat (limited to '')
| -rw-r--r-- | httpd.c | 15 |
1 files changed, 9 insertions, 6 deletions
| @@ -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 | } |