Only allow one stdin record, avoid the copy
This commit is contained in:
@@ -19,9 +19,10 @@ class Request {
|
||||
uint16_t RequestId();
|
||||
|
||||
void AddParam(const std::string_view& key, const std::string_view& value);
|
||||
void AddIn(const std::string_view& in);
|
||||
void SetBody(const std::string_view& in);
|
||||
|
||||
const std::string& GetParam(const std::string& key);
|
||||
const std::string_view& GetBody();
|
||||
|
||||
void WriteHeader(const std::string_view& name, const std::string_view& value);
|
||||
void WriteBody(const std::string_view& body);
|
||||
@@ -36,7 +37,7 @@ class Request {
|
||||
uint16_t request_id_ = 0;
|
||||
|
||||
std::unordered_map<std::string, std::string> params_;
|
||||
std::string in_;
|
||||
std::string_view body_;
|
||||
|
||||
firebuf::Buffer out_buf_;
|
||||
bool body_written_;
|
||||
|
||||
Reference in New Issue
Block a user