-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for binary data read for Table::get() #836
Conversation
In the current implementation, the data from redis is passed directly to the std::string(char*) constructor which truncates the data on the null byte. To support binary data that can contain null bytes, the redis reply *str* is passed along with its *len* into the std::string(char*,size_t) constructor that supports the input size.
Hi @liuh-80 , please help check and merge this PR. |
@Yakiv-Huryk , I found this PR will cause build break in sonic-buildimage, please check and fix: https://dev.azure.com/mssonic/be1b070f-be15-4154-aade-b1d3bfb17054/_apis/build/builds/426203/logs/58 In constructor 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]', |
Fixed in the #841 |
In the current implementation, the data from redis is passed directly to the std::string(char*) constructor which truncates the data on the null byte. To support binary data that can contain null bytes, the redis reply *str* is passed along with its *len* into the std::string(char*,size_t) constructor that supports the input size.
Cherry-pick PR to 202311: #880 |
…836) In the current implementation, the data from redis is passed directly to the std::string(char*) constructor which truncates the data on the null byte. To support binary data that can contain null bytes, the redis reply *str* is passed along with its *len* into the std::string(char*,size_t) constructor that supports the input size. Co-authored-by: Yakiv Huryk <[email protected]> Co-authored-by: Ze Gan <[email protected]>
In the current implementation, the data from redis is passed directly to the std::string(char*) constructor which truncates the data on the null byte.
To support binary data that can contain null bytes, the redis reply str is passed along with its len into the std::string(char*,size_t) constructor that supports the input size.