Browse Source

[core] set default server_tag in server.c

(instead of in configfile.c)

(now only server.c depends on version.h
 and must be recompiled after each commit)
personal/stbuehler/mod-csrf
Glenn Strauss 5 years ago
parent
commit
ce0f2f61d2
  1. 3
      src/configfile.c
  2. 4
      src/server.c

3
src/configfile.c

@ -9,7 +9,6 @@
#include "configfile.h"
#include "proc_open.h"
#include "request.h"
#include "version.h"
#include <sys/stat.h>
@ -221,7 +220,7 @@ static int config_insert(server *srv) {
s->server_name = buffer_init();
s->error_handler = buffer_init();
s->error_handler_404 = buffer_init();
s->server_tag = buffer_init_string(PACKAGE_DESC);
s->server_tag = buffer_init();
s->errorfile_prefix = buffer_init();
#if defined(__FreeBSD__) || defined(__NetBSD__) \
|| defined(__OpenBSD__) || defined(__DragonFly__)

4
src/server.c

@ -1263,6 +1263,10 @@ static int server_main (server * const srv, int argc, char **argv) {
return -1;
}
if (buffer_is_empty(srv->config_storage[0]->server_tag)) {
buffer_copy_string_len(srv->config_storage[0]->server_tag, CONST_STR_LEN(PACKAGE_DESC));
}
if (HANDLER_GO_ON != plugins_call_set_defaults(srv)) {
log_error_write(srv, __FILE__, __LINE__, "s", "Configuration of plugins failed. Going down.");
return -1;

Loading…
Cancel
Save