]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
style: Fixed indentation and removed trailing white spaces in C code.
authorKarel Slany <karel.slany@nic.cz>
Fri, 10 Apr 2015 10:46:37 +0000 (12:46 +0200)
committerKarel Slany <karel.slany@nic.cz>
Fri, 10 Apr 2015 10:46:37 +0000 (12:46 +0200)
33 files changed:
daemon/bindings.c
daemon/engine.c
daemon/engine.h
daemon/main.c
daemon/network.c
daemon/worker.h
include/kgetdns.h
lib/cache.c
lib/cache.h
lib/defines.h
lib/generic/array.h
lib/generic/map.c
lib/generic/map.h
lib/generic/set.h
lib/layer.h
lib/layer/iterate.c
lib/layer/itercache.c
lib/module.c
lib/module.h
lib/nsrep.c
lib/nsrep.h
lib/resolve.c [changed mode: 0755->0644]
lib/resolve.h
lib/rplan.h
lib/utils.c
lib/utils.h
lib/zonecut.c
lib/zonecut.h
modules/cachectl/cachectl.c
modules/hints/hints.c
tests/test_cache.c
tests/test_integration.c
tests/test_rplan.c

index 7eebee38ab270a8043270c8b63022db082cf7f26..e28aafb6e1935db582db00aa19b9797b2b378be7 100644 (file)
@@ -204,7 +204,7 @@ static int net_interfaces(lua_State *L)
                }
                *(p - 1) = '\0';
                lua_pushstring(L, buf);
-               lua_setfield(L, -2, "mac");             
+               lua_setfield(L, -2, "mac");
 
                /* Push table */
                lua_setfield(L, -2, iface.name);
@@ -273,4 +273,4 @@ int lib_cache(lua_State *L)
 
        register_lib(L, "cache", lib);
        return 1;
-}
\ No newline at end of file
+}
index 8c88b4edaac55a4a0cb375d9712fc3254a362203..c26cd42e49402c5bc61193a1a29e57cd498b3ac5 100644 (file)
@@ -37,7 +37,7 @@
 /** Print help and available commands. */
 static int l_help(lua_State *L)
 {
-       static const char *help_str = 
+       static const char *help_str =
                "help()\n    show this help\n"
                "quit()\n    quit\n"
                "modules.list()\n    list modules\n"
@@ -242,7 +242,7 @@ int engine_start(struct engine *engine)
                return ret;
        }
 
-       return uv_run(uv_default_loop(), UV_RUN_DEFAULT);       
+       return uv_run(uv_default_loop(), UV_RUN_DEFAULT);
 }
 
 void engine_stop(struct engine *engine)
@@ -320,8 +320,8 @@ void engine_lualib(struct engine *engine, const char *name, lua_CFunction lib_cb
 
 struct engine *engine_luaget(lua_State *L)
 {
-       lua_getglobal(L, "__engine");
+       lua_getglobal(L, "__engine");
        struct engine *engine = lua_touserdata(L, -1);
        lua_pop(engine->L, 1);
        return engine;
-}
\ No newline at end of file
+}
index 98712bb50cf741c587abfbb82c5f0cd88812f26c..d7acd94d8a8d8db8c8ccd6e3eaa2b4ff7840585a 100644 (file)
@@ -41,4 +41,4 @@ int engine_register(struct engine *engine, const char *module);
 int engine_unregister(struct engine *engine, const char *module);
 /** Return engine light userdata. */
 void engine_lualib(struct engine *engine, const char *name, int (*lib_cb) (struct lua_State *));
-struct engine *engine_luaget(struct lua_State *L);
\ No newline at end of file
+struct engine *engine_luaget(struct lua_State *L);
index 1a1e0a53fb20848dc4a59b2295de9c42d5eafa4c..ef5bc3790ad5eb8c63371a1cad78bc60b7cd6fc3 100644 (file)
@@ -70,7 +70,7 @@ static const char *set_addr(char *addr, int *port)
                *port = atoi(p + 1);
                *p = '\0';
        }
