void encrypt(const char* body, unsigned len) { SharedBuffer encBody = _parent->getEncrypter()->encrypt(_headers, body, len, _encOpt); if (encBody.size() != 0) { _request->setRequestData(encBody.buffer(), encBody.size()); } }
void splitHeaders(const SharedBuffer& sb, std::vector<std::string>& headers) { std::string src(sb.buffer(), sb.size()); StringSplitter splitter(src, "\r\n", false); const std::vector<std::string>& lines = splitter.get(); headers.insert(headers.begin(), lines.begin(), lines.end()); }