@@ -601,9 +601,11 @@ set_log_id() sets a 64-bit integral log_id, which is sent to the server-side alo
...
@@ -601,9 +601,11 @@ set_log_id() sets a 64-bit integral log_id, which is sent to the server-side alo
## Attachment
## Attachment
baidu_std and hulu_pbrpc supports attachment, which is set by user to bypass serialization of protobuf. As a client, the data in Controller::request_attachment() will be received by the server and response_attachment() contains attachment sent back by the server. Attachment is not compressed by brpc.
baidu_std and hulu_pbrpc supports attachments which are sent along with messages and set by users to bypass serialization of protobuf. As a client, data set in Controller::request_attachment() will be received by server and response_attachment() contains attachment sent back by the server.
In http, attachment corresponds to [message body](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html), namely the data to post is stored in request_attachment().
Attachment is not compressed by framework.
In http, attachment corresponds to [message body](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html), namely the data to post to server is stored in request_attachment().
## Authentication
## Authentication
TODO: Describe how authentication methods are extended.
TODO: Describe how authentication methods are extended.
@@ -165,7 +165,9 @@ When server returns a non-2xx HTTP status code, the HTTP request is considered t
...
@@ -165,7 +165,9 @@ When server returns a non-2xx HTTP status code, the HTTP request is considered t
# Compress Request Body
# Compress Request Body
Call `Controller::set_request_compress_type(brpc::COMPRESS_TYPE_GZIP)` and then the framework will use gzip to compress HTTP body and set `Content-Encoding` to gzip.
Calling `Controller::set_request_compress_type(brpc::COMPRESS_TYPE_GZIP)` makes framework try to gzip the HTTP body. "try to" means the compression may not happen, because:
* Size of body is smaller than bytes specified by -http_body_compress_threshold, which is 512 by default. The reason is that gzip is not a very fast compression algorithm, when body is small, the delay caused by compression may even larger than the latency saved by faster transportation.