From 48d8b3d8ac8de4db033d8836986065b8a41e01dc Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Wed, 31 Oct 2018 17:33:53 +0200 Subject: [PATCH 1/2] Fix some typos --- src/t_stream.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/t_stream.c b/src/t_stream.c index e37b6582a..3952ec1ab 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -37,7 +37,7 @@ * mark the entry as deleted, or having the same field as the "master" * entry at the start of the listpack> */ #define STREAM_ITEM_FLAG_NONE 0 /* No special flags. */ -#define STREAM_ITEM_FLAG_DELETED (1<<0) /* Entry is delted. Skip it. */ +#define STREAM_ITEM_FLAG_DELETED (1<<0) /* Entry is deleted. Skip it. */ #define STREAM_ITEM_FLAG_SAMEFIELDS (1<<1) /* Same fields as master entry. */ void streamFreeCG(streamCG *cg); @@ -165,7 +165,7 @@ int streamCompareID(streamID *a, streamID *b) { * Returns the new entry ID populating the 'added_id' structure. * * If 'use_id' is not NULL, the ID is not auto-generated by the function, - * but instead the passed ID is uesd to add the new entry. In this case + * but instead the passed ID is used to add the new entry. In this case * adding the entry may fail as specified later in this comment. * * The function returns C_OK if the item was added, this is always true @@ -223,13 +223,13 @@ int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_ * * count and deleted just represent respectively the total number of * entries inside the listpack that are valid, and marked as deleted - * (delted flag in the entry flags set). So the total number of items + * (deleted flag in the entry flags set). So the total number of items * actually inside the listpack (both deleted and not) is count+deleted. * * The real entries will be encoded with an ID that is just the * millisecond and sequence difference compared to the key stored at * the radix tree node containing the listpack (delta encoding), and - * if the fields of the entry are the same as the master enty fields, the + * if the fields of the entry are the same as the master entry fields, the * entry flags will specify this fact and the entry fields and number * of fields will be omitted (see later in the code of this function). * @@ -486,7 +486,7 @@ int64_t streamTrimByLength(stream *s, size_t maxlen, int approx) { * } * streamIteratorStop(&myiterator); */ void streamIteratorStart(streamIterator *si, stream *s, streamID *start, streamID *end, int rev) { - /* Intialize the iterator and translates the iteration start/stop + /* Initialize the iterator and translates the iteration start/stop * elements into a 128 big big-endian number. */ if (start) { streamEncodeID(si->start_key,start); @@ -564,7 +564,7 @@ int streamIteratorGetID(streamIterator *si, streamID *id, int64_t *numfields) { si->lp_ele = lpLast(si->lp); } } else if (si->rev) { - /* If we are itereating in the reverse order, and this is not + /* If we are iterating in the reverse order, and this is not * the first entry emitted for this listpack, then we already * emitted the current entry, and have to go back to the previous * one. */ @@ -751,7 +751,7 @@ void streamIteratorRemoveEntry(streamIterator *si, streamID *current) { } /* Stop the stream iterator. The only cleanup we need is to free the rax - * itereator, since the stream iterator itself is supposed to be stack + * iterator, since the stream iterator itself is supposed to be stack * allocated. */ void streamIteratorStop(streamIterator *si) { raxStop(&si->ri); @@ -863,15 +863,15 @@ void streamPropagateGroupID(client *c, robj *key, streamCG *group, robj *groupna * * The behavior may be modified passing non-zero flags: * - * STREAM_RWR_NOACK: Do not craete PEL entries, that is, the point "3" above + * STREAM_RWR_NOACK: Do not create PEL entries, that is, the point "3" above * is not performed. * STREAM_RWR_RAWENTRIES: Do not emit array boundaries, but just the entries, * and return the number of entries emitted as usually. * This is used when the function is just used in order * to emit data and there is some higher level logic. * - * The final argument 'spi' (stream propagatino info pointer) is a structure - * filled with information needed to propagte the command execution to AOF + * The final argument 'spi' (stream propagation info pointer) is a structure + * filled with information needed to propagate the command execution to AOF * and slaves, in the case a consumer group was passed: we need to generate * XCLAIM commands to create the pending list into AOF/slaves in that case. * @@ -1136,7 +1136,7 @@ invalid: } /* Wrapper for streamGenericParseIDOrReply() with 'strict' argument set to - * 0, to be used when - and + are accetable IDs. */ + * 0, to be used when - and + are acceptable IDs. */ int streamParseIDOrReply(client *c, robj *o, streamID *id, uint64_t missing_seq) { return streamGenericParseIDOrReply(c,o,id,missing_seq,0); } From 5fa41e0c84e46bb1fa417d6bfb60d9429734fd5f Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Sat, 3 Nov 2018 15:13:28 -0700 Subject: [PATCH 2/2] Use typedef'd mstime_t instead of time_t This fixes an overflow on 32-bit systems. --- src/t_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/t_stream.c b/src/t_stream.c index 3952ec1ab..9faee76d4 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -2155,7 +2155,7 @@ void xclaimCommand(client *c) { /* If we stopped because some IDs cannot be parsed, perhaps they * are trailing options. */ - time_t now = mstime(); + mstime_t now = mstime(); streamID last_id = {0,0}; int propagate_last_id = 0; for (; j < c->argc; j++) {