1 /* This file is part of Pazpar2.
2 Copyright (C) 2006-2010 Index Data
4 Pazpar2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #include <libxml/parser.h>
28 #include <libxml/tree.h>
30 #include <yaz/yaz-util.h>
32 #include <yaz/snprintf.h>
33 #include <yaz/tpath.h>
34 #include <yaz/xml_include.h>
36 #include <sys/types.h>
42 #include "pazpar2_config.h"
49 NMEM nmem; /* for conf_config and servers memory */
50 struct conf_server *servers;
54 iochan_man_t iochan_man;
55 database_hosts_t database_hosts;
59 static char *parse_settings(struct conf_config *config,
60 NMEM nmem, xmlNode *node);
62 static struct conf_targetprofiles *parse_targetprofiles(NMEM nmem,
65 static void conf_metadata_assign(NMEM nmem,
66 struct conf_metadata * metadata,
68 enum conf_metadata_type type,
69 enum conf_metadata_merge merge,
70 enum conf_setting_type setting,
75 enum conf_metadata_mergekey mt)
77 assert(nmem && metadata && name);
79 metadata->name = nmem_strdup(nmem, name);
81 metadata->type = type;
83 // enforcing that type_year is always range_merge
84 if (metadata->type == Metadata_type_year)
85 metadata->merge = Metadata_merge_range;
87 metadata->merge = merge;
89 metadata->setting = setting;
90 metadata->brief = brief;
91 metadata->termlist = termlist;
92 metadata->rank = rank;
93 metadata->sortkey_offset = sortkey_offset;
94 metadata->mergekey = mt;
98 static void conf_sortkey_assign(NMEM nmem,
99 struct conf_sortkey * sortkey,
101 enum conf_sortkey_type type)
103 assert(nmem && sortkey && name);
105 sortkey->name = nmem_strdup(nmem, name);
106 sortkey->type = type;
110 static struct conf_service *service_init(struct conf_server *server,
111 int num_metadata, int num_sortkeys,
112 const char *service_id)
114 struct conf_service * service = 0;
115 NMEM nmem = nmem_create();
117 service = nmem_malloc(nmem, sizeof(struct conf_service));
119 service->ref_count = 1;
120 service->nmem = nmem;
122 service->settings = 0;
123 service->databases = 0;
124 service->targetprofiles = 0;
125 service->server = server;
126 service->session_timeout = 60; /* default session timeout */
127 service->z3950_session_timeout = 180;
128 service->z3950_operation_timeout = 30;
130 service->relevance_pct = 0;
131 service->sort_pct = 0;
132 service->mergekey_pct = 0;
134 service->id = service_id ? nmem_strdup(nmem, service_id) : 0;
135 service->num_metadata = num_metadata;
136 service->metadata = 0;
137 if (service->num_metadata)
140 sizeof(struct conf_metadata) * service->num_metadata);
141 service->num_sortkeys = num_sortkeys;
142 service->sortkeys = 0;
143 if (service->num_sortkeys)
146 sizeof(struct conf_sortkey) * service->num_sortkeys);
147 service->dictionary = 0;
151 static struct conf_metadata* conf_service_add_metadata(
152 struct conf_service *service,
155 enum conf_metadata_type type,
156 enum conf_metadata_merge merge,
157 enum conf_setting_type setting,
162 enum conf_metadata_mergekey mt)
164 struct conf_metadata * md = 0;
166 if (!service || !service->metadata || !service->num_metadata
167 || field_id < 0 || !(field_id < service->num_metadata))
170 md = service->metadata + field_id;
171 conf_metadata_assign(service->nmem, md, name, type, merge, setting,
172 brief, termlist, rank, sortkey_offset,
178 static struct conf_sortkey * conf_service_add_sortkey(
179 struct conf_service *service,
182 enum conf_sortkey_type type)
184 struct conf_sortkey * sk = 0;
186 if (!service || !service->sortkeys || !service->num_sortkeys
187 || field_id < 0 || !(field_id < service->num_sortkeys))
190 //sk = &((service->sortkeys)[field_id]);
191 sk = service->sortkeys + field_id;
192 conf_sortkey_assign(service->nmem, sk, name, type);
198 int conf_service_metadata_field_id(struct conf_service *service,
203 if (!service || !service->metadata || !service->num_metadata)
206 for(i = 0; i < service->num_metadata; i++) {
207 if (!strcmp(name, (service->metadata[i]).name))
215 int conf_service_sortkey_field_id(struct conf_service *service,
220 if (!service || !service->sortkeys || !service->num_sortkeys)
223 for(i = 0; i < service->num_sortkeys; i++) {
224 if (!strcmp(name, (service->sortkeys[i]).name))
231 static void conf_dir_path(struct conf_config *config, WRBUF w, const char *src)
233 if (config->confdir && wrbuf_len(config->confdir) > 0 &&
234 !yaz_is_abspath(src))
236 wrbuf_printf(w, "%s/%s", wrbuf_cstr(config->confdir), src);
242 void service_destroy(struct conf_service *service)
246 if (!pazpar2_decref(&service->ref_count, service->mutex))
248 pp2_charset_destroy(service->relevance_pct);
249 pp2_charset_destroy(service->sort_pct);
250 pp2_charset_destroy(service->mergekey_pct);
251 yaz_mutex_destroy(&service->mutex);
252 nmem_destroy(service->nmem);
257 void service_incref(struct conf_service *service)
259 yaz_log(YLOG_LOG, "service_incref. p=%p cnt=%d", service,
261 pazpar2_incref(&service->ref_count, service->mutex);
264 static int parse_metadata(struct conf_service *service, xmlNode *n,
265 int *md_node, int *sk_node)
267 xmlChar *xml_name = xmlGetProp(n, (xmlChar *) "name");
268 xmlChar *xml_brief = xmlGetProp(n, (xmlChar *) "brief");
269 xmlChar *xml_sortkey = xmlGetProp(n, (xmlChar *) "sortkey");
270 xmlChar *xml_merge = xmlGetProp(n, (xmlChar *) "merge");
271 xmlChar *xml_type = xmlGetProp(n, (xmlChar *) "type");
272 xmlChar *xml_termlist = xmlGetProp(n, (xmlChar *) "termlist");
273 xmlChar *xml_rank = xmlGetProp(n, (xmlChar *) "rank");
274 xmlChar *xml_setting = xmlGetProp(n, (xmlChar *) "setting");
275 xmlChar *xml_mergekey = xmlGetProp(n, (xmlChar *) "mergekey");
277 enum conf_metadata_type type = Metadata_type_generic;
278 enum conf_metadata_merge merge = Metadata_merge_no;
279 enum conf_setting_type setting = Metadata_setting_no;
280 enum conf_sortkey_type sk_type = Metadata_sortkey_relevance;
281 enum conf_metadata_mergekey mergekey_type = Metadata_mergekey_no;
285 int sortkey_offset = 0;
287 // now do the parsing logic
290 yaz_log(YLOG_FATAL, "Must specify name in metadata element");
295 if (!strcmp((const char *) xml_brief, "yes"))
297 else if (strcmp((const char *) xml_brief, "no"))
299 yaz_log(YLOG_FATAL, "metadata/brief must be yes or no");
308 if (!strcmp((const char *) xml_termlist, "yes"))
310 else if (strcmp((const char *) xml_termlist, "no"))
312 yaz_log(YLOG_FATAL, "metadata/termlist must be yes or no");
320 rank = atoi((const char *) xml_rank);
326 if (!strcmp((const char *) xml_type, "generic"))
327 type = Metadata_type_generic;
328 else if (!strcmp((const char *) xml_type, "year"))
329 type = Metadata_type_year;
330 else if (!strcmp((const char *) xml_type, "date"))
331 type = Metadata_type_date;
335 "Unknown value for metadata/type: %s", xml_type);
340 type = Metadata_type_generic;
344 if (!strcmp((const char *) xml_merge, "no"))
345 merge = Metadata_merge_no;
346 else if (!strcmp((const char *) xml_merge, "unique"))
347 merge = Metadata_merge_unique;
348 else if (!strcmp((const char *) xml_merge, "longest"))
349 merge = Metadata_merge_longest;
350 else if (!strcmp((const char *) xml_merge, "range"))
351 merge = Metadata_merge_range;
352 else if (!strcmp((const char *) xml_merge, "all"))
353 merge = Metadata_merge_all;
357 "Unknown value for metadata/merge: %s", xml_merge);
362 merge = Metadata_merge_no;
366 if (!strcmp((const char *) xml_setting, "no"))
367 setting = Metadata_setting_no;
368 else if (!strcmp((const char *) xml_setting, "postproc"))
369 setting = Metadata_setting_postproc;
370 else if (!strcmp((const char *) xml_setting, "parameter"))
371 setting = Metadata_setting_parameter;
375 "Unknown value for medadata/setting: %s", xml_setting);
380 // add a sortkey if so specified
381 if (xml_sortkey && strcmp((const char *) xml_sortkey, "no"))
383 if (merge == Metadata_merge_no)
386 "Can't specify sortkey on a non-merged field");
389 if (!strcmp((const char *) xml_sortkey, "numeric"))
390 sk_type = Metadata_sortkey_numeric;
391 else if (!strcmp((const char *) xml_sortkey, "skiparticle"))
392 sk_type = Metadata_sortkey_skiparticle;
396 "Unknown sortkey in metadata element: %s",
400 sortkey_offset = *sk_node;
402 conf_service_add_sortkey(service, *sk_node,
403 (const char *) xml_name, sk_type);
412 if (!strcmp((const char *) xml_mergekey, "required"))
413 mergekey_type = Metadata_mergekey_required;
414 else if (!strcmp((const char *) xml_mergekey, "optional"))
415 mergekey_type = Metadata_mergekey_optional;
416 else if (!strcmp((const char *) xml_mergekey, "no"))
417 mergekey_type = Metadata_mergekey_no;
420 yaz_log(YLOG_FATAL, "Unknown value for mergekey: %s", xml_mergekey);
426 // metadata known, assign values
427 conf_service_add_metadata(service, *md_node,
428 (const char *) xml_name,
429 type, merge, setting,
430 brief, termlist, rank, sortkey_offset,
435 xmlFree(xml_sortkey);
438 xmlFree(xml_termlist);
440 xmlFree(xml_setting);
441 xmlFree(xml_mergekey);
446 static struct conf_service *service_create_static(struct conf_server *server,
448 const char *service_id)
454 struct conf_service *service = 0;
455 int num_metadata = 0;
456 int num_sortkeys = 0;
457 int got_settings = 0;
459 // count num_metadata and num_sortkeys
460 for (n = node->children; n; n = n->next)
461 if (n->type == XML_ELEMENT_NODE && !strcmp((const char *)
462 n->name, "metadata"))
464 xmlChar *sortkey = xmlGetProp(n, (xmlChar *) "sortkey");
466 if (sortkey && strcmp((const char *) sortkey, "no"))
471 service = service_init(server, num_metadata, num_sortkeys, service_id);
473 for (n = node->children; n; n = n->next)
475 if (n->type != XML_ELEMENT_NODE)
477 if (!strcmp((const char *) n->name, "timeout"))
479 xmlChar *src = xmlGetProp(n, (xmlChar *) "session");
482 service->session_timeout = atoi((const char *) src);
484 if (service->session_timeout < 9)
486 yaz_log(YLOG_FATAL, "session timeout out of range");
490 src = xmlGetProp(n, (xmlChar *) "z3950_operation");
493 service->z3950_operation_timeout = atoi((const char *) src);
495 if (service->z3950_session_timeout < 9)
497 yaz_log(YLOG_FATAL, "Z39.50 operation timeout out of range");
501 src = xmlGetProp(n, (xmlChar *) "z3950_session");
504 service->z3950_session_timeout = atoi((const char *) src);
506 if (service->z3950_session_timeout < 9)
508 yaz_log(YLOG_FATAL, "Z39.50 session timeout out of range");
513 else if (!strcmp((const char *) n->name, "settings"))
515 else if (!strcmp((const char *) n->name, (const char *) "targetprofiles"))
517 if (service->targetprofiles)
519 yaz_log(YLOG_FATAL, "Can't repeat targetprofiles");
522 if (!(service->targetprofiles =
523 parse_targetprofiles(service->nmem, n)))
526 else if (!strcmp((const char *) n->name, "relevance"))
528 if (service->relevance_pct)
530 yaz_log(YLOG_LOG, "relevance may not repeat in service");
535 service->relevance_pct = pp2_charset_create_xml(n);
536 if (!service->relevance_pct)
540 else if (!strcmp((const char *) n->name, "sort"))
542 if (service->sort_pct)
544 yaz_log(YLOG_LOG, "sort may not repeat in service");
549 service->sort_pct = pp2_charset_create_xml(n);
550 if (!service->sort_pct)
554 else if (!strcmp((const char *) n->name, "mergekey"))
556 if (service->mergekey_pct)
558 yaz_log(YLOG_LOG, "mergekey may not repeat in service");
563 service->mergekey_pct = pp2_charset_create_xml(n);
564 if (!service->mergekey_pct)
568 else if (!strcmp((const char *) n->name, (const char *) "metadata"))
570 if (parse_metadata(service, n, &md_node, &sk_node))
575 yaz_log(YLOG_FATAL, "Bad element: %s", n->name);
582 /* metadata has been read.. Consider now settings */
583 init_settings(service);
584 for (pass = 1; pass <= 2; pass++)
586 for (n = node->children; n; n = n->next)
588 if (n->type != XML_ELEMENT_NODE)
590 if (!strcmp((const char *) n->name, "settings"))
592 xmlChar *src = xmlGetProp(n, (xmlChar *) "src");
595 WRBUF w = wrbuf_alloc();
596 conf_dir_path(server->config, w, (const char *) src);
597 settings_read_file(service, wrbuf_cstr(w), pass);
603 settings_read_node(service, n, pass);
612 static char *parse_settings(struct conf_config *config,
613 NMEM nmem, xmlNode *node)
615 xmlChar *src = xmlGetProp(node, (xmlChar *) "src");
620 WRBUF w = wrbuf_alloc();
621 conf_dir_path(config, w, (const char *) src);
622 r = nmem_strdup(nmem, wrbuf_cstr(w));
627 yaz_log(YLOG_FATAL, "Must specify src in targetprofile");
634 static void inherit_server_settings(struct conf_service *s)
636 struct conf_server *server = s->server;
637 if (!s->dictionary) /* service has no config settings ? */
639 if (server->server_settings)
641 /* inherit settings from server */
643 settings_read_file(s, server->server_settings, 1);
644 settings_read_file(s, server->server_settings, 2);
648 yaz_log(YLOG_WARN, "service '%s' has no settings",
649 s->id ? s->id : "unnamed");
654 /* use relevance/sort/mergekey from server if not defined
655 for this service.. */
656 if (!s->relevance_pct)
658 if (server->relevance_pct)
660 s->relevance_pct = server->relevance_pct;
661 pp2_charset_incref(s->relevance_pct);
664 s->relevance_pct = pp2_charset_create(0);
669 if (server->sort_pct)
671 s->sort_pct = server->sort_pct;
672 pp2_charset_incref(s->sort_pct);
675 s->sort_pct = pp2_charset_create(0);
678 if (!s->mergekey_pct)
680 if (server->mergekey_pct)
682 s->mergekey_pct = server->mergekey_pct;
683 pp2_charset_incref(s->mergekey_pct);
686 s->mergekey_pct = pp2_charset_create(0);
690 struct conf_service *service_create(struct conf_server *server,
693 struct conf_service *service = service_create_static(server,
697 inherit_server_settings(service);
698 resolve_databases(service);
699 assert(service->mutex == 0);
700 yaz_mutex_create(&service->mutex);
705 static struct conf_server *server_create(struct conf_config *config,
706 NMEM nmem, xmlNode *node)
709 struct conf_server *server = nmem_malloc(nmem, sizeof(struct conf_server));
710 xmlChar *server_id = xmlGetProp(node, (xmlChar *) "id");
714 server->proxy_host = 0;
715 server->proxy_port = 0;
718 server->config = config;
720 server->relevance_pct = 0;
721 server->sort_pct = 0;
722 server->mergekey_pct = 0;
723 server->server_settings = 0;
724 server->http_server = 0;
725 server->iochan_man = 0;
726 server->database_hosts = 0;
730 server->server_id = nmem_strdup(nmem, (const char *)server_id);
734 server->server_id = 0;
735 for (n = node->children; n; n = n->next)
737 if (n->type != XML_ELEMENT_NODE)
739 if (!strcmp((const char *) n->name, "listen"))
741 xmlChar *port = xmlGetProp(n, (xmlChar *) "port");
742 xmlChar *host = xmlGetProp(n, (xmlChar *) "host");
744 server->port = atoi((const char *) port);
746 server->host = nmem_strdup(nmem, (const char *) host);
750 else if (!strcmp((const char *) n->name, "proxy"))
752 xmlChar *port = xmlGetProp(n, (xmlChar *) "port");
753 xmlChar *host = xmlGetProp(n, (xmlChar *) "host");
754 xmlChar *myurl = xmlGetProp(n, (xmlChar *) "myurl");
756 server->proxy_port = atoi((const char *) port);
758 server->proxy_host = nmem_strdup(nmem, (const char *) host);
760 server->myurl = nmem_strdup(nmem, (const char *) myurl);
765 else if (!strcmp((const char *) n->name, "settings"))
767 if (server->server_settings)
769 yaz_log(YLOG_FATAL, "Can't repeat 'settings'");
772 if (!(server->server_settings = parse_settings(config, nmem, n)))
775 else if (!strcmp((const char *) n->name, "relevance"))
777 server->relevance_pct = pp2_charset_create_xml(n);
778 if (!server->relevance_pct)
781 else if (!strcmp((const char *) n->name, "sort"))
783 server->sort_pct = pp2_charset_create_xml(n);
784 if (!server->sort_pct)
787 else if (!strcmp((const char *) n->name, "mergekey"))
789 server->mergekey_pct = pp2_charset_create_xml(n);
790 if (!server->mergekey_pct)
793 else if (!strcmp((const char *) n->name, "service"))
795 char *service_id = (char *)
796 xmlGetProp(n, (xmlChar *) "id");
798 struct conf_service **sp = &server->service;
799 for (; *sp; sp = &(*sp)->next)
800 if ((*sp)->id && service_id &&
801 0 == strcmp((*sp)->id, service_id))
803 yaz_log(YLOG_FATAL, "Duplicate service: %s", service_id);
806 else if (!(*sp)->id && !service_id)
808 yaz_log(YLOG_FATAL, "Duplicate unnamed service");
812 if (*sp) /* service already exist */
819 struct conf_service *s = service_create_static(server, n,
829 yaz_log(YLOG_FATAL, "Bad element: %s", n->name);
835 struct conf_service *s;
836 for (s = server->service; s; s = s->next)
837 inherit_server_settings(s);
842 WRBUF conf_get_fname(struct conf_service *service, const char *fname)
844 struct conf_config *config = service->server->config;
845 WRBUF w = wrbuf_alloc();
847 conf_dir_path(config, w, fname);
851 static struct conf_targetprofiles *parse_targetprofiles(NMEM nmem,
854 struct conf_targetprofiles *r = nmem_malloc(nmem, sizeof(*r));
855 xmlChar *type = xmlGetProp(node, (xmlChar *) "type");
856 xmlChar *src = xmlGetProp(node, (xmlChar *) "src");
858 memset(r, 0, sizeof(*r));
862 if (!strcmp((const char *) type, "local"))
863 r->type = Targetprofiles_local;
866 yaz_log(YLOG_FATAL, "Unknown targetprofile type");
872 yaz_log(YLOG_FATAL, "Must specify type for targetprofile");
877 r->src = nmem_strdup(nmem, (const char *) src);
880 yaz_log(YLOG_FATAL, "Must specify src in targetprofile");
888 struct conf_service *locate_service(struct conf_server *server,
889 const char *service_id)
891 struct conf_service *s = server->service;
892 for (; s; s = s->next)
893 if (s->id && service_id && 0 == strcmp(s->id, service_id))
895 else if (!s->id && !service_id)
903 static int parse_config(struct conf_config *config, xmlNode *root)
907 for (n = root->children; n; n = n->next)
909 if (n->type != XML_ELEMENT_NODE)
911 if (!strcmp((const char *) n->name, "server"))
913 struct conf_server *tmp = server_create(config, config->nmem, n);
916 tmp->next = config->servers;
917 config->servers = tmp;
919 else if (!strcmp((const char *) n->name, "threads"))
921 xmlChar *number = xmlGetProp(n, (xmlChar *) "number");
924 config->no_threads = atoi((const char *) number);
928 else if (!strcmp((const char *) n->name, "targetprofiles"))
930 yaz_log(YLOG_FATAL, "targetprofiles unsupported here. Must be part of service");
936 yaz_log(YLOG_FATAL, "Bad element: %s", n->name);
943 struct conf_config *config_create(const char *fname, int verbose)
945 xmlDoc *doc = xmlParseFile(fname);
949 NMEM nmem = nmem_create();
950 struct conf_config *config = nmem_malloc(nmem, sizeof(struct conf_config));
952 xmlSubstituteEntitiesDefault(1);
953 xmlLoadExtDtdDefaultValue = 1;
956 yaz_log(YLOG_FATAL, "Failed to read %s", fname);
963 config->no_threads = 0;
964 config->iochan_man = 0;
966 config->confdir = wrbuf_alloc();
967 if ((p = strrchr(fname,
976 wrbuf_write(config->confdir, fname, len);
978 wrbuf_puts(config->confdir, "");
980 n = xmlDocGetRootElement(doc);
981 r = yaz_xml_include_simple(n, wrbuf_cstr(config->confdir));
986 yaz_log(YLOG_LOG, "Configuration %s after include processing",
988 #if LIBXML_VERSION >= 20600
989 xmlDocFormatDump(yaz_log_file(), doc, 0);
991 xmlDocDump(yaz_log_file(), doc);
994 r = parse_config(config, n);
1000 config_destroy(config);
1006 void server_destroy(struct conf_server *server)
1008 struct conf_service *s = server->service;
1011 struct conf_service *s_next = s->next;
1015 pp2_charset_destroy(server->relevance_pct);
1016 pp2_charset_destroy(server->sort_pct);
1017 pp2_charset_destroy(server->mergekey_pct);
1018 yaz_log(YLOG_LOG, "server_destroy server=%p", server);
1019 http_server_destroy(server->http_server);
1022 void config_destroy(struct conf_config *config)
1026 struct conf_server *server = config->servers;
1027 iochan_man_destroy(&config->iochan_man);
1030 struct conf_server *s_next = server->next;
1031 server_destroy(server);
1034 database_hosts_destroy(&config->database_hosts);
1036 wrbuf_destroy(config->confdir);
1037 nmem_destroy(config->nmem);
1041 void config_stop_listeners(struct conf_config *conf)
1043 struct conf_server *ser;
1044 for (ser = conf->servers; ser; ser = ser->next)
1045 http_close_server(ser);
1048 void config_process_events(struct conf_config *conf)
1050 struct conf_server *ser;
1052 conf->database_hosts = database_hosts_create();
1053 for (ser = conf->servers; ser; ser = ser->next)
1055 struct conf_service *s = ser->service;
1057 ser->database_hosts = conf->database_hosts;
1059 for (;s ; s = s->next)
1061 resolve_databases(s);
1062 assert(s->mutex == 0);
1063 yaz_mutex_create(&s->mutex);
1065 http_mutex_init(ser);
1067 iochan_man_events(conf->iochan_man);
1070 int config_start_listeners(struct conf_config *conf,
1071 const char *listener_override)
1073 struct conf_server *ser;
1075 conf->iochan_man = iochan_man_create(conf->no_threads);
1076 for (ser = conf->servers; ser; ser = ser->next)
1078 WRBUF w = wrbuf_alloc();
1081 ser->iochan_man = conf->iochan_man;
1082 if (listener_override)
1084 wrbuf_puts(w, listener_override);
1085 listener_override = 0; /* only first server is overriden */
1090 wrbuf_puts(w, ser->host);
1095 wrbuf_printf(w, "%d", ser->port);
1098 r = http_init(wrbuf_cstr(w), ser);
1104 if (ser->proxy_host || ser->proxy_port)
1106 if (ser->proxy_host)
1107 wrbuf_puts(w, ser->proxy_host);
1108 if (ser->proxy_port)
1112 wrbuf_printf(w, "%d", ser->proxy_port);
1116 http_set_proxyaddr(wrbuf_cstr(w), ser);
1125 * c-file-style: "Stroustrup"
1126 * indent-tabs-mode: nil
1128 * vim: shiftwidth=4 tabstop=8 expandtab