Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
7bf7b735
Commit
7bf7b735
authored
Feb 10, 2014
by
antirez
Browse files
Cluster: signature changed to "RCmb" (Redis Cluster message bus).
Sounds better after all.
parent
dced9c06
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
7bf7b735
...
@@ -1168,7 +1168,7 @@ int clusterProcessPacket(clusterLink *link) {
...
@@ -1168,7 +1168,7 @@ int clusterProcessPacket(clusterLink *link) {
/* Perform sanity checks */
/* Perform sanity checks */
if
(
totlen
<
16
)
return
1
;
/* At least signature, version, totlen, count. */
if
(
totlen
<
16
)
return
1
;
/* At least signature, version, totlen, count. */
if
(
hdr
->
sig
[
0
]
!=
'R'
||
hdr
->
sig
[
1
]
!=
'C'
||
if
(
hdr
->
sig
[
0
]
!=
'R'
||
hdr
->
sig
[
1
]
!=
'C'
||
hdr
->
sig
[
2
]
!=
'
i
'
||
hdr
->
sig
[
3
]
!=
'b'
)
return
1
;
/* Bad signature. */
hdr
->
sig
[
2
]
!=
'
m
'
||
hdr
->
sig
[
3
]
!=
'b'
)
return
1
;
/* Bad signature. */
if
(
ntohs
(
hdr
->
ver
)
!=
0
)
return
1
;
/* Can't handle versions other than 0. */
if
(
ntohs
(
hdr
->
ver
)
!=
0
)
return
1
;
/* Can't handle versions other than 0. */
if
(
totlen
>
sdslen
(
link
->
rcvbuf
))
return
1
;
if
(
totlen
>
sdslen
(
link
->
rcvbuf
))
return
1
;
if
(
type
==
CLUSTERMSG_TYPE_PING
||
type
==
CLUSTERMSG_TYPE_PONG
||
if
(
type
==
CLUSTERMSG_TYPE_PING
||
type
==
CLUSTERMSG_TYPE_PONG
||
...
@@ -1682,7 +1682,7 @@ void clusterBuildMessageHdr(clusterMsg *hdr, int type) {
...
@@ -1682,7 +1682,7 @@ void clusterBuildMessageHdr(clusterMsg *hdr, int type) {
memset
(
hdr
,
0
,
sizeof
(
*
hdr
));
memset
(
hdr
,
0
,
sizeof
(
*
hdr
));
hdr
->
sig
[
0
]
=
'R'
;
hdr
->
sig
[
0
]
=
'R'
;
hdr
->
sig
[
1
]
=
'C'
;
hdr
->
sig
[
1
]
=
'C'
;
hdr
->
sig
[
2
]
=
'
i
'
;
hdr
->
sig
[
2
]
=
'
m
'
;
hdr
->
sig
[
3
]
=
'b'
;
hdr
->
sig
[
3
]
=
'b'
;
hdr
->
type
=
htons
(
type
);
hdr
->
type
=
htons
(
type
);
memcpy
(
hdr
->
sender
,
myself
->
name
,
REDIS_CLUSTER_NAMELEN
);
memcpy
(
hdr
->
sender
,
myself
->
name
,
REDIS_CLUSTER_NAMELEN
);
...
...
src/cluster.h
View file @
7bf7b735
...
@@ -195,7 +195,7 @@ union clusterMsgData {
...
@@ -195,7 +195,7 @@ union clusterMsgData {
typedef
struct
{
typedef
struct
{
char
sig
[
4
];
/* Siganture "RC
i
b" (Redis Cluster
internal
bus). */
char
sig
[
4
];
/* Siganture "RC
m
b" (Redis Cluster
message
bus). */
uint16_t
ver
;
/* Protocol version, currently set to 0. */
uint16_t
ver
;
/* Protocol version, currently set to 0. */
uint16_t
notused0
;
/* 2 bytes not used. */
uint16_t
notused0
;
/* 2 bytes not used. */
uint32_t
totlen
;
/* Total length of this message */
uint32_t
totlen
;
/* Total length of this message */
...
...
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