Hmmmm, that's too bad. I'd like to avoid creating a buffer and then
copying it over ("minimize the movement of data"). Is there a better
way to write binary data directly into the message contents without
creating a buffer first?
Jonathan,
When I go through the code (framing::TransferContent) I can clearly see
that the current implementation can not handle binary data.
At the moment "data" is a std::string and the method "setData" assigns
the incoming string value to this std::string variable directly. When it
comes to binary data, we can see null terminators in the middle and
hence assigning the binary data stream to a std::string will definitely
truncate the data. So what we will have in the message is just a part of
the original binary data.
So, as a solution for this, we need to have two class level variables to
keep binary data.
1. void* data;
2. long dataLength;
These two are enough to say all about our binary data dump. So,
obviously we need to have separate methods to get and set binary data.
We may make use of these changes to keep string data as well so that we
can drop the current std::string variable.
I can send you a patch if we are happy with this.
Danushka
--
Danushka Menikkumbura
Technical Lead, WSO2 Inc.
blog : http://danushka-menikkumbura.blogspot.com/
http://wso2.com/ - "The Open Source SOA Company"