From bb3475e8eb379ee18f3d8f37caa8040b852a6213 Mon Sep 17 00:00:00 2001 From: "Anna (navi) Figueiredo Gomes" Date: Sat, 23 Mar 2024 01:21:46 +0100 Subject: all: rename redis -> redict symbols and comments Signed-off-by: Anna (navi) Figueiredo Gomes --- examples/example-libevent-ssl.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'examples/example-libevent-ssl.c') diff --git a/examples/example-libevent-ssl.c b/examples/example-libevent-ssl.c index a142b22..b15e7e2 100644 --- a/examples/example-libevent-ssl.c +++ b/examples/example-libevent-ssl.c @@ -10,29 +10,29 @@ #include #include -#include +#include #include #include -void getCallback(redisAsyncContext *c, void *r, void *privdata) { - redisReply *reply = r; +void getCallback(redictAsyncContext *c, void *r, void *privdata) { + redictReply *reply = r; if (reply == NULL) return; printf("argv[%s]: %s\n", (char*)privdata, reply->str); /* Disconnect after receiving the reply to GET */ - redisAsyncDisconnect(c); + redictAsyncDisconnect(c); } -void connectCallback(const redisAsyncContext *c, int status) { - if (status != REDIS_OK) { +void connectCallback(const redictAsyncContext *c, int status) { + if (status != REDICT_OK) { printf("Error: %s\n", c->errstr); return; } printf("Connected...\n"); } -void disconnectCallback(const redisAsyncContext *c, int status) { - if (status != REDIS_OK) { +void disconnectCallback(const redictAsyncContext *c, int status) { + if (status != REDICT_OK) { printf("Error: %s\n", c->errstr); return; } @@ -61,36 +61,36 @@ int main (int argc, char **argv) { const char *certKey = argv[5]; const char *caCert = argc > 5 ? argv[6] : NULL; - redisSSLContext *ssl; - redisSSLContextError ssl_error = REDIS_SSL_CTX_NONE; + redictSSLContext *ssl; + redictSSLContextError ssl_error = REDICT_SSL_CTX_NONE; - redisInitOpenSSL(); + redictInitOpenSSL(); - ssl = redisCreateSSLContext(caCert, NULL, + ssl = redictCreateSSLContext(caCert, NULL, cert, certKey, NULL, &ssl_error); if (!ssl) { printf("Error: %s\n", redictSSLContextGetError(ssl_error)); return 1; } - redisAsyncContext *c = redisAsyncConnect(hostname, port); + redictAsyncContext *c = redictAsyncConnect(hostname, port); if (c->err) { /* Let *c leak for now... */ printf("Error: %s\n", c->errstr); return 1; } - if (redisInitiateSSLWithContext(&c->c, ssl) != REDIS_OK) { + if (redictInitiateSSLWithContext(&c->c, ssl) != REDICT_OK) { printf("SSL Error!\n"); exit(1); } - redisLibeventAttach(c,base); - redisAsyncSetConnectCallback(c,connectCallback); - redisAsyncSetDisconnectCallback(c,disconnectCallback); - redisAsyncCommand(c, NULL, NULL, "SET key %b", value, nvalue); - redisAsyncCommand(c, getCallback, (char*)"end-1", "GET key"); + redictLibeventAttach(c,base); + redictAsyncSetConnectCallback(c,connectCallback); + redictAsyncSetDisconnectCallback(c,disconnectCallback); + redictAsyncCommand(c, NULL, NULL, "SET key %b", value, nvalue); + redictAsyncCommand(c, getCallback, (char*)"end-1", "GET key"); event_base_dispatch(base); - redisFreeSSLContext(ssl); + redictFreeSSLContext(ssl); return 0; } -- cgit v1.2.3