wwbmmm commented on code in PR #1965:
URL: https://github.com/apache/incubator-brpc/pull/1965#discussion_r1005438299


##########
src/butil/endpoint.cpp:
##########
@@ -304,12 +304,17 @@ int str2endpoint(const char* ip_str, int port, EndPoint* 
point) {
 
 int hostname2endpoint(const char* str, EndPoint* point) {
     // Should be enough to hold ip address
-    char buf[64];
+    // The definitive descriptions of the rules for forming domain names 
appear in RFC 1035, RFC 1123, RFC 2181,
+    // and RFC 5892. The full domain name may not exceed the length of 253 
characters in its textual representation
+    // (Domain Names - Domain Concepts and Facilities. IETF. 
doi:10.17487/RFC1034. RFC 1034.).
+    // For cacheline optimize, use buf size as 256;
+    char buf[256];

Review Comment:
   建议加个static_assert
    MAX_DOMAIN_LENGTH < sizeof(buf)



-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to