]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Minor formatting fixes
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 27 Oct 2012 10:26:35 +0000 (11:26 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 27 Oct 2012 21:15:07 +0000 (22:15 +0100)
src/modules/rlm_cache/rlm_cache.c

index a39b72d44534230536abe9ec2488c369f1681642..8d572841b767b2fcea730ca5b84b878d3c71dd60 100644 (file)
@@ -68,7 +68,6 @@ typedef struct rlm_cache_entry_t {
 #define PTHREAD_MUTEX_UNLOCK(_x)
 #endif
 
-
 /*
  *     Compare two entries by key.  There may only be one entry with
  *     the same key.
@@ -376,7 +375,7 @@ static int cache_xlat(void *instance, REQUEST *request,
        DICT_ATTR *target;
        const char *p = fmt;
        char buffer[1024];
-       int ret=0;
+       int ret = 0;
 
        radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL);
 
@@ -420,8 +419,8 @@ static int cache_xlat(void *instance, REQUEST *request,
        ret = vp_prints_value(out, freespace, vp, 0);
 done:
        PTHREAD_MUTEX_UNLOCK(&inst->cache_mutex);
+       
        return ret;
-
 }
 
 
@@ -436,13 +435,13 @@ done:
  */
 static const CONF_PARSER module_config[] = {
        { "key",  PW_TYPE_STRING_PTR,
-         offsetof(rlm_cache_t, key), NULL,  NULL},
+         offsetof(rlm_cache_t, key), NULL, NULL},
        { "ttl", PW_TYPE_INTEGER,
-         offsetof(rlm_cache_t, ttl), NULL,   "500" },
+         offsetof(rlm_cache_t, ttl), NULL, "500" },
        { "epoch", PW_TYPE_INTEGER,
-         offsetof(rlm_cache_t, epoch), NULL,   "0" },
+         offsetof(rlm_cache_t, epoch), NULL, "0" },
        { "add-stats", PW_TYPE_BOOLEAN,
-         offsetof(rlm_cache_t, stats), NULL,   "no" },
+         offsetof(rlm_cache_t, stats), NULL, "no" },
 
        { NULL, -1, 0, NULL, NULL }             /* end the list */
 };
@@ -586,7 +585,7 @@ static int cache_it(void *instance, REQUEST *request)
        rlm_cache_t *inst = instance;
        VALUE_PAIR *vp;
        char buffer[1024];
-       int retcode;
+       int rcode;
 
        radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL);
 
@@ -598,31 +597,30 @@ static int cache_it(void *instance, REQUEST *request)
         */
        vp = pairfind(request->config_items, PW_CACHE_STATUS_ONLY);
        if (vp && vp->vp_integer) {
-               if (c) {
-                       retcode = RLM_MODULE_OK;
-               } else {
-                       retcode = RLM_MODULE_NOTFOUND;
-               }
+               rcode = c ? RLM_MODULE_OK:
+                           RLM_MODULE_NOTFOUND;
                goto done;
        }
        
        if (c) {
                cache_merge(inst, request, c);
-               retcode = RLM_MODULE_OK;
+               
+               rcode = RLM_MODULE_OK;
                goto done;
        }
 
        c = cache_add(inst, request, buffer);
        if (!c) {
-               retcode = RLM_MODULE_NOOP;
+               rcode = RLM_MODULE_NOOP;
                goto done;
        }
 
        cache_merge(inst, request, c);
-       retcode = RLM_MODULE_UPDATED;
+       rcode = RLM_MODULE_UPDATED;
+       
 done:
        PTHREAD_MUTEX_UNLOCK(&inst->cache_mutex);
-       return retcode;
+       return rcode;
 }
 
 
@@ -638,7 +636,7 @@ done:
 module_t rlm_cache = {
        RLM_MODULE_INIT,
        "cache",
-       0,                      /* type */
+       0,                              /* type */
        cache_instantiate,              /* instantiation */
        cache_detach,                   /* detach */
        {