"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/module.c" between
redis-6.0.7.tar.gz and redis-6.0.8.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

module.c  (redis-6.0.7):module.c  (redis-6.0.8)
skipping to change at line 3302 skipping to change at line 3302
return argv; return argv;
fmterr: fmterr:
for (j = 0; j < argc; j++) for (j = 0; j < argc; j++)
decrRefCount(argv[j]); decrRefCount(argv[j]);
zfree(argv); zfree(argv);
return NULL; return NULL;
} }
/* Exported API to call any Redis command from modules. /* Exported API to call any Redis command from modules.
*
* * **cmdname**: The Redis command to call.
* * **fmt**: A format specifier string for the command's arguments. Each
* of the arguments should be specified by a valid type specification:
* b The argument is a buffer and is immediately followed by another
* argument that is the buffer's length.
* c The argument is a pointer to a plain C string (null-terminated).
* l The argument is long long integer.
* s The argument is a RedisModuleString.
* v The argument(s) is a vector of RedisModuleString.
*
* The format specifier can also include modifiers:
* ! Sends the Redis command and its arguments to replicas and AOF.
* A Suppress AOF propagation, send only to replicas (requires `!`).
* R Suppress replicas propagation, send only to AOF (requires `!`).
* * **...**: The actual arguments to the Redis command.
*
* On success a RedisModuleCallReply object is returned, otherwise * On success a RedisModuleCallReply object is returned, otherwise
* NULL is returned and errno is set to the following values: * NULL is returned and errno is set to the following values:
* *
* EBADF: wrong format specifier. * EBADF: wrong format specifier.
* EINVAL: wrong command arity. * EINVAL: wrong command arity.
* ENOENT: command does not exist. * ENOENT: command does not exist.
* EPERM: operation in Cluster instance with key in non local slot. * EPERM: operation in Cluster instance with key in non local slot.
* EROFS: operation in Cluster instance when a write command is sent * EROFS: operation in Cluster instance when a write command is sent
* in a readonly state. * in a readonly state.
* ENETDOWN: operation in Cluster instance when cluster is down. * ENETDOWN: operation in Cluster instance when cluster is down.
* *
* Example code fragment:
*
* reply = RedisModule_Call(ctx,"INCRBY","sc",argv[1],"10");
* if (RedisModule_CallReplyType(reply) == REDISMODULE_REPLY_INTEGER) {
* long long myval = RedisModule_CallReplyInteger(reply);
* // Do something with myval.
* }
*
* This API is documented here: https://redis.io/topics/modules-intro * This API is documented here: https://redis.io/topics/modules-intro
*/ */
RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const ch ar *fmt, ...) { RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const ch ar *fmt, ...) {
struct redisCommand *cmd; struct redisCommand *cmd;
client *c = NULL; client *c = NULL;
robj **argv = NULL; robj **argv = NULL;
int argc = 0, flags = 0; int argc = 0, flags = 0;
va_list ap; va_list ap;
RedisModuleCallReply *reply = NULL; RedisModuleCallReply *reply = NULL;
int replicate = 0; /* Replicate this command? */ int replicate = 0; /* Replicate this command? */
skipping to change at line 4880 skipping to change at line 4905
} }
/* Acquire the server lock before executing a thread safe API call. /* Acquire the server lock before executing a thread safe API call.
* This is not needed for `RedisModule_Reply*` calls when there is * This is not needed for `RedisModule_Reply*` calls when there is
* a blocked client connected to the thread safe context. */ * a blocked client connected to the thread safe context. */
void RM_ThreadSafeContextLock(RedisModuleCtx *ctx) { void RM_ThreadSafeContextLock(RedisModuleCtx *ctx) {
UNUSED(ctx); UNUSED(ctx);
moduleAcquireGIL(); moduleAcquireGIL();
} }
/* Similar to RM_ThreadSafeContextLock but this function
* would not block if the server lock is already acquired.
*
* If successful (lock acquired) REDISMODULE_OK is returned,
* otherwise REDISMODULE_ERR is returned and errno is set
* accordingly. */
int RM_ThreadSafeContextTryLock(RedisModuleCtx *ctx) {
UNUSED(ctx);
int res = moduleTryAcquireGIL();
if(res != 0) {
errno = res;
return REDISMODULE_ERR;
}
return REDISMODULE_OK;
}
/* Release the server lock after a thread safe API call was executed. */ /* Release the server lock after a thread safe API call was executed. */
void RM_ThreadSafeContextUnlock(RedisModuleCtx *ctx) { void RM_ThreadSafeContextUnlock(RedisModuleCtx *ctx) {
UNUSED(ctx); UNUSED(ctx);
moduleReleaseGIL(); moduleReleaseGIL();
} }
void moduleAcquireGIL(void) { void moduleAcquireGIL(void) {
pthread_mutex_lock(&moduleGIL); pthread_mutex_lock(&moduleGIL);
} }
int moduleTryAcquireGIL(void) {
return pthread_mutex_trylock(&moduleGIL);
}
void moduleReleaseGIL(void) { void moduleReleaseGIL(void) {
pthread_mutex_unlock(&moduleGIL); pthread_mutex_unlock(&moduleGIL);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
* Module Keyspace Notifications API * Module Keyspace Notifications API
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
/* Subscribe to keyspace notifications. This is a low-level version of the /* Subscribe to keyspace notifications. This is a low-level version of the
* keyspace-notifications API. A module can register callbacks to be notified * keyspace-notifications API. A module can register callbacks to be notified
skipping to change at line 7895 skipping to change at line 7941
REGISTER_API(BlockClient); REGISTER_API(BlockClient);
REGISTER_API(UnblockClient); REGISTER_API(UnblockClient);
REGISTER_API(IsBlockedReplyRequest); REGISTER_API(IsBlockedReplyRequest);
REGISTER_API(IsBlockedTimeoutRequest); REGISTER_API(IsBlockedTimeoutRequest);
REGISTER_API(GetBlockedClientPrivateData); REGISTER_API(GetBlockedClientPrivateData);
REGISTER_API(AbortBlock); REGISTER_API(AbortBlock);
REGISTER_API(Milliseconds); REGISTER_API(Milliseconds);
REGISTER_API(GetThreadSafeContext); REGISTER_API(GetThreadSafeContext);
REGISTER_API(FreeThreadSafeContext); REGISTER_API(FreeThreadSafeContext);
REGISTER_API(ThreadSafeContextLock); REGISTER_API(ThreadSafeContextLock);
REGISTER_API(ThreadSafeContextTryLock);
REGISTER_API(ThreadSafeContextUnlock); REGISTER_API(ThreadSafeContextUnlock);
REGISTER_API(DigestAddStringBuffer); REGISTER_API(DigestAddStringBuffer);
REGISTER_API(DigestAddLongLong); REGISTER_API(DigestAddLongLong);
REGISTER_API(DigestEndSequence); REGISTER_API(DigestEndSequence);
REGISTER_API(NotifyKeyspaceEvent); REGISTER_API(NotifyKeyspaceEvent);
REGISTER_API(GetNotifyKeyspaceEvents); REGISTER_API(GetNotifyKeyspaceEvents);
REGISTER_API(SubscribeToKeyspaceEvents); REGISTER_API(SubscribeToKeyspaceEvents);
REGISTER_API(RegisterClusterMessageReceiver); REGISTER_API(RegisterClusterMessageReceiver);
REGISTER_API(SendClusterMessage); REGISTER_API(SendClusterMessage);
REGISTER_API(GetClusterNodeInfo); REGISTER_API(GetClusterNodeInfo);
 End of changes. 5 change blocks. 
0 lines changed or deleted 47 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)