summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2023-01-09 12:22:25 -0800
committerdormando <dormando@rydia.net>2023-01-11 21:42:50 -0800
commit80fa3c7654c90c548b9857a9bbcfc494459f8cad (patch)
treeebf330d1c91b7478fb549ff4b6ad333560abb0db /vendor
parente660658748b04f865852e77b0aad1fd8301cd5ec (diff)
downloadmemcached-80fa3c7654c90c548b9857a9bbcfc494459f8cad.tar.gz
mcmc: add mcmc_bare_parse_buf()
The client ctx isn't needed for just filling an mcmc_resp_t from a bare buffer.
Diffstat (limited to 'vendor')
-rw-r--r--vendor/mcmc/mcmc.c5
-rw-r--r--vendor/mcmc/mcmc.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/vendor/mcmc/mcmc.c b/vendor/mcmc/mcmc.c
index 3bd40b7..cdd5142 100644
--- a/vendor/mcmc/mcmc.c
+++ b/vendor/mcmc/mcmc.c
@@ -361,6 +361,11 @@ int mcmc_parse_buf(void *c, char *buf, size_t read, mcmc_resp_t *r) {
return _mcmc_parse_response(ctx, r);
}
+int mcmc_bare_parse_buf(char *buf, size_t read, mcmc_resp_t *r) {
+ mcmc_ctx_t ctx;
+ return mcmc_parse_buf(&ctx, buf, read, r);
+}
+
/*** Functions wrapping syscalls **/
// TODO: should be able to flip between block and nonblock.
diff --git a/vendor/mcmc/mcmc.h b/vendor/mcmc/mcmc.h
index 50cadf3..d6c426e 100644
--- a/vendor/mcmc/mcmc.h
+++ b/vendor/mcmc/mcmc.h
@@ -79,6 +79,7 @@ int mcmc_fd(void *c);
size_t mcmc_size(int options);
size_t mcmc_min_buffer_size(int options);
int mcmc_parse_buf(void *c, char *buf, size_t read, mcmc_resp_t *r);
+int mcmc_bare_parse_buf(char *buf, size_t read, mcmc_resp_t *r);
int mcmc_connect(void *c, char *host, char *port, int options);
int mcmc_check_nonblock_connect(void *c, int *err);
int mcmc_send_request(void *c, const char *request, int len, int count);