summaryrefslogtreecommitdiff
path: root/examples/example-ssl.c
diff options
context:
space:
mode:
authorAlessio M <masariello@gmail.com>2020-09-04 09:31:47 +0100
committerAlessio M <masariello@gmail.com>2020-09-04 09:31:47 +0100
commitd7b1d21e807f8a90a086b2ef5cea9b707d4cc858 (patch)
tree748b00a48a8b625f1dca22ae4cc5721ab7de87c5 /examples/example-ssl.c
parent07c3618ffe7912c2ebc589ea45501c687a19cf2c (diff)
parentfb0e6c0dd9affd5728c6e0a6423f5dcb7b207947 (diff)
Merge branch 'master' of github.com:redis/hiredis
Diffstat (limited to 'examples/example-ssl.c')
-rw-r--r--examples/example-ssl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/example-ssl.c b/examples/example-ssl.c
index 5eb2bbb..b8ca442 100644
--- a/examples/example-ssl.c
+++ b/examples/example-ssl.c
@@ -4,7 +4,10 @@
#include <hiredis.h>
#include <hiredis_ssl.h>
-#include <win32.h>
+
+#ifdef _MSC_VER
+#include <winsock2.h> /* For struct timeval */
+#endif
int main(int argc, char **argv) {
unsigned int j;
@@ -33,7 +36,7 @@ int main(int argc, char **argv) {
struct timeval tv = { 1, 500000 }; // 1.5 seconds
redisOptions options = {0};
REDIS_OPTIONS_SET_TCP(&options, hostname, port);
- options.timeout = &tv;
+ options.connect_timeout = &tv;
c = redisConnectWithOptions(&options);
if (c == NULL || c->err) {