brpc
brpc copied to clipboard
hostname2endpoint函数对域名提取可能不正确
Describe the bug (描述bug) 在butil/endpoint.cpp文件 hostname2endpoint函数中,对域名进行提取时,如果域名长度是恰好是63个字符时, 函数会进入这个if判断 if (i == sizeof(buf) - 1) { return -1; } 导致函数提前退出返回错误
To Reproduce (复现方法) 使用baidu_std协议通过域名方式访问server节点,如果域名长度恰好是63个字符时,会导致channel无法init成功
Expected behavior (期望行为) 域名长度不超过63,channel可以init成功
Versions (各种版本) OS: centos7.6 Compiler: gcc-4.8.5 brpc: master protobuf: baidu_std
Additional context/screenshots (更多上下文/截图)
@liujianhua2016 可以试下把buf的长度改大点,改成128试试呢?可以提个patch哈
好的, 我稍后提个patch试试
fixed by #2179