MCPcopy Create free account
hub / github.com/RedisGears/RedisGears / RedisGearsPy_VerifySessionId

Function RedisGearsPy_VerifySessionId

plugins/python/redisgears_python.c:4979–4999  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4977#define VERIFY_CLUSTER_INITIALIZE(c) if(!RedisGears_ClusterIsInitialized()) return RedisModule_ReplyWithError(c, CLUSTER_ERROR" Uninitialized cluster state")
4978
4979static int RedisGearsPy_VerifySessionId(const char *id) {
4980 for (; *id ; ++id) {
4981 if (*id >= 'a' && *id <= 'z') {
4982 continue;
4983 }
4984 if (*id >= 'A' && *id <= 'Z') {
4985 continue;
4986 }
4987 if (*id >= '0' && *id <= '9') {
4988 continue;
4989 }
4990 if (*id == '_') {
4991 continue;
4992 }
4993 if (*id == '-') {
4994 continue;
4995 }
4996 return REDISMODULE_ERR;
4997 }
4998 return REDISMODULE_OK;
4999}
5000
5001int RedisGearsPy_Execute(RedisModuleCtx *ctx, RedisModuleString **argv, int argc){
5002#define ID_SIZE 40

Callers 1

RedisGearsPy_ExecuteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected