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
069b30a2
Unverified
Commit
069b30a2
authored
Jun 28, 2022
by
Tian
Committed by
GitHub
Jun 27, 2022
Browse files
A minor refinement to clusterbus extension estlen (#10902)
parent
6af02100
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
069b30a2
...
@@ -2002,7 +2002,7 @@ int writeHostnamePingExt(clusterMsgPingExt **cursor) {
...
@@ -2002,7 +2002,7 @@ int writeHostnamePingExt(clusterMsgPingExt **cursor) {
uint32_t
extension_size
=
getHostnamePingExtSize
();
uint32_t
extension_size
=
getHostnamePingExtSize
();
/* Move the write cursor */
/* Move the write cursor */
(
*
cursor
)
->
type
=
CLUSTERMSG_EXT_TYPE_HOSTNAME
;
(
*
cursor
)
->
type
=
htons
(
CLUSTERMSG_EXT_TYPE_HOSTNAME
)
;
(
*
cursor
)
->
length
=
htonl
(
extension_size
);
(
*
cursor
)
->
length
=
htonl
(
extension_size
);
/* Make sure the string is NULL terminated by adding 1 */
/* Make sure the string is NULL terminated by adding 1 */
*
cursor
=
(
clusterMsgPingExt
*
)
(
ext
->
hostname
+
EIGHT_BYTE_ALIGN
(
sdslen
(
myself
->
hostname
)
+
1
));
*
cursor
=
(
clusterMsgPingExt
*
)
(
ext
->
hostname
+
EIGHT_BYTE_ALIGN
(
sdslen
(
myself
->
hostname
)
+
1
));
...
@@ -2921,7 +2921,7 @@ void clusterSendPing(clusterLink *link, int type) {
...
@@ -2921,7 +2921,7 @@ void clusterSendPing(clusterLink *link, int type) {
* to put inside the packet. */
* to put inside the packet. */
estlen
=
sizeof
(
clusterMsg
)
-
sizeof
(
union
clusterMsgData
);
estlen
=
sizeof
(
clusterMsg
)
-
sizeof
(
union
clusterMsgData
);
estlen
+=
(
sizeof
(
clusterMsgDataGossip
)
*
(
wanted
+
pfail_wanted
));
estlen
+=
(
sizeof
(
clusterMsgDataGossip
)
*
(
wanted
+
pfail_wanted
));
estlen
+=
sizeof
(
clusterMsgPingExt
)
+
getHostnamePingExtSize
();
estlen
+=
getHostnamePingExtSize
();
/* Note: clusterBuildMessageHdr() expects the buffer to be always at least
/* Note: clusterBuildMessageHdr() expects the buffer to be always at least
* sizeof(clusterMsg) or more. */
* sizeof(clusterMsg) or more. */
...
...
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