Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
82549a53
Commit
82549a53
authored
Jan 08, 2018
by
Mark Nunberg
Browse files
Disable SSL by default
parent
08efa465
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
82549a53
...
...
@@ -54,9 +54,11 @@ DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(L
STLIBNAME
=
$(LIBNAME)
.
$(STLIBSUFFIX)
STLIB_MAKE_CMD
=
$(AR)
rcs
$(STLIBNAME)
OPENSSL_PREFIX
=
/usr/local/opt/openssl
CFLAGS
+=
-I
$(OPENSSL_PREFIX)
/include
LDFLAGS
+=
-L
$(OPENSSL_PREFIX)
/lib
-lssl
-lcrypto
ifdef
USE_SSL
OPENSSL_PREFIX
=
/usr/local/opt/openssl
CFLAGS
+=
-I
$(OPENSSL_PREFIX)
/include
-DHIREDIS_SSL
LDFLAGS
+=
-L
$(OPENSSL_PREFIX)
/lib
-lssl
-lcrypto
endif
# Platform-specific overrides
uname_S
:=
$(
shell
sh
-c
'uname -s 2>/dev/null || echo not'
)
...
...
sslio.c
View file @
82549a53
...
...
@@ -2,7 +2,7 @@
#include "sslio.h"
#include <assert.h>
#if
n
def HIREDIS_
NO
SSL
#ifdef HIREDIS_SSL
#include <pthread.h>
void
__redisSetError
(
redisContext
*
c
,
int
type
,
const
char
*
str
);
...
...
sslio.h
View file @
82549a53
...
...
@@ -2,19 +2,26 @@
#define REDIS_SSLIO_H
#ifdef HIREDIS_
NO
SSL
#if
n
def HIREDIS_SSL
typedef
struct
redisSsl
{
int
dummy
;
size_t
lastLen
;
int
wantRead
;
int
pendingWrite
;
}
redisSsl
;
static
void
redisFreeSsl
(
redisSsl
*
)
{
static
inline
void
redisFreeSsl
(
redisSsl
*
ssl
)
{
(
void
)
ssl
;
}
static
int
redisSslCreate
(
struct
redisContext
*
c
)
{
static
inline
int
redisSslCreate
(
struct
redisContext
*
c
,
const
char
*
ca
,
const
char
*
cert
,
const
char
*
key
)
{
(
void
)
c
;(
void
)
ca
;(
void
)
cert
;(
void
)
key
;
return
REDIS_ERR
;
}
static
int
redisSslRead
(
struct
redisContect
*
c
,
char
*
s
,
size_t
,
n
)
{
static
inline
int
redisSslRead
(
struct
redisContext
*
c
,
char
*
s
,
size_t
n
)
{
(
void
)
c
;(
void
)
s
;(
void
)
n
;
return
-
1
;
}
static
int
redisSslWrite
(
struct
redisContext
*
c
)
{
static
inline
int
redisSslWrite
(
struct
redisContext
*
c
)
{
(
void
)
c
;
return
-
1
;
}
#else
...
...
@@ -53,5 +60,5 @@ int redisSslCreate(struct redisContext *c, const char *caPath,
int
redisSslRead
(
struct
redisContext
*
c
,
char
*
buf
,
size_t
bufcap
);
int
redisSslWrite
(
struct
redisContext
*
c
);
#endif
/*
!
HIREDIS_
NO
SSL */
#endif
/* HIREDIS_SSL */
#endif
/* HIREDIS_SSLIO_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment