You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by if...@apache.org on 2021/04/07 04:46:32 UTC

[rocketmq-client-cpp] branch re_dev updated (f3c8278 -> 5870109)

This is an automated email from the ASF dual-hosted git repository.

ifplusor pushed a change to branch re_dev
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git.


    from f3c8278  refactor: return std::unique_ptr not pointer
     new 342815d  fix: IPPortToSockaddr for ipv6
     new 5870109  fix: decode storehost field

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/message/MessageDecoder.cpp | 6 +++---
 src/transport/SocketUtil.cpp   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

[rocketmq-client-cpp] 01/02: fix: IPPortToSockaddr for ipv6

Posted by if...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ifplusor pushed a commit to branch re_dev
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git

commit 342815dac52aaef89b2dca0dfa3489c9bd7ab760
Author: James Yin <yw...@hotmail.com>
AuthorDate: Wed Apr 7 12:42:47 2021 +0800

    fix: IPPortToSockaddr for ipv6
---
 src/transport/SocketUtil.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/transport/SocketUtil.cpp b/src/transport/SocketUtil.cpp
index 230db1a..d7de908 100644
--- a/src/transport/SocketUtil.cpp
+++ b/src/transport/SocketUtil.cpp
@@ -56,7 +56,7 @@ sockaddr* IPPortToSockaddr(const ByteArray& ip, uint16_t port) {
     sin->sin_port = htons(port);
     std::memcpy(&sin->sin_addr, ip.array(), kIPv4AddrSize);
   } else if (ip.size() == kIPv6AddrSize) {
-    auto* sin6 = reinterpret_cast<sockaddr_in6*>(&ss);
+    auto* sin6 = reinterpret_cast<sockaddr_in6*>(ss);
     sin6->sin6_family = AF_INET6;
     sin6->sin6_port = htons(port);
     std::memcpy(&sin6->sin6_addr, ip.array(), kIPv6AddrSize);

[rocketmq-client-cpp] 02/02: fix: decode storehost field

Posted by if...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ifplusor pushed a commit to branch re_dev
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git

commit 5870109ca26be2dc5fd1a9a6e2174b5fe8e84378
Author: James Yin <yw...@hotmail.com>
AuthorDate: Wed Apr 7 12:44:41 2021 +0800

    fix: decode storehost field
---
 src/message/MessageDecoder.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/message/MessageDecoder.cpp b/src/message/MessageDecoder.cpp
index 08df407..675bac7 100644
--- a/src/message/MessageDecoder.cpp
+++ b/src/message/MessageDecoder.cpp
@@ -136,9 +136,9 @@ MessageExtPtr MessageDecoder::decode(ByteBuffer& byteBuffer, bool readBody, bool
   msgExt->set_store_timestamp(storeTimestamp);
 
   // 12 STOREHOST
-  int storehostIPLength = (sysFlag & MessageSysFlag::STOREHOST_V6_FLAG) == 0 ? kIPv4AddrSize : kIPv6AddrSize;
-  ByteArray storeHost(bornHostLength);
-  byteBuffer.get(storeHost, 0, storehostIPLength);
+  int storeHostLength = (sysFlag & MessageSysFlag::STOREHOST_V6_FLAG) == 0 ? kIPv4AddrSize : kIPv6AddrSize;
+  ByteArray storeHost(storeHostLength);
+  byteBuffer.get(storeHost, 0, storeHostLength);
   int32_t storePort = byteBuffer.getInt();
   msgExt->set_store_host(IPPortToSockaddr(storeHost, storePort));