* return true if the node (param node) is existing, nonobscured and
* can be used to generate answers from. It is then also node_exact.
* returns false if the node is not good enough (or it wasn't node_exact)
- * in this case the ce can be filled.
- * if ce is NULL, no ce exists, and likely the zone is completely empty,
- * not even with a zone apex.
+ * in this case the ce can be filled.
+ * if ce is NULL, no ce exists, and likely the zone is completely empty,
+ * not even with a zone apex.
* if ce is nonNULL it is the closest enclosing upper name (that exists
* itself for answer purposes). That name may have DNAME, NS or wildcard
* rrset is the closest DNAME or NS rrset that was found.
/** find a line with ( ) collated */
static int
chunkline_get_line_collated(struct auth_chunk** chunk, size_t* chunk_pos,
- sldns_buffer* buf)
+ sldns_buffer* buf)
{
size_t pos;
int parens = 0;
edns.edns_version = 0;
edns.bits = EDNS_DO;
edns.opt_list = NULL;
- if(sldns_buffer_capacity(buf) < 65535)
- edns.udp_size = (uint16_t)sldns_buffer_capacity(buf);
- else edns.udp_size = 65535;
+ if(sldns_buffer_capacity(buf) < 65535)
+ edns.udp_size = (uint16_t)sldns_buffer_capacity(buf);
+ else edns.udp_size = 65535;
/* unlock xfr during mesh_new_callback() because the callback can be
* called straight away */
xfr_transfer_init_fetch(struct auth_xfer* xfr, struct module_env* env)
{
struct sockaddr_storage addr;
- socklen_t addrlen = 0;
+ socklen_t addrlen = 0;
struct auth_master* master = xfr->task_transfer->master;
if(!master) return 0;
/** callback for task_transfer tcp connections */
int
auth_xfer_transfer_tcp_callback(struct comm_point* c, void* arg, int err,
- struct comm_reply* ATTR_UNUSED(repinfo))
+ struct comm_reply* ATTR_UNUSED(repinfo))
{
struct auth_xfer* xfr = (struct auth_xfer*)arg;
struct module_env* env;
/** callback for task_transfer http connections */
int
auth_xfer_transfer_http_callback(struct comm_point* c, void* arg, int err,
- struct comm_reply* repinfo)
+ struct comm_reply* repinfo)
{
struct auth_xfer* xfr = (struct auth_xfer*)arg;
struct module_env* env;
/** callback for task_probe udp packets */
int
auth_xfer_probe_udp_callback(struct comm_point* c, void* arg, int err,
- struct comm_reply* repinfo)
+ struct comm_reply* repinfo)
{
struct auth_xfer* xfr = (struct auth_xfer*)arg;
struct module_env* env;
edns.edns_version = 0;
edns.bits = EDNS_DO;
edns.opt_list = NULL;
- if(sldns_buffer_capacity(buf) < 65535)
- edns.udp_size = (uint16_t)sldns_buffer_capacity(buf);
- else edns.udp_size = 65535;
+ if(sldns_buffer_capacity(buf) < 65535)
+ edns.udp_size = (uint16_t)sldns_buffer_capacity(buf);
+ else edns.udp_size = 65535;
/* unlock xfr during mesh_new_callback() because the callback can be
* called straight away */
p += 8;
*ssl = 1;
*port = AUTH_HTTPS_PORT;
+ } else if(strstr(p, "://") && strchr(p, '/') > strstr(p, "://") &&
+ strchr(p, ':') >= strstr(p, "://")) {
+ char* uri = dup_prefix(p, (size_t)(strstr(p, "://")-p));
+ log_err("protocol %s:// not supported (for url %s)",
+ uri?uri:"", p);
+ free(uri);
+ return 0;
}
/* parse hostname part */
return 1;
}
-#define SERIAL_BITS 32
+#define SERIAL_BITS 32
int
compare_serial(uint32_t a, uint32_t b)
{
- const uint32_t cutoff = ((uint32_t) 1 << (SERIAL_BITS - 1));
+ const uint32_t cutoff = ((uint32_t) 1 << (SERIAL_BITS - 1));
- if (a == b) {
- return 0;
- } else if ((a < b && b - a < cutoff) || (a > b && a - b > cutoff)) {
- return -1;
- } else {
- return 1;
- }
+ if (a == b) {
+ return 0;
+ } else if ((a < b && b - a < cutoff) || (a > b && a - b > cutoff)) {
+ return -1;
+ } else {
+ return 1;
+ }
}