"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/tracking.c" between
redis-6.2-rc3.tar.gz and redis-6.2.0.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

tracking.c  (redis-6.2-rc3):tracking.c  (redis-6.2.0)
skipping to change at line 150 skipping to change at line 150
{ {
addReplyErrorFormat(c, addReplyErrorFormat(c,
"Prefix '%s' overlaps with another provided prefix '%s'. " "Prefix '%s' overlaps with another provided prefix '%s'. "
"Prefixes for a single client must not overlap.", "Prefixes for a single client must not overlap.",
(unsigned char *)prefixes[i]->ptr, (unsigned char *)prefixes[i]->ptr,
(unsigned char *)prefixes[j]->ptr); (unsigned char *)prefixes[j]->ptr);
return i; return i;
} }
} }
} }
return -1; return 1;
} }
/* Set the client 'c' to track the prefix 'prefix'. If the client 'c' is /* Set the client 'c' to track the prefix 'prefix'. If the client 'c' is
* already registered for the specified prefix, no operation is performed. */ * already registered for the specified prefix, no operation is performed. */
void enableBcastTrackingForPrefix(client *c, char *prefix, size_t plen) { void enableBcastTrackingForPrefix(client *c, char *prefix, size_t plen) {
bcastState *bs = raxFind(PrefixTable,(unsigned char*)prefix,plen); bcastState *bs = raxFind(PrefixTable,(unsigned char*)prefix,plen);
/* If this is the first client subscribing to such prefix, create /* If this is the first client subscribing to such prefix, create
* the prefix in the table. */ * the prefix in the table. */
if (bs == raxNotFound) { if (bs == raxNotFound) {
bs = zmalloc(sizeof(*bs)); bs = zmalloc(sizeof(*bs));
skipping to change at line 272 skipping to change at line 272
void sendTrackingMessage(client *c, char *keyname, size_t keylen, int proto) { void sendTrackingMessage(client *c, char *keyname, size_t keylen, int proto) {
int using_redirection = 0; int using_redirection = 0;
if (c->client_tracking_redirection) { if (c->client_tracking_redirection) {
client *redir = lookupClientByID(c->client_tracking_redirection); client *redir = lookupClientByID(c->client_tracking_redirection);
if (!redir) { if (!redir) {
c->flags |= CLIENT_TRACKING_BROKEN_REDIR; c->flags |= CLIENT_TRACKING_BROKEN_REDIR;
/* We need to signal to the original connection that we /* We need to signal to the original connection that we
* are unable to send invalidation messages to the redirected * are unable to send invalidation messages to the redirected
* connection, because the client no longer exist. */ * connection, because the client no longer exist. */
if (c->resp > 2) { if (c->resp > 2) {
addReplyPushLen(c,3); addReplyPushLen(c,2);
addReplyBulkCBuffer(c,"tracking-redir-broken",21); addReplyBulkCBuffer(c,"tracking-redir-broken",21);
addReplyLongLong(c,c->client_tracking_redirection); addReplyLongLong(c,c->client_tracking_redirection);
} }
return; return;
} }
c = redir; c = redir;
using_redirection = 1; using_redirection = 1;
} }
/* Only send such info for clients in RESP version 3 or more. However /* Only send such info for clients in RESP version 3 or more. However
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)