-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathrenderd_config.c
More file actions
584 lines (462 loc) · 21.3 KB
/
renderd_config.c
File metadata and controls
584 lines (462 loc) · 21.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
/*
* Copyright (c) 2007 - 2024 by mod_tile contributors (see AUTHORS file)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; If not, see http://www.gnu.org/licenses/.
*/
#define _GNU_SOURCE
#include <sys/un.h>
#include <unistd.h>
#include "config.h"
#include "g_logger.h"
#include "render_config.h"
#include "renderd.h"
#ifdef HAVE_INIPARSER_INIPARSER_H
#include <iniparser/iniparser.h>
#else
#include <iniparser.h>
#endif
static void copy_string(const char *src, const char **dest, size_t maxlen)
{
*dest = strndup(src, maxlen);
if (*dest == NULL) {
g_logger(G_LOG_LEVEL_CRITICAL, "copy_string: strndup error");
exit(7);
}
}
static char *name_with_section(const char *section, const char *name)
{
int len;
char *key;
len = asprintf(&key, "%s:%s", section, name);
if (len == -1) {
g_logger(G_LOG_LEVEL_CRITICAL, "name_with_section: asprintf error");
exit(7);
}
return key;
}
static void process_config_bool(const dictionary *ini, const char *section, const char *name, int *dest, int notfound)
{
char *key = name_with_section(section, name);
int src = iniparser_getboolean(ini, key, notfound);
g_logger(G_LOG_LEVEL_DEBUG, "\tRead %s: '%s'", key, src ? "true" : "false");
*dest = src;
free(key);
}
static void process_config_double(const dictionary *ini, const char *section, const char *name, double *dest, double notfound)
{
char *key = name_with_section(section, name);
double src = iniparser_getdouble(ini, key, notfound);
g_logger(G_LOG_LEVEL_DEBUG, "\tRead %s: '%lf'", key, src);
*dest = src;
free(key);
}
static void process_config_int(const dictionary *ini, const char *section, const char *name, int *dest, int notfound)
{
char *key = name_with_section(section, name);
int src = iniparser_getint(ini, key, notfound);
g_logger(G_LOG_LEVEL_DEBUG, "\tRead %s: '%i'", key, src);
*dest = src;
free(key);
}
static void process_config_string(const dictionary *ini, const char *section, const char *name, const char **dest, const char *notfound, size_t maxlen)
{
char *key = name_with_section(section, name);
const char *src = iniparser_getstring(ini, key, notfound);
g_logger(G_LOG_LEVEL_DEBUG, "\tRead %s: '%s'", key, src);
copy_string(src, dest, maxlen);
free(key);
}
static char *process_config_string_with_trailing_slash(const dictionary *ini, const char *section, const char *name, const char **dest, const char *notfound, size_t maxlen)
{
char *key = name_with_section(section, name);
const char *src = iniparser_getstring(ini, key, notfound);
g_logger(G_LOG_LEVEL_DEBUG, "\tRead %s: '%s'", key, src);
if (src[strnlen(src, maxlen) - 1] != '/') {
char *tempsrc = strndup(src, maxlen);
int len = asprintf(&tempsrc, "%s/", src);
if (len == -1) {
g_logger(G_LOG_LEVEL_CRITICAL, "process_config_string_with_trailing_slash: asprintf error");
exit(7);
}
copy_string(tempsrc, dest, maxlen);
free(tempsrc);
} else {
copy_string(src, dest, maxlen);
}
free(key);
}
void free_map_section(xmlconfigitem map_section)
{
free((void *)map_section.attribution);
free((void *)map_section.cors);
free((void *)map_section.description);
free((void *)map_section.file_extension);
free((void *)map_section.host);
free((void *)map_section.htcpip);
free((void *)map_section.mime_type);
free((void *)map_section.output_format);
free((void *)map_section.parameterization);
free((void *)map_section.server_alias);
free((void *)map_section.tile_dir);
free((void *)map_section.xmlfile);
free((void *)map_section.xmlname);
free((void *)map_section.xmluri);
bzero(&map_section, sizeof(xmlconfigitem));
}
void free_map_sections(xmlconfigitem *map_sections)
{
for (int i = 0; i < XMLCONFIGS_MAX; i++) {
if (map_sections[i].xmlname != NULL) {
free_map_section(map_sections[i]);
}
}
}
void free_renderd_section(renderd_config renderd_section)
{
free((void *)renderd_section.iphostname);
free((void *)renderd_section.mapnik_font_dir);
free((void *)renderd_section.mapnik_plugins_dir);
free((void *)renderd_section.name);
free((void *)renderd_section.pid_filename);
free((void *)renderd_section.socketname);
free((void *)renderd_section.stats_filename);
free((void *)renderd_section.tile_dir);
bzero(&renderd_section, sizeof(renderd_config));
}
void free_renderd_sections(renderd_config *renderd_sections)
{
for (int i = 0; i < MAX_SLAVES; i++) {
if (renderd_sections[i].num_threads != 0) {
free_renderd_section(renderd_sections[i]);
}
}
}
double min_max_double_opt(const char *opt_arg, const char *opt_type_name, double minimum, double maximum)
{
char *endptr;
double opt = strtod(opt_arg, &endptr);
if (endptr == opt_arg) {
g_logger(G_LOG_LEVEL_CRITICAL, "Invalid %s, must be a double (%s was provided)", opt_type_name, opt_arg);
exit(1);
} else if (minimum != -1 && opt < minimum) {
g_logger(G_LOG_LEVEL_CRITICAL, "Invalid %s, must be >= %f (%s was provided)", opt_type_name, minimum, opt_arg);
exit(1);
} else if (maximum != -1 && opt > maximum) {
g_logger(G_LOG_LEVEL_CRITICAL, "Invalid %s, must be <= %f (%s was provided)", opt_type_name, maximum, opt_arg);
exit(1);
}
return opt;
}
int min_max_int_opt(const char *opt_arg, const char *opt_type_name, int minimum, int maximum)
{
char *endptr, *endptr_float;
int opt = strtol(opt_arg, &endptr, 10);
float opt_float = strtof(opt_arg, &endptr_float);
if (endptr == opt_arg || endptr_float == opt_arg || (float)opt != opt_float) {
g_logger(G_LOG_LEVEL_CRITICAL, "Invalid %s, must be an integer (%s was provided)", opt_type_name, opt_arg);
exit(1);
} else if (minimum != -1 && opt < minimum) {
g_logger(G_LOG_LEVEL_CRITICAL, "Invalid %s, must be >= %i (%s was provided)", opt_type_name, minimum, opt_arg);
exit(1);
} else if (maximum != -1 && opt > maximum) {
g_logger(G_LOG_LEVEL_CRITICAL, "Invalid %s, must be <= %i (%s was provided)", opt_type_name, maximum, opt_arg);
exit(1);
}
return opt;
}
void process_map_sections(dictionary *ini, const char *config_file_name, xmlconfigitem *maps_dest, const char *default_tile_dir, int num_threads)
{
int ini_loaded_here = 0;
int map_section_num = -1;
if (!ini) {
ini = iniparser_load(config_file_name);
ini_loaded_here = 1;
if (!ini) {
g_logger(G_LOG_LEVEL_CRITICAL, "Failed to load config file (process_map_sections): '%s'", config_file_name);
exit(1);
}
}
bzero(maps_dest, sizeof(xmlconfigitem) * XMLCONFIGS_MAX);
g_logger(G_LOG_LEVEL_DEBUG, "Parsing map config section(s)");
for (int section_num = 0; section_num < iniparser_getnsec(ini); section_num++) {
const char *section = iniparser_getsecname(ini, section_num);
if (strncmp(section, "renderd", 7) && strcmp(section, "mapnik")) { // this is a map config section
char *ini_type_copy, *ini_type_context;
const char *ini_type, *ini_type_part;
int ini_type_part_maxlen = 64, ini_type_part_num = 0;
map_section_num++;
g_logger(G_LOG_LEVEL_DEBUG, "Parsing map config section %i: %s", map_section_num, section);
if (map_section_num >= XMLCONFIGS_MAX) {
g_logger(G_LOG_LEVEL_CRITICAL, "Can't handle more than %i map config sections", XMLCONFIGS_MAX);
exit(7);
}
copy_string(section, &maps_dest[map_section_num].xmlname, XMLCONFIG_MAX);
process_config_int(ini, section, "aspectx", &maps_dest[map_section_num].aspect_x, 1);
process_config_int(ini, section, "aspecty", &maps_dest[map_section_num].aspect_y, 1);
process_config_int(ini, section, "tilesize", &maps_dest[map_section_num].tile_px_size, 256);
process_config_string(ini, section, "attribution", &maps_dest[map_section_num].attribution, "", PATH_MAX);
process_config_string(ini, section, "cors", &maps_dest[map_section_num].cors, "", PATH_MAX);
process_config_string(ini, section, "description", &maps_dest[map_section_num].description, "", PATH_MAX);
process_config_string(ini, section, "host", &maps_dest[map_section_num].host, "", PATH_MAX);
process_config_string(ini, section, "htcphost", &maps_dest[map_section_num].htcpip, "", PATH_MAX);
process_config_string(ini, section, "parameterize_style", &maps_dest[map_section_num].parameterization, "", PATH_MAX);
process_config_string(ini, section, "server_alias", &maps_dest[map_section_num].server_alias, "", PATH_MAX);
process_config_string(ini, section, "tiledir", &maps_dest[map_section_num].tile_dir, default_tile_dir, PATH_MAX);
process_config_string(ini, section, "xml", &maps_dest[map_section_num].xmlfile, "", PATH_MAX);
process_config_string_with_trailing_slash(ini, section, "uri", &maps_dest[map_section_num].xmluri, "", PATH_MAX);
process_config_double(ini, section, "scale", &maps_dest[map_section_num].scale_factor, 1.0);
if (maps_dest[map_section_num].scale_factor < 0.1) {
g_logger(G_LOG_LEVEL_CRITICAL, "Specified scale factor (%lf) is too small, must be greater than or equal to %lf.", maps_dest[map_section_num].scale_factor, 0.1);
exit(7);
} else if (maps_dest[map_section_num].scale_factor > 8.0) {
g_logger(G_LOG_LEVEL_CRITICAL, "Specified scale factor (%lf) is too large, must be less than or equal to %lf.", maps_dest[map_section_num].scale_factor, 8.0);
exit(7);
}
process_config_int(ini, section, "maxzoom", &maps_dest[map_section_num].max_zoom, MAX_ZOOM);
if (maps_dest[map_section_num].max_zoom < 0) {
g_logger(G_LOG_LEVEL_CRITICAL, "Specified max zoom (%i) is too small, must be greater than or equal to %i.", maps_dest[map_section_num].max_zoom, 0);
exit(7);
} else if (maps_dest[map_section_num].max_zoom > MAX_ZOOM) {
g_logger(G_LOG_LEVEL_CRITICAL, "Specified max zoom (%i) is too large, must be less than or equal to %i.", maps_dest[map_section_num].max_zoom, MAX_ZOOM);
exit(7);
}
process_config_int(ini, section, "minzoom", &maps_dest[map_section_num].min_zoom, 0);
if (maps_dest[map_section_num].min_zoom < 0) {
g_logger(G_LOG_LEVEL_CRITICAL, "Specified min zoom (%i) is too small, must be greater than or equal to %i.", maps_dest[map_section_num].min_zoom, 0);
exit(7);
} else if (maps_dest[map_section_num].min_zoom > maps_dest[map_section_num].max_zoom) {
g_logger(G_LOG_LEVEL_CRITICAL, "Specified min zoom (%i) is larger than max zoom (%i).", maps_dest[map_section_num].min_zoom, maps_dest[map_section_num].max_zoom);
exit(7);
}
process_config_string(ini, section, "type", &ini_type, "png image/png png256", INILINE_MAX);
ini_type_copy = strndup(ini_type, INILINE_MAX);
for (ini_type_part = strtok_r(ini_type_copy, " ", &ini_type_context); ini_type_part; ini_type_part = strtok_r(NULL, " ", &ini_type_context)) {
switch (ini_type_part_num) {
case 0:
copy_string(ini_type_part, &maps_dest[map_section_num].file_extension, ini_type_part_maxlen);
break;
case 1:
copy_string(ini_type_part, &maps_dest[map_section_num].mime_type, ini_type_part_maxlen);
break;
case 2:
copy_string(ini_type_part, &maps_dest[map_section_num].output_format, ini_type_part_maxlen);
break;
default:
g_logger(G_LOG_LEVEL_CRITICAL, "Specified type (%s) has too many parts, there must be no more than 3, e.g., 'png image/png png256'.", ini_type);
exit(7);
}
ini_type_part_num++;
}
if (ini_type_part_num < 2) {
g_logger(G_LOG_LEVEL_CRITICAL, "Specified type (%s) has too few parts, there must be at least 2, e.g., 'png image/png'.", ini_type);
exit(7);
}
if (ini_type_part_num < 3) {
copy_string("png256", &maps_dest[map_section_num].output_format, ini_type_part_maxlen);
}
g_logger(G_LOG_LEVEL_DEBUG, "\tRead %s:%s:file_extension: '%s'", section, "type", maps_dest[map_section_num].file_extension);
g_logger(G_LOG_LEVEL_DEBUG, "\tRead %s:%s:mime_type: '%s'", section, "type", maps_dest[map_section_num].mime_type);
g_logger(G_LOG_LEVEL_DEBUG, "\tRead %s:%s:output_format: '%s'", section, "type", maps_dest[map_section_num].output_format);
/* Pass this information into the rendering threads,
* as it is needed to configure mapniks number of connections
*/
maps_dest[map_section_num].num_threads = num_threads;
free(ini_type_copy);
free((void *)ini_type);
}
}
if (ini_loaded_here == 1) {
iniparser_freedict(ini);
}
if (map_section_num < 0) {
g_logger(G_LOG_LEVEL_CRITICAL, "No map config sections were found in file: %s", config_file_name);
exit(1);
}
if (map_section_num > 0) {
for (int x = 0; x < map_section_num; x++) {
for (int y = x + 1; y <= map_section_num; y++) {
if (strncmp(maps_dest[x].xmluri, maps_dest[y].xmluri, strnlen(maps_dest[x].xmluri, PATH_MAX)) == 0) {
g_logger(G_LOG_LEVEL_CRITICAL, "Specified URI path ('%s' in map section '%s') must not be the parent of any subsequent map config section's URI path, e.g., '%s' in map section '%s'.", maps_dest[x].xmluri, maps_dest[x].xmlname, maps_dest[y].xmluri, maps_dest[y].xmlname);
exit(7);
}
}
}
}
}
void process_mapnik_section(dictionary *ini, const char *config_file_name, renderd_config *config_dest)
{
int ini_loaded_here = 0;
int mapnik_section_num = -1;
if (!ini) {
ini = iniparser_load(config_file_name);
ini_loaded_here = 1;
if (!ini) {
g_logger(G_LOG_LEVEL_CRITICAL, "Failed to load config file (process_mapnik_section): '%s'", config_file_name);
exit(1);
}
}
g_logger(G_LOG_LEVEL_DEBUG, "Parsing mapnik config section");
for (int section_num = 0; section_num < iniparser_getnsec(ini); section_num++) {
const char *section = iniparser_getsecname(ini, section_num);
if (strcmp(section, "mapnik") == 0) { // this is a mapnik config section
mapnik_section_num = section_num;
process_config_bool(ini, section, "font_dir_recurse", &config_dest->mapnik_font_dir_recurse, MAPNIK_FONTS_DIR_RECURSE);
process_config_string(ini, section, "font_dir", &config_dest->mapnik_font_dir, MAPNIK_FONTS_DIR, PATH_MAX);
process_config_string(ini, section, "plugins_dir", &config_dest->mapnik_plugins_dir, MAPNIK_PLUGINS_DIR, PATH_MAX);
break;
}
}
if (ini_loaded_here == 1) {
iniparser_freedict(ini);
}
if (mapnik_section_num < 0) {
g_logger(G_LOG_LEVEL_CRITICAL, "No mapnik config section was found in file: %s", config_file_name);
exit(1);
}
}
void process_renderd_sections(dictionary *ini, const char *config_file_name, renderd_config *configs_dest)
{
int ini_loaded_here = 0;
int renderd_section_num = -1;
int renderd_socketname_maxlen = sizeof(((struct sockaddr_un *)0)->sun_path);
if (!ini) {
ini = iniparser_load(config_file_name);
ini_loaded_here = 1;
if (!ini) {
g_logger(G_LOG_LEVEL_CRITICAL, "Failed to load config file (process_renderd_sections): '%s'", config_file_name);
exit(1);
}
}
bzero(configs_dest, sizeof(renderd_config) * MAX_SLAVES);
g_logger(G_LOG_LEVEL_DEBUG, "Parsing renderd config section(s)");
for (int section_num = 0; section_num < iniparser_getnsec(ini); section_num++) {
const char *section = iniparser_getsecname(ini, section_num);
int renderd_strlen = 7;
if (strncmp(section, "renderd", renderd_strlen) == 0) { // this is a renderd config section
if (strcmp(section, "renderd") == 0 || strcmp(section, "renderd0") == 0) {
renderd_section_num = 0;
} else {
char *endptr;
renderd_section_num = strtol(§ion[renderd_strlen], &endptr, 10);
if (endptr == §ion[renderd_strlen]) {
g_logger(G_LOG_LEVEL_CRITICAL, "Invalid renderd section name: %s", section);
exit(7);
}
}
g_logger(G_LOG_LEVEL_DEBUG, "Parsing renderd config section %i: %s", renderd_section_num, section);
if (renderd_section_num >= MAX_SLAVES) {
g_logger(G_LOG_LEVEL_CRITICAL, "Can't handle more than %i renderd config sections", MAX_SLAVES);
exit(7);
}
if (configs_dest[renderd_section_num].name != NULL) {
g_logger(G_LOG_LEVEL_CRITICAL, "Duplicate renderd config section names for section %i: %s & %s", renderd_section_num, configs_dest[renderd_section_num].name, section);
exit(7);
}
copy_string(section, &configs_dest[renderd_section_num].name, renderd_strlen + 2);
process_config_int(ini, section, "ipport", &configs_dest[renderd_section_num].ipport, 0);
process_config_int(ini, section, "num_threads", &configs_dest[renderd_section_num].num_threads, NUM_THREADS);
process_config_string(ini, section, "iphostname", &configs_dest[renderd_section_num].iphostname, "", INILINE_MAX);
process_config_string(ini, section, "pid_file", &configs_dest[renderd_section_num].pid_filename, RENDERD_PIDFILE, PATH_MAX);
process_config_string(ini, section, "socketname", &configs_dest[renderd_section_num].socketname, RENDERD_SOCKET, PATH_MAX);
process_config_string(ini, section, "stats_file", &configs_dest[renderd_section_num].stats_filename, "", PATH_MAX);
process_config_string(ini, section, "tile_dir", &configs_dest[renderd_section_num].tile_dir, RENDERD_TILE_DIR, PATH_MAX);
if (configs_dest[renderd_section_num].num_threads == -1) {
configs_dest[renderd_section_num].num_threads = sysconf(_SC_NPROCESSORS_ONLN);
}
if (strnlen(configs_dest[renderd_section_num].socketname, PATH_MAX) >= renderd_socketname_maxlen) {
g_logger(G_LOG_LEVEL_CRITICAL, "Specified socketname (%s) exceeds maximum allowed length of %i.", configs_dest[renderd_section_num].socketname, renderd_socketname_maxlen);
exit(7);
}
}
}
if (ini_loaded_here == 1) {
iniparser_freedict(ini);
}
if (renderd_section_num < 0) {
g_logger(G_LOG_LEVEL_CRITICAL, "No renderd config sections were found in file: %s", config_file_name);
exit(1);
}
}
void process_config_file(const char *config_file_name, int active_renderd_section_num, int log_level)
{
extern int num_slave_threads;
extern renderd_config config;
extern renderd_config config_slaves[MAX_SLAVES];
extern xmlconfigitem maps[XMLCONFIGS_MAX];
num_slave_threads = 0;
if (active_renderd_section_num < 0 || active_renderd_section_num >= MAX_SLAVES) {
g_logger(G_LOG_LEVEL_CRITICAL, "Active renderd section (%i) must be between %i and %i.", active_renderd_section_num, 0, MAX_SLAVES - 1);
exit(1);
}
g_logger(log_level, "Parsing renderd config file '%s':", config_file_name);
dictionary *ini = iniparser_load(config_file_name);
if (!ini) {
g_logger(G_LOG_LEVEL_CRITICAL, "Failed to load config file (process_config_file): '%s'", config_file_name);
exit(1);
}
free_renderd_sections(config_slaves);
process_renderd_sections(ini, config_file_name, config_slaves);
if (config_slaves[active_renderd_section_num].num_threads == 0) {
g_logger(G_LOG_LEVEL_CRITICAL, "Active renderd section (%i) does not exist.", active_renderd_section_num);
exit(1);
}
process_mapnik_section(ini, config_file_name, &config_slaves[active_renderd_section_num]);
free_map_sections(maps);
process_map_sections(ini, config_file_name, maps, config_slaves[active_renderd_section_num].tile_dir, config_slaves[active_renderd_section_num].num_threads);
iniparser_freedict(ini);
config = config_slaves[active_renderd_section_num];
for (int i = 0; i < MAX_SLAVES; i++) {
if (config_slaves[i].num_threads == 0) {
continue;
}
if (i == active_renderd_section_num) {
g_logger(G_LOG_LEVEL_DEBUG, "\trenderd(%i): Active", i);
} else {
num_slave_threads += config_slaves[i].num_threads;
}
if (config_slaves[i].ipport > 0) {
g_logger(G_LOG_LEVEL_DEBUG, "\trenderd(%i): ip socket = '%s:%i'", i, config_slaves[i].iphostname, config_slaves[i].ipport);
} else {
g_logger(G_LOG_LEVEL_DEBUG, "\trenderd(%i): unix socketname = '%s'", i, config_slaves[i].socketname);
}
g_logger(G_LOG_LEVEL_DEBUG, "\trenderd(%i): num_threads = '%i'", i, config_slaves[i].num_threads);
g_logger(G_LOG_LEVEL_DEBUG, "\trenderd(%i): pid_file = '%s'", i, config_slaves[i].pid_filename);
if (strnlen(config_slaves[i].stats_filename, PATH_MAX)) {
g_logger(G_LOG_LEVEL_DEBUG, "\trenderd(%i): stats_file = '%s'", i, config_slaves[i].stats_filename);
}
g_logger(G_LOG_LEVEL_DEBUG, "\trenderd(%i): tile_dir = '%s'", i, config_slaves[i].tile_dir);
}
if (config.ipport > 0) {
g_logger(log_level, "\trenderd: ip socket = '%s':%i", config.iphostname, config.ipport);
} else {
g_logger(log_level, "\trenderd: unix socketname = '%s'", config.socketname);
}
g_logger(log_level, "\trenderd: num_threads = '%i'", config.num_threads);
if (active_renderd_section_num == 0 && num_slave_threads > 0) {
g_logger(log_level, "\trenderd: num_slave_threads = '%i'", num_slave_threads);
}
g_logger(log_level, "\trenderd: pid_file = '%s'", config.pid_filename);
if (strnlen(config.stats_filename, PATH_MAX)) {
g_logger(log_level, "\trenderd: stats_file = '%s'", config.stats_filename);
}
g_logger(log_level, "\trenderd: tile_dir = '%s'", config.tile_dir);
g_logger(log_level, "\tmapnik: font_dir = '%s'", config.mapnik_font_dir);
g_logger(log_level, "\tmapnik: font_dir_recurse = '%s'", config.mapnik_font_dir_recurse ? "true" : "false");
g_logger(log_level, "\tmapnik: plugins_dir = '%s'", config.mapnik_plugins_dir);
for (int i = 0; i < XMLCONFIGS_MAX; i++) {
if (maps[i].xmlname != NULL) {
g_logger(log_level, "\tmap %i: name(%s) file(%s) uri(%s) output_format(%s) htcp(%s) host(%s)", i, maps[i].xmlname, maps[i].xmlfile, maps[i].xmluri, maps[i].output_format, maps[i].htcpip, maps[i].host);
}
}
}