]> git.saurik.com Git - redis.git/blobdiff - src/redis.c
unstable merge conflicts resolved
[redis.git] / src / redis.c
index 89efffbabd844aec36ee4d06b220918a2c0acf5d..f4e3f6239b2ab5f84047082cca6aa24d57791d4a 100644 (file)
@@ -192,7 +192,9 @@ struct redisCommand redisCommandTable[] = {
     {"migrate",migrateCommand,6,0,NULL,0,0,0,0,0},
     {"dump",dumpCommand,2,0,NULL,0,0,0,0,0},
     {"object",objectCommand,-2,0,NULL,0,0,0,0,0},
-    {"client",clientCommand,-2,0,NULL,0,0,0,0,0}
+    {"client",clientCommand,-2,0,NULL,0,0,0,0,0},
+    {"eval",evalCommand,-3,REDIS_CMD_DENYOOM,zunionInterGetKeys,0,0,0,0,0},
+    {"evalsha",evalShaCommand,-3,REDIS_CMD_DENYOOM,zunionInterGetKeys,0,0,0,0,0}
 };
 
 /*============================ Utility functions ============================ */
@@ -759,6 +761,8 @@ void createSharedObjects(void) {
         "-ERR source and destination objects are the same\r\n"));
     shared.outofrangeerr = createObject(REDIS_STRING,sdsnew(
         "-ERR index out of range\r\n"));
+    shared.noscripterr = createObject(REDIS_STRING,sdsnew(
+        "-NOSCRIPT No matching script. Please use EVAL.\r\n"));
     shared.loadingerr = createObject(REDIS_STRING,sdsnew(
         "-LOADING Redis is loading the dataset in memory\r\n"));
     shared.space = createObject(REDIS_STRING,sdsnew(" "));
@@ -835,6 +839,7 @@ void initServerConfig() {
     server.shutdown_asap = 0;
     server.cluster_enabled = 0;
     server.cluster.configfile = zstrdup("nodes.conf");
+    server.lua_time_limit = REDIS_LUA_TIME_LIMIT;
 
     updateLRUClock();
     resetServerSaveParams();
@@ -952,6 +957,7 @@ void initServer() {
     }
 
     if (server.cluster_enabled) clusterInit();
+    scriptingInit();
     srand(time(NULL)^getpid());
 }
 
@@ -1285,6 +1291,7 @@ sds genRedisInfoString(char *section) {
             "used_memory_rss:%zu\r\n"
             "used_memory_peak:%zu\r\n"
             "used_memory_peak_human:%s\r\n"
+            "used_memory_lua:%lld\r\n"
             "mem_fragmentation_ratio:%.2f\r\n"
             "mem_allocator:%s\r\n",
             zmalloc_used_memory(),
@@ -1292,6 +1299,7 @@ sds genRedisInfoString(char *section) {
             zmalloc_get_rss(),
             server.stat_peak_memory,
             peak_hmem,
+            ((long long)lua_gc(server.lua,LUA_GCCOUNT,0))*1024LL,
             zmalloc_get_fragmentation_ratio(),
             ZMALLOC_LIB
             );