| 278 | } |
| 279 | |
| 280 | void MakeH2EchoResponseBuf(butil::IOBuf* out, int h2_stream_id) { |
| 281 | brpc::Controller cntl; |
| 282 | test::EchoResponse res; |
| 283 | res.set_message(EXP_RESPONSE); |
| 284 | cntl.http_request().set_content_type("application/proto"); |
| 285 | { |
| 286 | butil::IOBufAsZeroCopyOutputStream wrapper(&cntl.response_attachment()); |
| 287 | EXPECT_TRUE(res.SerializeToZeroCopyStream(&wrapper)); |
| 288 | } |
| 289 | brpc::policy::H2UnsentResponse* h2_res = brpc::policy::H2UnsentResponse::New(&cntl, h2_stream_id, false /*is grpc*/); |
| 290 | butil::Status st = h2_res->AppendAndDestroySelf(out, _h2_client_sock.get()); |
| 291 | ASSERT_TRUE(st.ok()); |
| 292 | } |
| 293 | |
| 294 | int _pipe_fds[2]; |
| 295 | brpc::SocketUniquePtr _socket; |
nothing calls this directly
no test coverage detected