GehaFearless commented on code in PR #1825:
URL:
https://github.com/apache/incubator-pegasus/pull/1825#discussion_r1442830979
##########
src/runtime/rpc/rpc_host_port.cpp:
##########
@@ -157,19 +157,28 @@ std::string host_port::to_string() const
case HOST_TYPE_IPV4:
return fmt::format("{}:{}", _host, _port);
case HOST_TYPE_GROUP:
- return fmt::format("address group {}", group_host_port()->name());
+ return fmt::format("host_port group {}", group_host_port()->name());
default:
- return "invalid address";
+ return "invalid host_port";
}
}
+// hostname has a maximum of 253 ASCII characters
+// uint_16 port maximum is 65535
+// 253 + 1(colon) + 5 = 259
+static __thread fixed_size_buffer_pool<8, 259> bf;
+const char *host_port::get_char_str() const
Review Comment:
e.g.
`sprintf("%s", get_char_str())`
`strcpy(dest, get_char_str())`
If we just have a funcation returnd temporary vaule not enough.
Initially, I thought that a buffer for storing one string would be
sufficient.
Later I found `fixed_size_buffer_pool` from class `rpc_address` and thought
it was more suitable.
Updated buffer not have influence on use.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]