summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 912afef)
raw | patch | inline | side by side (parent: 912afef)
author | Jim Radford <radford@galvanix.com> | |
Fri, 16 Aug 2013 23:19:46 +0000 (16:19 -0700) | ||
committer | Jim Radford <radford@galvanix.com> | |
Sat, 17 Aug 2013 02:52:35 +0000 (19:52 -0700) |
The following two keys
Key workers/*/requests
Key workers/*/apps/*/requests
can both lead to type_instance's of say
0-requests
which would alias in the cache. If, instead of just the final two key
name components, we use all of them it would lead to these
Key workers-0-requests
Key workers-0-apps-0-requests
which would not overlap.
Key workers/*/requests
Key workers/*/apps/*/requests
can both lead to type_instance's of say
0-requests
which would alias in the cache. If, instead of just the final two key
name components, we use all of them it would lead to these
Key workers-0-requests
Key workers-0-apps-0-requests
which would not overlap.
src/curl_json.c | patch | blob | history |
diff --git a/src/curl_json.c b/src/curl_json.c
index deee460bb3327e6291d6536190ac68e7a7d87cb0..fefc28b117fdef3af3db4eef9fb63860264d39d8 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
if (key->instance == NULL)
{
- if ((db->depth == 0) || (strcmp ("", db->state[db->depth-1].name) == 0))
- sstrncpy (vl.type_instance, db->state[db->depth].name, sizeof (vl.type_instance));
- else
- ssnprintf (vl.type_instance, sizeof (vl.type_instance), "%s-%s",
- db->state[db->depth-1].name, db->state[db->depth].name);
+ int i, len = 0;
+ for (i = 0; i < db->depth; i++)
+ len += ssnprintf(vl.type_instance+len, sizeof(vl.type_instance)-len,
+ i ? "-%s" : "%s", db->state[i+1].name);
}
else
sstrncpy (vl.type_instance, key->instance, sizeof (vl.type_instance));