--- /dev/null
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+# 'default' is a built-in configuration intended to be used in
+# 'listen-on' statements
+http default {
+ endpoints { "/dns-query"; };
+ listener-clients 100;
+ streams-per-connection 100;
+};
const cfg_listelt_t *elt = NULL;
isc_symvalue_t symvalue;
- /* Check for duplicates */
- symvalue.as_cpointer = http;
- result = isc_symtab_define(symtab, name, 1, symvalue,
- isc_symexists_reject);
- if (result == ISC_R_EXISTS) {
- const char *file = NULL;
- unsigned int line;
+ if (strcasecmp(name, "default") == 0) {
+ cfg_obj_log(http, logctx, ISC_LOG_ERROR,
+ "'http' name cannot be '%s' (which is a "
+ "built-in configuration)",
+ name);
+ result = ISC_R_FAILURE;
+ } else {
+ /* Check for duplicates */
+ symvalue.as_cpointer = http;
+ result = isc_symtab_define(symtab, name, 1, symvalue,
+ isc_symexists_reject);
+ if (result == ISC_R_EXISTS) {
+ const char *file = NULL;
+ unsigned int line;
+
+ tresult = isc_symtab_lookup(symtab, name, 1, &symvalue);
+ RUNTIME_CHECK(tresult == ISC_R_SUCCESS);
- tresult = isc_symtab_lookup(symtab, name, 1, &symvalue);
- RUNTIME_CHECK(tresult == ISC_R_SUCCESS);
+ line = cfg_obj_line(symvalue.as_cpointer);
+ file = cfg_obj_file(symvalue.as_cpointer);
+ if (file == NULL) {
+ file = "<unknown file>";
+ }
- line = cfg_obj_line(symvalue.as_cpointer);
- file = cfg_obj_file(symvalue.as_cpointer);
- if (file == NULL) {
- file = "<unknown file>";
+ cfg_obj_log(http, logctx, ISC_LOG_ERROR,
+ "http '%s' is duplicated: "
+ "also defined at %s:%u",
+ name, file, line);
}
-
- cfg_obj_log(http, logctx, ISC_LOG_ERROR,
- "http '%s' is duplicated: "
- "also defined at %s:%u",
- name, file, line);
}
/* Check endpoints are valid */