[asterisk-commits] snuffy: branch snuffy/func_memcache r232915 - /team/snuffy/func_memcache/funcs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 3 16:02:56 CST 2009


Author: snuffy
Date: Thu Dec  3 16:02:52 2009
New Revision: 232915

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=232915
Log:
Small update..

Modified:
    team/snuffy/func_memcache/funcs/func_memcache.c

Modified: team/snuffy/func_memcache/funcs/func_memcache.c
URL: http://svnview.digium.com/svn/asterisk/team/snuffy/func_memcache/funcs/func_memcache.c?view=diff&rev=232915&r1=232914&r2=232915
==============================================================================
--- team/snuffy/func_memcache/funcs/func_memcache.c (original)
+++ team/snuffy/func_memcache/funcs/func_memcache.c Thu Dec  3 16:02:52 2009
@@ -16,9 +16,11 @@
 
 /*! \file
  *
- * \brief Functions for interaction with the Asterisk database
+ * \brief Memcache - Memory based cache
  *
  * \author Bradley Latus <snuffy22 at gmail.com>
+ *
+ * \extref Depends on libmemcached library - http://danga.com/memcached/
  *
  * \ingroup functions
  */
@@ -141,7 +143,7 @@
 
 #define MEMC_DEF_PORT 11211
 
-static int fn_memcache_get(char *key, const char *server, char *buf, size_t len)
+static int fn_memcache_get(const char *server, const char *key, char *buf, size_t len)
 {
 	struct memcache_con *memc = NULL;
 	char *value = NULL;
@@ -174,7 +176,7 @@
 	return 1;
 }
 
-static int fn_memcache_put(const char *key, const char *server, const char *expiry, const char *value)
+static int fn_memcache_put(const char *server, const char *key, const char *expiry, const char *value)
 {
 	struct memcache_con *memc;
 
@@ -208,7 +210,7 @@
 	return 1;
 }
 
-static int fn_memcache_del(const char *key, const char *server, const char *expiry)
+static int fn_memcache_del(const char *server, const char *key, const char *expiry)
 {
 	struct memcache_con *memc;
 
@@ -262,7 +264,7 @@
 		return -1;
 	}
 
-	if (fn_memcache_get(args.key, args.server, buf, len)) {
+	if (fn_memcache_get(args.server, args.key, buf, len)) {
 		ast_debug(1, "MEMCACHE: %s not found in cache.\n", args.key);
 		strcpy(buf, "0");
 	} else {
@@ -302,7 +304,7 @@
 		ast_log(LOG_WARNING, "MEMCACHE expiry must be 0 for infinite or >0\n");
 		return -1;
 	}	
-	if (fn_memcache_put(args.key, args.server, args.expiry, value)) {
+	if (fn_memcache_put(args.server, args.key, args.expiry, value)) {
 		ast_log(LOG_WARNING, "MEMCACHE error writing key:%s to server\n", args.key);
 		return -1;
 	}
@@ -332,7 +334,7 @@
 		return -1;
 	}
 
-	if (fn_memcache_get(args.key, args.server, buf, len)) {
+	if (fn_memcache_get(args.server, args.key, buf, len)) {
 		ast_debug(1, "MEMCACHE: %s not found in cache.\n", args.key);
 		strcpy(buf, "0");
 	} else {
@@ -370,12 +372,12 @@
 		return -1;
 	}	
 
-	if (fn_memcache_get(args.key, args.server, buf, len)) {
+	if (fn_memcache_get(args.server, args.key, buf, len)) {
 		ast_debug(1, "MEMCACHE_DELETE: %s/%s not found in database\n", args.server, args.key);
 		pbx_builtin_setvar_helper(chan, "MEMCACHE_RESULT", "");
 		strcpy(buf, "0");
 	} else {
-		if (fn_memcache_del(args.key, args.server, args.expiry)) {
+		if (fn_memcache_del(args.server, args.key, args.expiry)) {
 			ast_debug(1, "MEMCACHE_DELETE: %s/%s could not be deleted from the database\n", args.server, args.key);
 			strcpy(buf, "0");
 		}




More information about the asterisk-commits mailing list