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. */
| 1747 | * called in that case. |
| 1748 | */ |
| 1749 | int streamParseIntervalIDOrReply(client *c, robj *o, streamID *id, int *exclude, uint64_t missing_seq) { |
| 1750 | char *p = szFromObj(o); |
| 1751 | size_t len = sdslen(p); |
| 1752 | int invalid = 0; |
| 1753 | |
| 1754 | if (exclude != NULL) *exclude = (len > 1 && p[0] == '('); |
| 1755 | if (exclude != NULL && *exclude) { |
| 1756 | robj *t = createStringObject(p+1,len-1); |
| 1757 | invalid = (streamParseStrictIDOrReply(c,t,id,missing_seq) == C_ERR); |
| 1758 | decrRefCount(t); |
| 1759 | } else |
| 1760 | invalid = (streamParseIDOrReply(c,o,id,missing_seq) == C_ERR); |
| 1761 | if (invalid) |
| 1762 | return C_ERR; |
| 1763 | return C_OK; |
| 1764 | } |
| 1765 | |
| 1766 | void streamRewriteApproxSpecifier(client *c, int idx) { |
| 1767 | rewriteClientCommandArgument(c,idx,shared.special_equals); |
no test coverage detected