Helper for parsing a stream ID that is a range query interval. When the * exclude argument is NULL, streamParseIDOrReply() is called and the interval * is treated as close (inclusive). Otherwise, the exclude argument is set if * the interval is open (the "(" prefix) and streamParseStrictIDOrReply() is * called in that case. */
| 1745 | * called in that case. |
| 1746 | */ |
| 1747 | int streamParseIntervalIDOrReply(client *c, robj *o, streamID *id, int *exclude, uint64_t missing_seq) { |
| 1748 | char *p = o->ptr; |
| 1749 | size_t len = sdslen(p); |
| 1750 | int invalid = 0; |
| 1751 | |
| 1752 | if (exclude != NULL) *exclude = (len > 1 && p[0] == '('); |
| 1753 | if (exclude != NULL && *exclude) { |
| 1754 | robj *t = createStringObject(p+1,len-1); |
| 1755 | invalid = (streamParseStrictIDOrReply(c,t,id,missing_seq) == C_ERR); |
| 1756 | decrRefCount(t); |
| 1757 | } else |
| 1758 | invalid = (streamParseIDOrReply(c,o,id,missing_seq) == C_ERR); |
| 1759 | if (invalid) |
| 1760 | return C_ERR; |
| 1761 | return C_OK; |
| 1762 | } |
| 1763 | |
| 1764 | void streamRewriteApproxSpecifier(client *c, int idx) { |
| 1765 | rewriteClientCommandArgument(c,idx,shared.special_equals); |
no test coverage detected