-       
+
        return addr;
 }
 
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
                        return EXIT_FAILURE;
                }
                printf("[system] rundir '%s'\n", argv[optind]);
-       }
+       }
 
        /* Block signals. */
        uv_loop_t *loop = uv_default_loop();
index 2b3af1780c85ede947a41b19f8675eabc602b7e8..ee2bb1bfc8b35fc799f9b59879b4131ad548d3cf 100644 (file)
@@ -161,7 +161,7 @@ int network_close(struct network *net, const char *addr, uint16_t port)
                        break;
                }
        }
-       
+
        /* Collapse key if it has no endpoint. */
        if (ep_array->len == 0) {
                free(ep_array);
index fff2d521e10df258bcfdb396f4bff66977b31b1b..72e27896cdf6d7440856eaa93b969e6603e9d60b 100644 (file)
@@ -31,7 +31,7 @@ struct worker_ctx {
 
 /**
  * Resolve query.
- * 
+ *
  * @param worker
  * @param answer
  * @param query
index d9d7f692946c457729b94e09f8b91417b98ce0ef..73ed90ab9b323badaf76d577b3966e057fd314a0 100644 (file)
@@ -346,7 +346,7 @@ getdns_return_t getdns_context_set_edns_version(
 
 /**
  * Set EDNS DO (DNSSEC OK) bit.
- * 
+ *
  * @param value EDNS DO bit (0 or 1, default 0).
  */
 getdns_return_t getdns_context_set_edns_do_bit(
index 2a48f7b49c1c5f8973a4a89318f7b6451b8861e8..cba0fc81c3ffaf0313b3e9df93a3210391130e36 100644 (file)
@@ -163,7 +163,7 @@ knot_rrset_t kr_cache_materialize(const knot_rrset_t *src, uint32_t drift, mm_ct
        if (copy.owner == NULL) {
                return copy;
        }
-       
+
        for (uint16_t i = 0; i < src->rrs.rr_count; ++i) {
                knot_rdata_t *rd = knot_rdataset_at(&src->rrs, i);
                if (knot_rdata_ttl(rd) > drift) {
@@ -173,13 +173,13 @@ knot_rrset_t kr_cache_materialize(const knot_rrset_t *src, uint32_t drift, mm_ct
                        }
                }
        }
-       
+
        /* Update TTLs. */
        for (uint16_t i = 0; i < copy.rrs.rr_count; ++i) {
                knot_rdata_t *rd = knot_rdataset_at(&copy.rrs, i);
                knot_rdata_set_ttl(rd, knot_rdata_ttl(rd) - drift);
        }
-       
+
        return copy;
 }
 
index 23c864b94fc2d0a1e9b5f421bc845b8450f38aa9..371a48f2e71ca6d20039d556081c18c87c137af1 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /** \addtogroup cache
- * @{ 
+ * @{
  */
 #pragma once
 
index 3604b0039003cf722d8e2c2f6cd9a5992ed91316..9121fa681de5d41220577cd5a3b0e14b6bbe6edd 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /** \addtogroup resolution
- * @{ 
+ * @{
  */
 
 #pragma once
@@ -47,6 +47,6 @@
  */
 #define KR_DNS_PORT   53
 #define KR_EDNS_VERSION 0
-#define KR_EDNS_PAYLOAD 4096  
+#define KR_EDNS_PAYLOAD 4096
 
 /** @} */
index c4191357ab643e9beb49a9449ba31b52d663703d..8fa93809fbe51e8f4a08d0972c98ba199b8112bb 100644 (file)
  * \note The C has no generics, so it is implemented mostly using macros.
  * Be aware of that, as direct usage of the macros in the evaluating macros
  * may lead to different expectations, i.e.
- * 
+ *
  *     MIN(array_push(arr, val))
  *
  *  May evaluate the code twice, leading to unexpected behaviour.
  *  This is a price to pay for absence of proper generics.
  *
  *  Example usage:
- *  
+ *
  *      array_t(const char*) arr;
  *      array_init(arr);
- *      
+ *
  *      // Reserve memory in advance
  *      if (array_reserve(arr, 2) < 0) {
  *          return ENOMEM;
@@ -52,9 +52,9 @@
  *
  *      // Random delete
  *      array_del(arr, 0);
- * 
+ *
  * \addtogroup generics
- * @{ 
+ * @{
  */
 
 #pragma once
index 1242d84a19673dcae13f18eb8b8fb440b31909a6..683db284658a8f0e090fe0cccf4546c0c8507132 100644 (file)
@@ -108,7 +108,7 @@ static cb_data_t *cbt_make_data(map_t *map, const uint8_t *str, size_t len, void
                x->value = value;
                memcpy(x->key, str, len);
        }
-       return x;       
+       return x;
 }
 
 /*! Creates a new, empty critbit map */
index 8126008afa8bcc6758a1484abc0e13f539ab0d08..25258d198f34c4a38b8656ed1828b4cba1a41386 100644 (file)
@@ -7,14 +7,14 @@
  * Generics - A Crit-bit tree 'map' implementation.
  *
  *  @warning If the user provides a custom allocator, it must return addresses aligned to 2B boundary.
- * 
+ *
  *  Example usage:
- *  
+ *
  *      map_t map = map_make();
  *
- *     // Custom allocator (optional)
- *     map.malloc = &mymalloc;
- *     map.baton  = &mymalloc_context;
+ *      // Custom allocator (optional)
+ *      map.malloc = &mymalloc;
+ *      map.baton  = &mymalloc_context;
  *
  *      // Insert keys
  *      if (map_set(&map, "princess") != 0 ||
@@ -29,7 +29,7 @@
  *      }
  *
  *      // Prefix search
- *      int i = 0; 
+ *      int i = 0;
  *      int count(const char *s, void *n) { (*(int *)n)++; return 0; }
  *      if (map_walk_prefixed(map, "princ", count, &i) == 0) {
  *          printf("%d matches\n", i);
@@ -42,9 +42,9 @@
  *
  *      // Clear the map
  *      map_clear(&map);
- * 
+ *
  * \addtogroup generics
- * @{ 
+ * @{
  */
 
 #pragma once
@@ -94,4 +94,4 @@ int map_walk_prefixed(map_t *map, const char *prefix,
 }
 #endif
 
-/** @} */
\ No newline at end of file
+/** @} */
index a288b6730dd4700eb23d91eb3b59af13246d5075..39427b408bd5c76dab728d93c798a67cd4e6d763 100644 (file)
@@ -2,9 +2,9 @@
  * Generics - A Crit-bit set implementation.
  *
  *  @note The API is based on @fn map.h, see it for more examples.
- * 
+ *
  *  Example usage:
- *  
+ *
  *      set_t set = set_make();
  *
  *      // Insert keys
@@ -20,7 +20,7 @@
  *      }
  *
  *      // Prefix search
- *      int i = 0; 
+ *      int i = 0;
  *      int count(const char *s, void *n) { (*(int *)n)++; return 0; }
  *      if (set_walk_prefixed(set, "princ", count, &i) == 0) {
  *          printf("%d matches\n", i);
@@ -33,9 +33,9 @@
  *
  *      // Clear the set
  *      set_clear(&set);
- * 
+ *
  * \addtogroup generics
- * @{ 
+ * @{
  */
 
 #pragma once
index 1d25a3d2f349d01ccf0fa5a80323e8ec5059b0c9..6dd115d2d878bf118c0a3c763875f42eb48fffab 100644 (file)
@@ -17,7 +17,7 @@
 #pragma once
 
 /** \addtogroup rplan
- * @{ 
+ * @{
  */
 
 #include <libknot/processing/layer.h>
index bbd5e8fd4e9db88ed828676f47868f3014fe82e4..271f9e95e7883e71e994fb98e285fb0421332c40 100644 (file)
@@ -35,7 +35,7 @@ enum {
        PKT_NOERROR   = 1 << 0, /* Positive response */
        PKT_NODATA    = 1 << 1, /* No data response */
        PKT_NXDOMAIN  = 1 << 2, /* Negative response */
-       PKT_ERROR     = 1 << 3  /* Refused or server failure */ 
+       PKT_ERROR     = 1 << 3  /* Refused or server failure */
 };
 
 /* Iterator often walks through packet section, this is an abstraction. */
@@ -155,7 +155,7 @@ int rr_update_parent(const knot_rrset_t *rr, unsigned hint, struct kr_layer_para
 int rr_update_answer(const knot_rrset_t *rr, unsigned hint, struct kr_layer_param *param)
 {
        knot_pkt_t *answer = param->answer;
-       
+
        /* Write copied RR to the result packet. */
        int ret = knot_pkt_put(answer, KNOT_COMPR_HINT_NONE, rr, hint);
        if (ret != KNOT_EOK) {
@@ -176,7 +176,7 @@ static bool has_glue(const knot_dname_t *ns_name, knot_pkt_t *pkt)
                const knot_rrset_t *rr = knot_pkt_rr(ar, i);
                if ((rr->type == KNOT_RRTYPE_A || rr->type == KNOT_RRTYPE_AAAA) &&
                   (knot_dname_is_equal(ns_name, rr->owner))) {
-                       return true;
+                       return true;
                }
        }
        return false;
@@ -372,7 +372,7 @@ static int prepare_query(knot_layer_t *ctx, knot_pkt_t *pkt)
 
        query->id = dnssec_random_uint16_t();
        knot_wire_set_id(pkt->wire, query->id);
-       
+
        /* Declare EDNS0 support. */
        knot_rrset_t opt_rr;
        ret = knot_edns_init(&opt_rr, KR_EDNS_PAYLOAD, 0, KR_EDNS_VERSION, &pkt->mm);
index 91181c0c9ae541d869f6e6f862ceedae23083d82..edf363c70de609a1b1fbceb09a81026a70cb7422 100644 (file)
@@ -50,7 +50,7 @@ static int update_answer(const knot_rrset_t *rr, unsigned drift, struct kr_layer
        if (rr_copy.rrs.rr_count == 0) {
                return KNOT_STATE_FAIL;
        }
-       
+
        return rr_update_answer(&rr_copy, 0, param);
 }
 
index 4d6d8180719fad2299be336b364b1c93edabc61a..08ed61387f77df7bf8aba185bb65b4508c0c8662 100644 (file)
 /** Check ABI version, return error on mismatch. */
 #define ABI_CHECK(m, prefix, symname, required) do { \
        if ((m)->lib != RTLD_DEFAULT) { \
-               module_api_cb *_api = NULL; \
-               *(void **) (&_api) = load_symbol((m)->lib, (prefix), (symname)); \
-               if (_api == NULL) { \
-                       return kr_error(ENOENT); \
-               } \
-               if (_api() != (required)) { \
-                       return kr_error(ENOTSUP); \
-               } \
-       }\
- } while (0)
-
-/** Load ABI by symbol names. */ 
+               module_api_cb *_api = NULL; \
+               *(void **) (&_api) = load_symbol((m)->lib, (prefix), (symname)); \
+               if (_api == NULL) { \
+                       return kr_error(ENOENT); \
+               } \
+               if (_api() != (required)) { \
+                       return kr_error(ENOTSUP); \
+               } \
+       }\
+} while (0)
+
+/** Load ABI by symbol names. */
 #define ABI_LOAD(m, prefix, s_init, s_deinit, s_config, s_layer, s_prop) do { \
-       module_prop_cb *module_prop = NULL; \
+       module_prop_cb *module_prop = NULL; \
        *(void **) (&(m)->init)   = load_symbol((m)->lib, (prefix), (s_init)); \
        *(void **) (&(m)->deinit) = load_symbol((m)->lib, (prefix), (s_deinit)); \
        *(void **) (&(m)->config) = load_symbol((m)->lib, (prefix), (s_config)); \
@@ -76,9 +76,9 @@ static int load_library(struct kr_module *module, const char *name, const char *
 /** Load C module symbols. */
 static int load_sym_c(struct kr_module *module, uint32_t api_required)
 {
-       auto_free char *module_prefix = kr_strcatdup(2, module->name, "_");
-       ABI_CHECK(module, module_prefix, "api", api_required);
-       ABI_LOAD(module, module_prefix, "init", "deinit", "config", "layer", "props");
+       auto_free char *module_prefix = kr_strcatdup(2, module->name, "_");
+       ABI_CHECK(module, module_prefix, "api", api_required);
+       ABI_LOAD(module, module_prefix, "init", "deinit", "config", "layer", "props");
        return kr_ok();
 }
 
@@ -114,7 +114,7 @@ static int bootstrap_libgo(struct kr_module *module)
        return kr_ok();
 }
 
-/** Load Go module symbols. */ 
+/** Load Go module symbols. */
 static int load_ffi_go(struct kr_module *module, uint32_t api_required)
 {
        /* Bootstrap libgo */
@@ -149,7 +149,7 @@ int kr_module_load(struct kr_module *module, const char *name, const char *path)
                auto_free char *local_path = kr_strcatdup(2, getenv("HOME"), "/.local" MODULEDIR);
                if (load_library(module, name, local_path) != 0) {
                        if (load_library(module, name, PREFIX MODULEDIR) != 0) {
-                               module->lib = RTLD_DEFAULT;     
+                               module->lib = RTLD_DEFAULT;
                        }
                }
        }
@@ -168,7 +168,6 @@ int kr_module_load(struct kr_module *module, const char *name, const char *path)
                kr_module_unload(module);
        }
 
-
        return ret;
 }
 
index 575fd973f3095dd5af8b5c69316f0b3e359fa603..40dc27bb5929aea7d087ee94a5c1c684ee5a7a35 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /** \addtogroup modules
- * @{ 
+ * @{
  */
 
 #pragma once
@@ -73,7 +73,7 @@ struct kr_module {
 
 /**
  * Load module instance into memory.
- * 
+ *
  * @param module module structure
  * @param name module name
  * @param path module search path
@@ -83,14 +83,14 @@ int kr_module_load(struct kr_module *module, const char *name, const char *path)
 
 /**
  * Unload module instance.
- * 
+ *
  * @param module module structure
  */
 void kr_module_unload(struct kr_module *module);
 
 /**
  * Export module API version (place this at the end of your module).
- * 
+ *
  * @param module module name (f.e. hints)
  */
 #define KR_MODULE_EXPORT(module) \
index bc19c28c1204b419208ceea68d04e7cc50670629..2a3f2fbdbfd70de5c3cdf1f2b398cf125a597b30 100644 (file)
@@ -4,4 +4,4 @@ int kr_nsrep_score(const knot_dname_t *ns, struct kr_layer_param *param)
 {
        /* TODO: stub, always returns valid */
        return KR_NS_VALID;
-}
\ No newline at end of file
+}
index 9a5641c1f203b530c2d0ee102cd4e25ae7fe09b6..922912a8ded8a55daa916221d0aeda36dec1717b 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /** \addtogroup nameservers
- * @{ 
+ * @{
  */
 
 #pragma once
old mode 100755 (executable)
new mode 100644 (file)
index 5b62364..c836908
@@ -39,7 +39,7 @@ static int invalidate_ns(struct kr_rplan *rplan, struct kr_query *qry)
        if (txn == NULL) {
                return KNOT_EOK;
        }
-       
+
        /* Fetch current nameserver cache. */
        uint32_t drift = qry->timestamp.tv_sec;
        knot_rrset_t cached;
@@ -49,7 +49,7 @@ static int invalidate_ns(struct kr_rplan *rplan, struct kr_query *qry)
                return KNOT_EOK;
        }
        cached = kr_cache_materialize(&cached, drift, rplan->pool);
-       
+
        /* Find a matching RD. */
        knot_rdataset_t to_remove;
        knot_rdataset_init(&to_remove);
@@ -61,7 +61,7 @@ static int invalidate_ns(struct kr_rplan *rplan, struct kr_query *qry)
        }
        knot_rdataset_subtract(&cached.rrs, &to_remove, rplan->pool);
        knot_rdataset_clear(&to_remove, rplan->pool);
-       
+
        /* Remove record(s) */
        int ret = KNOT_EOK;
        if (cached.rrs.rr_count == 0) {
@@ -78,7 +78,7 @@ static int invalidate_ns(struct kr_rplan *rplan, struct kr_query *qry)
 
 static int ns_resolve_addr(struct kr_query *cur, struct kr_layer_param *param)
 {
-       if (kr_rplan_satisfies(cur, cur->zone_cut.ns, KNOT_CLASS_IN, KNOT_RRTYPE_A) || 
+       if (kr_rplan_satisfies(cur, cur->zone_cut.ns, KNOT_CLASS_IN, KNOT_RRTYPE_A) ||
            kr_rplan_satisfies(cur, cur->zone_cut.ns, KNOT_CLASS_IN, KNOT_RRTYPE_AAAA)) {
                DEBUG_MSG("=> dependency loop, bailing out\n");
                kr_rplan_pop(param->rplan, cur);
index 913bcc55cdd2ba5f5df076d2716ee6e38cac528b..7319c246ebd25ec67ff4872b0b5be7f48dc5ac99 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /** \addtogroup resolution
- * @{ 
+ * @{
  */
 
 #pragma once
index 5c40a182f9b0bb55c0ce5e02501df13ae094bd67..8008dfd25bd06c2d16527dfc8332ac9f77720391 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /** \addtogroup rplan
- * @{ 
+ * @{
  */
 
 #pragma once
index 5f3c6035537dd4404ec347f466f48f33145fb6f6..1d79fb417c8748d1e3399dc6e42c58de275cd0e0 100644 (file)
@@ -2,6 +2,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
+
 #include "lib/defines.h"
 #include "lib/utils.h"
 
  */
 void _cleanup_free(char **p)
 {
-    free(*p);
+       free(*p);
 }
 
 void _cleanup_close(int *p)
 {
-    if (*p > 0) close(*p);
+       if (*p > 0) close(*p);
 }
 
 void _cleanup_fclose(FILE **p)
 {
-    if (*p) fclose(*p);
+       if (*p) fclose(*p);
 }
 
 char* kr_strcatdup(unsigned n, ...)
 {
-    /* Calculate total length */
-    size_t total_len = 0;
-    va_list vl;
-    va_start(vl, n);
-    for (unsigned i = 0; i < n; ++i) {
-        char *item = va_arg(vl, char *);
-        total_len += strlen_safe(item);
-    }
-    va_end(vl);
-
-    /* Allocate result and fill */
-    char *result = NULL;
-    if (total_len > 0) {
-        result = malloc(total_len + 1);
-    }
-    if (result) {
-        char *stream = result;
-        va_start(vl, n);
-        for (unsigned i = 0; i < n; ++i) {
-            char *item = va_arg(vl, char *);
-            if (item) {
-                size_t len = strlen(item);
-                memcpy(stream, item, len + 1);
-                stream += len;
-            }
-        }
-        va_end(vl);
-    }
-
-    return result;
-}
\ No newline at end of file
+       /* Calculate total length */
+       size_t total_len = 0;
+       va_list vl;
+       va_start(vl, n);
+       for (unsigned i = 0; i < n; ++i) {
+               char *item = va_arg(vl, char *);
+               total_len += strlen_safe(item);
+       }
+       va_end(vl);
+
+       /* Allocate result and fill */
+       char *result = NULL;
+       if (total_len > 0) {
+               result = malloc(total_len + 1);
+       }
+       if (result) {
+               char *stream = result;
+               va_start(vl, n);
+               for (unsigned i = 0; i < n; ++i) {
+                       char *item = va_arg(vl, char *);
+                       if (item) {
+                               size_t len = strlen(item);
+                               memcpy(stream, item, len + 1);
+                               stream += len;
+                       }
+               }
+               va_end(vl);
+       }
+
+       return result;
+}
index 0ad06a4f652d35067e6e6dabf8d07d3484cc28b7..215261dcc98ce088c507800413c1774a6b1f9f89 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /** \addtogroup utils
- * @{ 
+ * @{
  */
 
 #pragma once
index efbab766bbaf20d0152108a0e49273bf243c64d9..2f9e12d5e23d9ef43a9a9f91c516e5150f4963f1 100644 (file)
@@ -137,7 +137,7 @@ static int fetch_ns(struct kr_zonecut *cut, const knot_dname_t *name, namedb_txn
        if (ret != KNOT_EOK) {
                return ret;
        }
-       
+
        /* Accept only if has address records cached. */
        for (unsigned i = 0; i < cached_rr.rrs.rr_count; ++i) {
                kr_set_zone_cut(cut, name, knot_ns_name(&cached_rr.rrs, i));
index 90a07981dc88ec0f53848bf646f651a857aa324d..0af033a6f06bc4fa840b7a8c9293090d5f8c61ed 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /** \addtogroup rplan
- * @{ 
+ * @{
  */
 
 #pragma once
index 97041da3a7c5f38992d449ee55632c1d692a8839..59290311e89363a1b55c2fac65ee51649ebc40ea 100644 (file)
@@ -40,7 +40,7 @@
  *
  * Input:  N/A
  * Output: { size: int }
- * 
+ *
  */
 static char* get_size(void *env, struct kr_module *module, const char *args)
 {
@@ -57,7 +57,7 @@ static char* get_size(void *env, struct kr_module *module, const char *args)
        } else {
                asprintf(&result, "{ \"error\": \"%s\" }", knot_strerror(ret));
        }
-       
+
        return result;
 }
 
@@ -84,7 +84,7 @@ static int is_expired(struct kr_cache_rrset *rr, uint32_t drift)
  *
  * Input:  N/A
  * Output: { pruned: int }
- * 
+ *
  */
 static char* prune(void *env, struct kr_module *module, const char *args)
 {
@@ -124,7 +124,7 @@ static char* prune(void *env, struct kr_module *module, const char *args)
        } else {
                asprintf(&result, "{ \"pruned\": %d }", pruned);
        }
-       
+
        return result;
 }
 
@@ -133,7 +133,7 @@ static char* prune(void *env, struct kr_module *module, const char *args)
  *
  * Input:  N/A
  * Output: { result: bool }
- * 
+ *
  */
 static char* clear(void *env, struct kr_module *module, const char *args)
 {
@@ -164,13 +164,13 @@ static char* clear(void *env, struct kr_module *module, const char *args)
 
 struct kr_prop *cachectl_props(void)
 {
-    static struct kr_prop prop_list[] = {
-        { &get_size, "size",  "Return number of cached records.", },
-        { &prune,    "prune", "Prune expired/invalid records.", },
-        { &clear,    "clear", "Clear all cache records.", },
-        { NULL, NULL, NULL }
-    };
-    return prop_list;
+       static struct kr_prop prop_list[] = {
+           { &get_size, "size",  "Return number of cached records.", },
+           { &prune,    "prune", "Prune expired/invalid records.", },
+           { &clear,    "clear", "Clear all cache records.", },
+           { NULL, NULL, NULL }
+       };
+       return prop_list;
 }
 
 KR_MODULE_EXPORT(cachectl);
index fbcfd87ba795a2aa242b9a7413e77904c890523b..e0c95f5e84f5d967e19ea94701b35e6a5cc8da9a 100644 (file)
@@ -31,7 +31,7 @@
 
 /* TODO: this is an experimental (slow) proof-of-concept,
  *       this will be rewritten with namedb API
- */ 
+ */
 
 typedef int (*rr_callback_t)(const knot_rrset_t *, unsigned, struct kr_layer_param *);
 
@@ -89,7 +89,7 @@ static int query(knot_layer_t *ctx, knot_pkt_t *pkt)
                        knot_rrset_t rr;
                        knot_rrset_init(&rr, pair->name, qtype, KNOT_CLASS_IN);
                        struct sockaddr_storage addr;
-                       sockaddr_set(&addr, addr_type, pair->addr, 0); 
+                       sockaddr_set(&addr, addr_type, pair->addr, 0);
                        size_t addr_len = 0;
                        uint8_t *raw_addr = sockaddr_raw(&addr, &addr_len);
                        knot_rrset_add_rdata(&rr, raw_addr, addr_len, 0, &param->answer->mm);
@@ -135,7 +135,7 @@ static int load_map(struct hint_map *map, FILE *fp)
                        if (pair->addr == NULL) {
                                return kr_error(ENOMEM);
                        }
-                       
+
                        strcpy(pair->addr, tok);
                        add_tail(&map->list, &pair->n);
                        name_tok = strtok_r(NULL, " \t\n", &saveptr);
index e8015d5d7c5473972f2b09b95199206bbbdc8546..86e79267521b3fdc1c4d3528f6698563d0060dbf 100644 (file)
@@ -26,7 +26,7 @@ knot_rrset_t global_rr;
 const char *global_env;
 
 #define CACHE_SIZE 10 * 4096
-#define CACHE_TTL 2 
+#define CACHE_TTL 2
 
 /* Test invalid parameters. */
 static void test_invalid(void **state)
index 2fb7c8063c7e442e9d165749edb7853465bccaf5..33b7a999d16f8b028bd9c1910e443a8c43a568f0 100644 (file)
@@ -64,7 +64,7 @@ static PyObject* init(PyObject* self, PyObject* args)
        memset(&global_context, 0, sizeof(struct kr_context));
        global_context.pool = &global_mm;
        global_context.modules = &global_modules;
-       
+
        global_tmpdir = test_tmpdir_create();
        assert(global_tmpdir);
        global_context.cache = kr_cache_open(global_tmpdir, &global_mm, 100 * 4096);
@@ -72,7 +72,7 @@ static PyObject* init(PyObject* self, PyObject* args)
 
        /* No configuration parsing support yet. */
        if (strstr(config, "query-minimization: on") == NULL) {
-               global_context.options |= QUERY_NO_MINIMIZE; 
+               global_context.options |= QUERY_NO_MINIMIZE;
        }
 
        return Py_BuildValue("");
index e1f53c359abc0546f326b279cf1a1bcb27342c05..f25bc9ba1c66912f50c2faeee53bfeb95e05925c 100644 (file)
@@ -30,7 +30,7 @@ static void test_rplan_params(void **state)
        assert_null(kr_rplan_txn_acquire(NULL, 0));
        assert_int_equal(kr_rplan_txn_commit(NULL), KNOT_EINVAL);
        kr_rplan_deinit(NULL);
-       
+
        /* NULL mandatory parameters */
 
        struct kr_rplan rplan;