diff options
author | filipe oliveira <filipecosta.90@gmail.com> | 2021-08-03 10:21:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-03 12:21:29 +0300 |
commit | 4aa927d16d4458124157bcc1d6a31b54df4f3a3f (patch) | |
tree | 184f3ae645a3e3e54ee8a52eed18bc006160ea0c /src/cli_common.h | |
parent | 432c92d8df179a6a1aeae2df553c6b3fc810be76 (diff) | |
download | redis-4aa927d16d4458124157bcc1d6a31b54df4f3a3f.tar.gz |
Enabled -x option (Read last argument from STDIN) on redis-benchmark (#9130)
Add the -x option (Read last argument from STDIN) on redis-benchmark.
Other changes:
To be able to use the code from redis-cli some helper methods were moved to cli_common.(h|c)
Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/cli_common.h')
-rw-r--r-- | src/cli_common.h | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/cli_common.h b/src/cli_common.h index e7f2e10e7..239f51808 100644 --- a/src/cli_common.h +++ b/src/cli_common.h @@ -2,6 +2,7 @@ #define __CLICOMMON_H #include <hiredis.h> +#include <sdscompat.h> /* Use hiredis' sds compat header that maps sds calls to their hi_ variants */ typedef struct cliSSLconfig { /* Requested SNI, or NULL */ @@ -22,29 +23,16 @@ typedef struct cliSSLconfig { char* ciphersuites; } cliSSLconfig; -/* Wrapper around redisSecureConnection to avoid hiredis_ssl dependencies if - * not building with TLS support. - */ int cliSecureConnection(redisContext *c, cliSSLconfig config, const char **err); -/* Wrapper around hiredis to allow arbitrary reads and writes. - * - * We piggybacks on top of hiredis to achieve transparent TLS support, - * and use its internal buffers so it can co-exist with commands - * previously/later issued on the connection. - * - * Interface is close to enough to read()/write() so things should mostly - * work transparently. - */ - -/* Write a raw buffer through a redisContext. If we already have something - * in the buffer (leftovers from hiredis operations) it will be written - * as well. - */ ssize_t cliWriteConn(redisContext *c, const char *buf, size_t buf_len); -/* Wrapper around OpenSSL (libssl and libcrypto) initialisation. - */ int cliSecureInit(); +sds readArgFromStdin(void); + +sds *getSdsArrayFromArgv(int argc,char **argv, int quoted); + +sds unquoteCString(char *str); + #endif /* __CLICOMMON_H */ |