Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Properly support password authentication #11

Merged
merged 1 commit into from

2 participants

@muxspace

Hi Bryan, It's Brian. I fixed the password authentication in redisConnect. It was issuing a PING before the AUTH request and so was failing if the redis server required authentication. We've verified that it works.

@bwlewis
Owner

Thanks!

@bwlewis bwlewis merged commit 51ac7c4 into bwlewis:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 18, 2013
  1. @muxspace

    Added auth hook on connect

    muxspace authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +7 −1 R/controlCMD.R
View
8 R/controlCMD.R
@@ -18,7 +18,7 @@
}
`redisConnect` <-
-function(host='localhost', port=6379, returnRef=FALSE, timeout=2678399L)
+function(host='localhost', port=6379, returnRef=FALSE, timeout=2678399L, password=NULL)
{
.redisEnv$current <- new.env()
# R nonblocking connections are flaky, especially on Windows, see
@@ -35,6 +35,12 @@ function(host='localhost', port=6379, returnRef=FALSE, timeout=2678399L)
# Count is for nonblocking communication, it keeps track of the number of
# getResponse calls that are pending.
assign('count',0,envir=.redisEnv$current)
+ if (!is.null(password)) tryCatch(redisAuth(password),
+ error=function(e) {
+ cat(paste('Error: ',e,'\n'))
+ close(con);
+ rm(list='con',envir=.redisEnv$current)
+ })
tryCatch(.redisPP(),
error=function(e) {
cat(paste('Error: ',e,'\n'))
Something went wrong with that request. Please try again.