mirror of
https://github.com/sogou/workflow.git
synced 2026-10-28 19:19:22 +08:00
Add HttpMessage::append_output_body() and append_output_body_nocopy
This commit is contained in:
@@ -131,7 +131,19 @@ public:
|
||||
* msg->get_parsed_body(&body, &size);
|
||||
* msg->append_output_body_nocopy(body, size); */
|
||||
bool append_output_body(const void *buf, size_t size);
|
||||
|
||||
bool append_output_body(const char *buf)
|
||||
{
|
||||
return this->append_output_body(buf, strlen(buf));
|
||||
}
|
||||
|
||||
bool append_output_body_nocopy(const void *buf, size_t size);
|
||||
|
||||
bool append_output_body_nocopy(const char *buf)
|
||||
{
|
||||
return this->append_output_body_nocopy(buf, strlen(buf));
|
||||
}
|
||||
|
||||
void clear_output_body();
|
||||
|
||||
size_t get_output_body_size() const
|
||||
@@ -178,6 +190,11 @@ public:
|
||||
return this->append_output_body(buf.c_str(), buf.size());
|
||||
}
|
||||
|
||||
bool append_output_body_nocopy(const std::string& buf)
|
||||
{
|
||||
return this->append_output_body_nocopy(buf.c_str(), buf.size());
|
||||
}
|
||||
|
||||
protected:
|
||||
http_parser_t *parser;
|
||||
size_t cur_size;
|
||||
|
||||
Reference in New Issue
Block a user