Commit b11829f6 authored by Hrishikesh Pathak's avatar Hrishikesh Pathak

Merge branch 'master' into SEClusterConfigBugFix

parents 7d74d187 32807af6
......@@ -366,9 +366,20 @@ public void SetDefaultPorts()
}
/// <summary>
/// Returns the effective configuration string for this configuration
/// Returns the effective configuration string for this configuration, including Redis credentials.
/// </summary>
public override string ToString()
{
// include password to allow generation of configuration strings
// used for connecting multiplexer
return ToString(includePassword: true);
}
/// <summary>
/// Returns the effective configuration string for this configuration
/// with the option to include or exclude the password from the string.
/// </summary>
public string ToString(bool includePassword)
{
var sb = new StringBuilder();
foreach (var endpoint in endpoints)
......@@ -382,7 +393,7 @@ public override string ToString()
Append(sb, OptionKeys.AllowAdmin, allowAdmin);
Append(sb, OptionKeys.Version, defaultVersion);
Append(sb, OptionKeys.ConnectTimeout, connectTimeout);
Append(sb, OptionKeys.Password, password);
Append(sb, OptionKeys.Password, includePassword ? password : "*****");
Append(sb, OptionKeys.TieBreaker, tieBreaker);
Append(sb, OptionKeys.WriteBuffer, writeBuffer);
Append(sb, OptionKeys.Ssl, ssl);
......
......@@ -1197,7 +1197,7 @@ internal async Task<bool> ReconfigureAsync(bool first, bool reconfigureAll, Text
Trace("Starting reconfiguration...");
Trace(blame != null, "Blaming: " + Format.ToString(blame));
LogLocked(log, Configuration);
LogLocked(log, configuration.ToString(includePassword: false));
LogLocked(log, "");
......
......@@ -7,6 +7,14 @@ namespace StackExchange.Redis
/// </summary>
public abstract class RedisResult
{
/// <summary>
/// Create a new RedisResult.
/// </summary>
/// <returns></returns>
public static RedisResult Create(RedisValue value)
{
return new SingleRedisResult(value);
}
// internally, this is very similar to RawResult, except it is designed to be usable
// outside of the IO-processing pipeline: the buffers are standalone, etc
......
......@@ -185,7 +185,7 @@ public bool Remove(Action<RedisChannel, RedisValue> value)
public Task SubscribeToServer(ConnectionMultiplexer multiplexer, RedisChannel channel, CommandFlags flags, object asyncState, bool internalCall)
{
var cmd = channel.IsPatternBased ? RedisCommand.PSUBSCRIBE : RedisCommand.SUBSCRIBE;
var selected = multiplexer.SelectServer(-1, cmd, CommandFlags.DemandMaster, default(RedisKey));
var selected = multiplexer.SelectServer(-1, cmd, flags, default(RedisKey));
if (selected == null || Interlocked.CompareExchange(ref owner, selected, null) != null) return null;
......
using System;
using System;
#if CORE_CLR
using System.Collections.Generic;
using System.Reflection;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment