6,164 matches across 25 files for error
snippet_mode: auto · sorted by relevance
84#define CLUSTER_MANAGER_NODE_ARRAY_FREE(array) zfree((array)->alloc)
85
86▶#define CLUSTER_MANAGER_PRINT_REPLY_ERROR(n, err) \
87 clusterManagerLogErr("Node %s:%d replied with error:\n%s\n", \
88 (n)->ip, (n)->port, (err));
· · ·
87▶ clusterManagerLogErr("Node %s:%d replied with error:\n%s\n", \
88 (n)->ip, (n)->port, (err));
89
· · ·
143/* cliConnect() flags. */
144#define CC_FORCE (1<<0) /* Re-connect if already connected. */
145▶#define CC_QUIET (1<<1) /* Don't log connecting errors. */
146
147/* DNS lookup */
· · ·
354 *
355 * The function returns NULL (if the file is /dev/null or cannot be
356▶ * obtained for some error), or an SDS string that must be freed by
357 * the user. */
358static sds getDotfilePath(char *envoverride, char *dotfilename) {
· · ·
885 if (!ctx) return NULL;
886 serverInfo = redisCommand(ctx, "INFO SERVER");
887▶ if (serverInfo == NULL || serverInfo->type == REDIS_REPLY_ERROR) {
888 freeReplyObject(serverInfo);
889 return sdsempty();
+ 217 more matches in this file
427#define REDISMODULE_ARGV_SCRIPT_MODE (1<<6)
428#define REDISMODULE_ARGV_NO_WRITES (1<<7)
429▶#define REDISMODULE_ARGV_CALL_REPLIES_AS_ERRORS (1<<8)
430#define REDISMODULE_ARGV_RESPECT_DENY_OOM (1<<9)
431#define REDISMODULE_ARGV_DRY_RUN (1<<10)
· · ·
534static struct redisCommandArg *moduleCopyCommandArgs(RedisModuleCommandArg *args,
535 const RedisModuleCommandInfoVersion *version);
536▶static redisCommandArgType moduleConvertArgType(RedisModuleCommandArgType type, int *error);
537static int moduleConvertArgFlags(int flags);
538void moduleCreateContext(RedisModuleCtx *out_ctx, RedisModule *module, int ctx_flags);
· · ·
909 listDelNode(c->reply,listFirst(c->reply));
910 }
911▶ CallReply *reply = callReplyCreate(proto, c->deferred_reply_errors, ctx);
912 c->deferred_reply_errors = NULL; /* now the responsibility of the reply object. */
913 return reply;
· · ·
912▶ c->deferred_reply_errors = NULL; /* now the responsibility of the reply object. */
913 return reply;
914}
· · ·
1172 * There are these characters:
1173 * ' ' (space) - issues with old inline protocol.
1174▶ * '\r', '\n' (newline) - can mess up the protocol on acl error replies.
1175 * '|' - sub-commands.
1176 * '@' - ACL categories.
+ 246 more matches in this file
36
37/* This macro is called when the internal RDB structure is corrupt */
38▶#define rdbReportCorruptRDB(...) rdbReportError(1, __LINE__,__VA_ARGS__)
39/* This macro is called when RDB read failed (possibly a short read) */
40#define rdbReportReadError(...) rdbReportError(0, __LINE__,__VA_ARGS__)
· · ·
40▶#define rdbReportReadError(...) rdbReportError(0, __LINE__,__VA_ARGS__)
41
42/* This macro tells if we are in the context of a RESTORE command, and not loading an RDB or AOF. */
· · ·
44 ((server.current_client == NULL || server.current_client->id == CLIENT_ID_AOF) ? 0 : 1)
45
46▶char* rdbFileBeingLoaded = NULL; /* used for rdb checking on read error */
47extern int rdbCheckMode;
48void rdbCheckError(const char *fmt, ...);
· · ·
48▶void rdbCheckError(const char *fmt, ...);
49void rdbCheckSetError(const char *fmt, ...);
50
· · ·
49▶void rdbCheckSetError(const char *fmt, ...);
50
51#ifdef __GNUC__
+ 175 more matches in this file
1428 * We could directly terminate the child process via SIGUSR1
1429 * without handling it */
1430▶ if (exitcode == SERVER_CHILD_NOERROR_RETVAL) {
1431 bysignal = SIGUSR1;
1432 exitcode = 1;
· · ·
1434
1435 if (pid == -1) {
1436▶ serverLog(LL_WARNING,"waitpid() returned an error: %s. "
1437 "child_type: %s, child_pid = %d",
1438 strerror(errno),
· · ·
1438▶ strerror(errno),
1439 strChildType(server.child_type),
1440 (int) server.child_pid);
· · ·
1643 if (server.mstime >= server.shutdown_mstime || isReadyToShutdown()) {
1644 if (finishShutdown() == C_OK) exit(0);
1645▶ /* Shutdown failed. Continue running. An error has been logged. */
1646 }
1647 }
· · ·
1702 /* Save if we reached the given amount of changes,
1703 * the given amount of seconds, and if the latest bgsave was
1704▶ * successful or if, in case of an error, at least
1705 * CONFIG_BGSAVE_RETRY_DELAY seconds already elapsed. */
1706 if (server.dirty >= sp->changes &&
+ 157 more matches in this file
28#include <ctype.h>
29
30▶static void setProtocolError(const char *errstr, client *c);
31static void pauseClientsByClient(mstime_t end, int isPauseClientAll);
32char *getClientSockname(client *c);
· · ·
188 c->flags = 0;
189 c->io_flags = CLIENT_IO_READ_ENABLED | CLIENT_IO_WRITE_ENABLED;
190▶ c->read_error = 0;
191 c->slot = -1;
192 c->cluster_compatibility_check_slot = -2;
· · ·
214 c->main_ch_client_id = 0;
215 c->reply = listCreate();
216▶ c->deferred_reply_errors = NULL;
217 c->reply_bytes = c->reply_bytes_shared = c->reply_bytes_unshared = 0;
218 c->obuf_soft_limit_reached_time = 0;
· · ·
642}
643
644▶/* Low level function called by the addReplyError...() functions.
645 * It emits the protocol for a Redis error, in the form:
646 *
· · ·
645▶ * It emits the protocol for a Redis error, in the form:
646 *
647 * -ERRORCODE Error Message<CR><LF>
+ 224 more matches in this file
531
532 /* Check that the new ID is greater than the last entry ID
533▶ * or return an error. Automatically generated IDs might
534 * overflow (and wrap-around) when incrementing the sequence
535 part. */
· · ·
1079 *
1080 * This function returns the position of the ID argument (relevant only to XADD).
1081▶ * On error -1 is returned and a reply is sent. */
1082static int streamParseAddOrTrimArgsOrReply(client *c, streamAddTrimArgs *args, int xadd) {
1083 /* Initialize arguments to defaults */
· · ·
1098 } else if (!strcasecmp(opt,"maxlen") && moreargs) {
1099 if (args->trim_strategy != TRIM_STRATEGY_NONE) {
1100▶ addReplyError(c,"syntax error, MAXLEN and MINID options at the same time are not compatible");
1101 return -1;
1102 }
· · ·
1114
1115 if (args->maxlen < 0) {
1116▶ addReplyError(c,"The MAXLEN argument must be >= 0.");
1117 return -1;
1118 }
· · ·
1122 } else if (!strcasecmp(opt,"minid") && moreargs) {
1123 if (args->trim_strategy != TRIM_STRATEGY_NONE) {
1124▶ addReplyError(c,"syntax error, MAXLEN and MINID options at the same time are not compatible");
1125 return -1;
1126 }
+ 101 more matches in this file
65 * yield back to eventloop. If main channel connection detects a network problem
66 * we want to abort loading. It calls rioAbort() in this case, so next rioRead()
67▶ * from rdbchannel connection will return error to cancel loading safely. */
68static rio *disklessLoadingRio = NULL;
69
· · ·
228 int retval = unlink(filename);
229 if (retval == -1) {
230▶ /* If we got an unlink error, we just return it, closing the
231 * new reference we have to the file. */
232 int old_errno = errno;
· · ·
1094 *
1095 * 1) Handle the slaves in WAIT_START state, by preparing them for a full
1096▶ * sync if the BGSAVE was successfully started, or sending them an error
1097 * and dropping them from the list of slaves.
1098 *
· · ·
1111 * to avoid overwriting the snapshot RDB file with filtered data. */
1112 socket_target = (server.repl_diskless_sync || req & SLAVE_REQ_RDB_MASK) && (mincapa & SLAVE_CAPA_EOF);
1113▶ /* `SYNC` should have failed with error if we don't support socket and require a filter, assert this here */
1114 serverAssert(socket_target || !(req & SLAVE_REQ_RDB_MASK));
1115
· · ·
1147 /* If we failed to BGSAVE, remove the slaves waiting for a full
1148 * resynchronization from the list of slaves, inform them with
1149▶ * an error about what happened, close the connection ASAP. */
1150 if (retval == C_ERR) {
1151 serverLog(LL_WARNING,"BGSAVE for replication failed");
+ 166 more matches in this file
324 serverLog(LL_WARNING,
325 "Loading the cluster node config from %s: %s",
326▶ filename, strerror(errno));
327 exit(1);
328 }
· · ·
332 serverLog(LL_WARNING,
333 "Unable to obtain the cluster node config file stat %s: %s",
334▶ filename, strerror(errno));
335 exit(1);
336 }
· · ·
666fmterr:
667 serverLog(LL_WARNING,
668▶ "Unrecoverable error: corrupted cluster config file \"%s\".", line);
669 zfree(line);
670 if (fp) fclose(fp);
· · ·
674/* Cluster node configuration is exactly the same as CLUSTER NODES output.
675 *
676▶ * This function writes the node config and returns 0, on error -1
677 * is returned.
678 *
· · ·
705 server.cluster_configfile,(int) getpid(),mstime());
706 if ((fd = open(tmpfilename,O_WRONLY|O_CREAT,0644)) == -1) {
707▶ serverLog(LL_WARNING,"Could not open temp cluster config file: %s",strerror(errno));
708 goto cleanup;
709 }
+ 83 more matches in this file
93 mstime_t dest_slots_snapshot_time; /* The time when the destination starts applying the slot snapshot */
94 mstime_t dest_accum_applied_time; /* The time when the destination finishes applying the accumulated buffer */
95▶ sds error; /* Error message for this task */
96 redisOpArray *pre_snapshot_module_cmds; /* Module commands to be propagated at the beginning of slot migration */
97 redisOpArray *post_stream_module_cmds; /* Module commands to be propagated at the end of slot migration, just before STREAM-EOF */
· · ·
391asmTask *asmTaskCreate(const char *task_id) {
392 asmTask *task = zcalloc(sizeof(*task));
393▶ task->error = sdsempty();
394 asmTaskReset(task);
395 task->slots = NULL;
· · ·
412 sdsfree(task->id);
413 slotRangeArrayFree(task->slots);
414▶ sdsfree(task->error);
415 zfree(task);
416}
· · ·
810 * before the slot handoff.
811 * FUNCTION subcommands should be executed on all nodes, so here we skip it,
812▶ * and even propagating them may cause an error when executing.
813 *
814 * NOTICE: if some keyless commands should be propagated to the destination,
· · ·
906 int remaining = c->argc - 3;
907 if (remaining == 0 || remaining % 2 != 0) {
908▶ addReplyErrorArity(c);
909 return;
910 }
+ 118 more matches in this file
374char *sentinelGetSubjectiveLeader(sentinelRedisInstance *master);
375char *sentinelGetObjectiveLeader(sentinelRedisInstance *master);
376▶void instanceLinkConnectionError(const redisAsyncContext *c);
377const char *sentinelRedisInstanceTypeStr(sentinelRedisInstance *ri);
378void sentinelAbortFailover(sentinelRedisInstance *ri);
· · ·
520 serverLog(LL_WARNING,
521 "Sentinel config file %s is not writable: %s. Exiting...",
522▶ server.configfile,strerror(errno));
523 exit(1);
524 }
· · ·
553
554/* Create a sentinelAddr object and return it on success.
555▶ * On error NULL is returned and errno is set to:
556 * ENOENT: Can't resolve the hostname, unless accept_unresolved is non-zero.
557 * EINVAL: Invalid port number.
· · ·
843
844 if (pid == -1) {
845▶ /* Parent (fork error).
846 * We report fork errors as signal 99, in order to unify the
847 * reporting with other kind of errors. */
· · ·
846▶ * We report fork errors as signal 99, in order to unify the
847 * reporting with other kind of errors. */
848 sentinelEvent(LL_WARNING,"-script-error",NULL,
+ 70 more matches in this file
232 * when the Redis server start.
233 *
234▶ * During loading, this function does strict error checking and will abort
235 * the entire Redis server process on error (I/O error, invalid format, etc.)
236 *
· · ·
235▶ * the entire Redis server process on error (I/O error, invalid format, etc.)
236 *
237 * If the AOF directory or manifest file do not exist, this will be ignored
· · ·
270 FILE *fp = fopen(am_filepath, "r");
271 if (fp == NULL) {
272▶ serverLog(LL_WARNING, "Fatal error: can't open the AOF manifest "
273 "file %s for reading: %s", am_filepath, strerror(errno));
274 exit(1);
· · ·
273▶ "file %s for reading: %s", am_filepath, strerror(errno));
274 exit(1);
275 }
· · ·
386 if (ai) aofInfoFree(ai);
387
388▶ serverLog(LL_WARNING, "\n*** FATAL AOF MANIFEST FILE ERROR ***\n");
389 if (line) {
390 serverLog(LL_WARNING, "Reading the manifest file, at line %d\n", linenum);
+ 84 more matches in this file
820 {
821 serverLog(LL_WARNING,
822▶ "CRITICAL ERROR: User ACLs don't match final bitmap: '%s'",
823 redactLogCstr(rules));
824 serverPanic("No bitmap match in ACLDescribeSelectorCommandRules()");
· · ·
991 *
992 * If any of the operations are invalid, NULL will be returned instead
993▶ * and errno will be set corresponding to the interior error. */
994aclSelector *aclCreateSelectorFromOpSet(const char *opset, size_t opsetlen) {
995 serverAssert(opset[0] == '(' && opset[opsetlen - 1] == ')');
· · ·
1176
1177 /* The subcommand cannot be empty, so things like DEBUG|
1178▶ * are syntax errors of course. */
1179 if (strlen(sub) == 0) {
1180 zfree(copy);
· · ·
1281 * The function returns C_OK if the action to perform was understood because
1282 * the 'op' string made sense. Otherwise C_ERR is returned if the operation
1283▶ * is unknown or has some syntax error.
1284 *
1285 * When an error is returned, errno is set to the following values:
· · ·
1285▶ * When an error is returned, errno is set to the following values:
1286 *
1287 * EINVAL: The specified opcode is not understood or the key/channel pattern is
+ 106 more matches in this file
67 slot < 0 || slot >= CLUSTER_SLOTS)
68 {
69▶ addReplyError(c,"Invalid or out of range slot");
70 return -1;
71 }
· · ·
200 != C_OK) return;
201 if (lru_idle < 0) {
202▶ addReplyError(c,"Invalid IDLETIME value, must be >= 0");
203 return;
204 }
· · ·
211 != C_OK) return;
212 if (lfu_freq < 0 || lfu_freq > 255) {
213▶ addReplyError(c,"Invalid FREQ value, must be >= 0 and <= 255");
214 return;
215 }
· · ·
216 j++; /* Consume additional arg. */
217 } else {
218▶ addReplyErrorObject(c,shared.syntaxerr);
219 return;
220 }
· · ·
224 robj *key = c->argv[1];
225 if (!replace && lookupKeyWrite(c->db,key) != NULL) {
226▶ addReplyErrorObject(c,shared.busykeyerr);
227 return;
228 }
+ 114 more matches in this file
802/* Populate the lex rangespec according to the objects min and max.
803 *
804▶ * Return C_OK on success. On error C_ERR is returned.
805 * When OK is returned the structure must be freed with zslFreeLexRange(),
806 * otherwise no release is needed. */
· · ·
1588 * to have, or in the case a zero increment is used).
1589 *
1590▶ * The function returns 0 on error, currently only when the increment
1591 * produces a NAN condition, or when the 'score' value is NAN since the
1592 * start.
· · ·
1609 double curscore;
1610
1611▶ /* NaN as input is an error regardless of all the other parameters. */
1612 if (isnan(score)) {
1613 *out_flags = ZADD_OUT_NAN;
· · ·
2003 elements = c->argc-scoreidx;
2004 if (elements % 2 || !elements) {
2005▶ addReplyErrorObject(c,shared.syntaxerr);
2006 return;
2007 }
· · ·
2010 /* Check for incompatible options. */
2011 if (nx && xx) {
2012▶ addReplyError(c,
2013 "XX and NX options at the same time are not compatible");
2014 return;
+ 29 more matches in this file
385kvobj *lookupKeyReadOrReply(client *c, robj *key, robj *reply) {
386 kvobj *kv = lookupKeyRead(c->db, key);
387▶ if (!kv) addReplyOrErrorObject(c, reply);
388 return kv;
389}
· · ·
391kvobj *lookupKeyWriteOrReply(client *c, robj *key, robj *reply) {
392 kvobj *kv = lookupKeyWrite(c->db, key);
393▶ if (!kv) addReplyOrErrorObject(c, reply);
394 return kv;
395}
· · ·
1216 *
1217 * On success C_OK is returned and the flags are stored in *flags, otherwise
1218▶ * C_ERR is returned and the function sends an error to the client. */
1219int getFlushCommandFlags(client *c, int *flags) {
1220 /* Parse the optional ASYNC option. */
· · ·
1226 *flags = server.lazyfree_lazy_user_flush ? EMPTYDB_ASYNC : EMPTYDB_NO_FLAGS;
1227 } else {
1228▶ addReplyErrorObject(c,shared.syntaxerr);
1229 return C_ERR;
1230 }
· · ·
1467 * match-value */
1468 if (c->argc != 4) {
1469▶ addReplyErrorArity(c);
1470 return;
1471 }
+ 44 more matches in this file
377 continue;
378 }
379▶ addReplyErrorFormat(c,"%s", strerror(ret));
380 return;
381 } else {
· · ·
387 }
388 }
389▶ addReplyErrorFormat(c,"%s", strerror(EINVAL));
390}
391
· · ·
396 /* for strings, it seems we need to first get the old value, before overriding it. */
397 if ((rret=je_mallctl(argv[0]->ptr, &old, &sz, NULL, 0))) {
398▶ /* return error unless this option is write only. */
399 if (!(rret == EPERM && argc > 1)) {
400 addReplyErrorFormat(c,"%s", strerror(rret));
· · ·
400▶ addReplyErrorFormat(c,"%s", strerror(rret));
401 return;
402 }
· · ·
412 addReplyBulkCString(c, old);
413 else if (wret)
414▶ addReplyErrorFormat(c,"%s", strerror(wret));
415 else
416 addReply(c, shared.ok);
+ 47 more matches in this file
358 if (node == NULL) {
359 // XXX Technically in Redis-land we don't have out of memory, as we
360▶ // crash on OOM. However the HNSW library may fail for error in the
361 // locking libc call. Probably impossible in practical terms.
362 RedisModule_Free(nv);
· · ·
374 * Returns allocated vector and sets dimension in *dim.
375 * If reduce_dim is not NULL, sets it to the requested reduction dimension.
376▶ * Returns NULL on parsing error.
377 *
378 * The function sets as a reference *consumed_args, so that the caller
· · ·
589 RedisModuleString *attrib = NULL; // Attributes if passed via ATTRIB.
590 if (!vec)
591▶ return RedisModule_ReplyWithError(ctx,"ERR invalid vector specification");
592
593 /* Missing element string at the end? */
· · ·
609 {
610 RedisModule_Free(vec);
611▶ return RedisModule_ReplyWithError(ctx, "ERR invalid EF");
612 }
613 j++; // skip argument.
· · ·
618 {
619 RedisModule_Free(vec);
620▶ return RedisModule_ReplyWithError(ctx, "ERR invalid M");
621 }
622 j++; // skip argument.
+ 67 more matches in this file
535 /* Special value of EXPIRE_TIME_INVALID indicates field should be persisted.*/
536 if (expireAt == EB_EXPIRE_TIME_INVALID) {
537▶ /* Return error if already there is no ttl. */
538 if (prevExpire == EB_EXPIRE_TIME_INVALID)
539 return HSETEX_NO_CONDITION_MET;
· · ·
1078 /* Special value of EXPIRE_TIME_INVALID indicates field should be persisted.*/
1079 if (expireAt == EB_EXPIRE_TIME_INVALID) {
1080▶ /* Return error if already there is no ttl. */
1081 if (entryGetExpiry(oldEntry) == EB_EXPIRE_TIME_INVALID)
1082 return HSETEX_NO_CONDITION_MET;
· · ·
2210
2211 if ((c->argc % 2) == 1) {
2212▶ addReplyErrorArity(c);
2213 return;
2214 }
· · ·
2270
2271 if (val < 0) {
2272▶ addReplyError(c,"invalid expire time, must be >= 0");
2273 return C_ERR;
2274 }
· · ·
2276 if (unit == UNIT_SECONDS) {
2277 if (val > (long long) HFE_MAX_ABS_TIME_MSEC / 1000) {
2278▶ addReplyErrorExpireTime(c);
2279 return C_ERR;
2280 }
+ 30 more matches in this file
162};
163
164▶configEnum propagation_error_behavior_enum[] = {
165 {"ignore", PROPAGATION_ERR_BEHAVIOR_IGNORE},
166 {"panic", PROPAGATION_ERR_BEHAVIOR_PANIC},
· · ·
182 * int is_valid_fn(val, err)
183 * Return 1 when val is valid, and 0 when invalid.
184▶ * Optionally set err to a static error string.
185 */
186
· · ·
265 void (*init)(standardConfig *config);
266 /* Called on server startup and CONFIG SET, returns 1 on success,
267▶ * 2 meaning no actual change done, 0 on error and can set a verbose err
268 * string */
269 int (*set)(standardConfig *config, sds *argv, int argc, const char **err);
· · ·
270 /* Optional: called after `set()` to apply the config change. Used only in
271 * the context of CONFIG SET. Returns 1 on success, 0 on failure.
272▶ * Optionally set err to a static error string. */
273 apply_fn apply;
274 /* Called on CONFIG GET, returns sds to be used in reply */
· · ·
410 /* Sanity check of single arguments, so that we either refuse the
411 * whole configuration string or accept it all, even if a single
412▶ * error in a single client class is present. */
413 for (j = 0; j < arg_len; j += 4) {
414 class = getClientTypeByName(args[j]);
+ 42 more matches in this file
32 * and also test for overflow. */
33 if (total > server.proto_max_bulk_len || total < size || total < append) {
34▶ addReplyError(c,"string exceeds maximum allowed size (proto-max-bulk-len)");
35 return C_ERR;
36 }
· · ·
240 *
241 * If return C_OK, "milliseconds" output argument will be set to the resulting absolute timestamp.
242▶ * If return C_ERR, an error reply has been added to the given client.
243 */
244static int getExpireMillisecondsOrReply(client *c, robj *expire, int relative_ttl, int unit, long long *milliseconds) {
· · ·
250 if (*milliseconds <= 0 || (unit == UNIT_SECONDS && *milliseconds > LLONG_MAX / 1000)) {
251 /* Negative value provided or multiplication is gonna overflow. */
252▶ addReplyErrorExpireTime(c);
253 return C_ERR;
254 }
· · ·
262 if (*milliseconds <= 0) {
263 /* Overflow detected. */
264▶ addReplyErrorExpireTime(c);
265 return C_ERR;
266 }
· · ·
422 j++;
423 } else {
424▶ addReplyErrorObject(c,shared.syntaxerr);
425 return C_ERR;
426 }
+ 23 more matches in this file
78 * because ARSEEK UINT64_MAX sets insert_idx to UINT64_MAX-1, which is
79 * a valid terminal state (next ARINSERT would overflow).
80▶ * Returns C_OK/C_ERR. Does NOT send error reply - caller decides. */
81int getArrayIndexFromObject(robj *o, uint64_t *idx, int allow_max) {
82 unsigned long long ull;
· · ·
92}
93
94▶/* Parse an array index argument and reply with an error on failure. */
95int arrayParseIndexOrReply(client *c, robj *arg, uint64_t *idx) {
96 if (getArrayIndexFromObject(arg, idx, 0) != C_OK) {
· · ·
97▶ addReplyError(c, "invalid array index");
98 return C_ERR;
99 }
· · ·
173 uint64_t last_idx = start_idx + (uint64_t)num_values - 1;
174 if (last_idx < start_idx || last_idx == UINT64_MAX) {
175▶ addReplyError(c, "array index overflow");
176 return;
177 }
· · ·
216void armsetCommand(client *c) {
217 if ((c->argc - 2) % 2 != 0) {
218▶ addReplyErrorArity(c);
219 return;
220 }
+ 31 more matches in this file
317#define ZIP_ENCODING_SIZE_INVALID 0xff
318/* Return the number of bytes required to encode the entry type + length.
319▶ * On error, return ZIP_ENCODING_SIZE_INVALID */
320static inline unsigned int zipEncodingLenSize(unsigned char encoding) {
321 if (encoding == ZIP_INT_16B || encoding == ZIP_INT_32B ||
· · ·
405 * variable will hold the number of bytes required to encode the entry
406 * length, and the 'len' variable will hold the entry length.
407▶ * On invalid encoding error, lensize is set to 0. */
408#define ZIP_DECODE_LENGTH(ptr, encoding, lensize, len) do { \
409 if ((encoding) < ZIP_STR_MASK) { \
· · ·
1473 printf("\t[str]");
1474 if (entry.len > 40) {
1475▶ if (fwrite(p,40,1,stdout) == 0) perror("fwrite");
1476 printf("...");
1477 } else {
· · ·
1478 if (entry.len &&
1479▶ fwrite(p,entry.len,1,stdout) == 0) perror("fwrite");
1480 }
1481 } else {
· · ·
1764
1765 if (vstr) {
1766▶ if (vlen && fwrite(vstr,vlen,1,stdout) == 0) perror("fwrite");
1767 }
1768 else {
+ 34 more matches in this file
248 reply = redisCommand(ctx,"AUTH %s %s", config.conn_info.user, config.conn_info.auth);
249 if (reply != NULL) {
250▶ if (reply->type == REDIS_REPLY_ERROR) {
251 if (hostsocket == NULL)
252 fprintf(stderr, "Node %s:%d replied with error:\n%s\n", ip, port, reply->str);
· · ·
252▶ fprintf(stderr, "Node %s:%d replied with error:\n%s\n", ip, port, reply->str);
253 else
254 fprintf(stderr, "Node %s replied with error:\n%s\n", hostsocket, reply->str);
· · ·
254▶ fprintf(stderr, "Node %s replied with error:\n%s\n", hostsocket, reply->str);
255 freeReplyObject(reply);
256 redisFree(ctx);
· · ·
260 return ctx;
261 }
262▶ fprintf(stderr, "ERROR: failed to fetch reply from ");
263 if (hostsocket == NULL)
264 fprintf(stderr, "%s:%d\n", ip, port);
· · ·
295 reply = res == REDIS_OK ? ((redisReply *) r) : NULL;
296 if (res != REDIS_OK || !r) goto fail;
297▶ if (reply->type == REDIS_REPLY_ERROR) {
298 goto fail;
299 }
+ 22 more matches in this file
706
707/* This helper function used by GETBIT / SETBIT parses the bit offset argument
708▶ * making sure an error is returned if it is negative or if it overflows
709 * Redis 512 MB limit for the string value or more (server.proto_max_bulk_len).
710 *
· · ·
723
724 if (string2ll(p+usehash,plen-usehash,&loffset) == 0 || loffset < 0) {
725▶ addReplyError(c,err);
726 return C_ERR;
727 }
· · ·
730 if (usehash) {
731 if (loffset > LLONG_MAX / bits) {
732▶ addReplyError(c,err);
733 return C_ERR;
734 }
· · ·
739 if (!mustObeyClient(c) && (loffset >> 3) >= server.proto_max_bulk_len)
740 {
741▶ addReplyError(c,err);
742 return C_ERR;
743 }
· · ·
750 * <sign><bits> where sign is 'u' or 'i' for unsigned and signed, and
751 * the bits is a value between 1 and 64. However 64 bits unsigned integers
752▶ * are reported as an error because of current limitations of Redis protocol
753 * to return unsigned integer values greater than INT64_MAX.
754 *
+ 21 more matches in this file
210 lua_setglobal(lua,"redis");
211
212▶ /* Add a helper function we use for pcall error reporting.
213 * Note that when the error is in the C function we want to report the
214 * information about the caller, that's what makes sense from the point
· · ·
213▶ * Note that when the error is in the C function we want to report the
214 * information about the caller, that's what makes sense from the point
215 * of view of the user debugging a script. */
· · ·
249 /* Lock the global table from any changes */
250 lua_pushvalue(lua, LUA_GLOBALSINDEX);
251▶ luaSetErrorMetatable(lua);
252 /* Recursively lock all tables that can be reached from the global table */
253 luaSetTableProtectionRecursively(lua);
· · ·
321/* Helper function to try and extract shebang flags from the script body.
322 * If no shebang is found, return with success and COMPAT mode flag.
323▶ * The err arg is optional, can be used to get a detailed error string.
324 * The out_shebang_len arg is optional, can be used to trim the shebang from the script.
325 * Returns C_OK on success, and C_ERR on error. */
· · ·
325▶ * Returns C_OK on success, and C_ERR on error. */
326int evalExtractShebangFlags(sds body, uint64_t *out_flags, ssize_t *out_shebang_len, sds *err) {
327 ssize_t shebang_len = 0;
+ 44 more matches in this file