Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
f4208759
Commit
f4208759
authored
Feb 19, 2015
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow ny-redis01:6379 and NY-REDIS01.ds.stackexchange.com:6379 to match during server election
parent
23f7d87e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
ConnectionMultiplexer.cs
...change.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
+29
-0
No files found.
StackExchange.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
View file @
f4208759
...
...
@@ -1496,9 +1496,38 @@ private ServerEndPoint SelectServerByElection(ServerEndPoint[] servers, string e
return
servers
[
i
];
}
LogLocked
(
log
,
"...but we couldn't find that"
);
var
deDottedEndpoint
=
DeDotifyHost
(
endpoint
);
for
(
int
i
=
0
;
i
<
servers
.
Length
;
i
++)
{
if
(
string
.
Equals
(
DeDotifyHost
(
Format
.
ToString
(
servers
[
i
].
EndPoint
)),
deDottedEndpoint
,
StringComparison
.
OrdinalIgnoreCase
))
{
LogLocked
(
log
,
"...but we did find instead: {0}"
,
deDottedEndpoint
);
return
servers
[
i
];
}
}
return
null
;
}
static
string
DeDotifyHost
(
string
input
)
{
if
(
string
.
IsNullOrWhiteSpace
(
input
))
return
input
;
// GIGO
if
(!
char
.
IsLetter
(
input
[
0
]))
return
input
;
// need first char to be alpha for this to work
int
periodPosition
=
input
.
IndexOf
(
'.'
);
if
(
periodPosition
<=
0
)
return
input
;
// no period or starts with a period? nothing useful to split
int
colonPosition
=
input
.
IndexOf
(
':'
);
if
(
colonPosition
>
0
)
{
// has a port specifier
return
input
.
Substring
(
0
,
periodPosition
)
+
input
.
Substring
(
colonPosition
);
}
else
{
return
input
.
Substring
(
0
,
periodPosition
);
}
}
internal
void
UpdateClusterRange
(
ClusterConfiguration
configuration
)
{
if
(
configuration
==
null
)
return
;
...
...
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