summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2021-06-09 13:49:01 -0700
committerdormando <dormando@rydia.net>2021-06-10 11:24:15 -0700
commit3d178cfd3241764acb789c166f1b0209457f2aff (patch)
tree3d222fc2b0a1a5a3e1e5feaf1f03892bfd88937e /doc
parentc6de7a1654b00220da9ec9d4d127387eeb771753 (diff)
downloadmemcached-3d178cfd3241764acb789c166f1b0209457f2aff.tar.gz
meta: fix metaset syntax
payload length is now part of the main command rather than a flag/token pair. This allows byte swallow to be more reliable in the case of a flag parsing error, and makes sets easier to parse and buffer for servers implementing the protocol.
Diffstat (limited to 'doc')
-rw-r--r--doc/protocol.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/protocol.txt b/doc/protocol.txt
index 49c12d8..bbaabef 100644
--- a/doc/protocol.txt
+++ b/doc/protocol.txt
@@ -96,17 +96,20 @@ noted in the 'Commands' section above.
All meta commands follow a basic syntax:
-<cm> <key> <flag1> <flag2> <...>\r\n
+<cm> <key> <datalen*> <flag1> <flag2> <...>\r\n
Where <cm> is a 2 character command code.
+<datalen> is only for commands with payloads, which is set.
Responses look like:
-<RC> <flag1> <flag2> <...>\r\n
+<RC> <datalen*> <flag1> <flag2> <...>\r\n
Where <RC> is a 2 character return code. The number of flags returned are
based off of the flags supplied.
+<datalen> is only for responses with payloads, with the return code 'VA'.
+
Flags are single character codes, ie 'q' or 'k' or 'I', which adjust the
behavior of the command. The flags are reflected in the response. The order of
which tokens are consumed or returned depend on the order of the flags given.
@@ -671,10 +674,12 @@ The meta set command a generic command for storing data to memcached. Based
on the flags supplied, it can replace all storage commands (see token M) as
well as adds new options.
-ms <key> <flags>*\r\n
+ms <key> <datalen> <flags>*\r\n
- <key> means one key string.
+- <datalen> is the length of the payload data.
+
- <flags> are a set of single character codes ended with a space or newline.
flags may have strings after the initial character.
@@ -713,7 +718,6 @@ The flags used by the 'ms' command are:
- k: return key as a token
- O(token): opaque value, consumes a token and copies back with response
- q: use noreply semantics for return codes
-- S(token): size of <data block> to store
- T(token): Time-To-Live for item, see "Expiration" above.
- M(token): mode switch to change behavior to add, replace, append, prepend