| 1869 | class HttpServiceImpl : public ::test::HttpService { |
| 1870 | public: |
| 1871 | void Head(::google::protobuf::RpcController* cntl_base, |
| 1872 | const ::test::HttpRequest*, |
| 1873 | ::test::HttpResponse*, |
| 1874 | ::google::protobuf::Closure* done) override { |
| 1875 | brpc::ClosureGuard done_guard(done); |
| 1876 | brpc::Controller* cntl = static_cast<brpc::Controller*>(cntl_base); |
| 1877 | ASSERT_EQ(cntl->http_request().method(), brpc::HTTP_METHOD_HEAD); |
| 1878 | const std::string* index = cntl->http_request().GetHeader("x-db-index"); |
| 1879 | ASSERT_NE(nullptr, index); |
| 1880 | int i; |
| 1881 | ASSERT_TRUE(butil::StringToInt(*index, &i)); |
| 1882 | cntl->http_response().set_content_type("text/plain"); |
| 1883 | if (i % 2 == 0) { |
| 1884 | cntl->http_response().SetHeader("Content-Length", |
| 1885 | EXP_RESPONSE_CONTENT_LENGTH); |
| 1886 | } else { |
| 1887 | cntl->http_response().SetHeader("Transfer-Encoding", |
| 1888 | EXP_RESPONSE_TRANSFER_ENCODING); |
| 1889 | } |
| 1890 | } |
| 1891 | |
| 1892 | void Expect(::google::protobuf::RpcController* cntl_base, |
| 1893 | const ::test::HttpRequest*, |
nothing calls this directly
no test coverage detected