| 756 | } |
| 757 | |
| 758 | void Stream::HandleRpcResponse(butil::IOBuf* response_buffer) { |
| 759 | CHECK(!_remote_settings.IsInitialized()); |
| 760 | CHECK(_host_socket != NULL); |
| 761 | std::unique_ptr<butil::IOBuf> buf_guard(response_buffer); |
| 762 | ParseResult pr = policy::ParseRpcMessage(response_buffer, NULL, true, NULL); |
| 763 | if (!pr.is_ok()) { |
| 764 | CHECK(false); |
| 765 | Close(EPROTO, "Fail to parse rpc response message"); |
| 766 | return; |
| 767 | } |
| 768 | InputMessageBase* msg = pr.message(); |
| 769 | if (msg == NULL) { |
| 770 | CHECK(false); |
| 771 | Close(ENOMEM, "Message is NULL"); |
| 772 | return; |
| 773 | } |
| 774 | _host_socket->PostponeEOF(); |
| 775 | _host_socket->ReAddress(&msg->_socket); |
| 776 | msg->_received_us = butil::gettimeofday_us(); |
| 777 | msg->_base_real_us = butil::gettimeofday_us(); |
| 778 | msg->_arg = NULL; // ProcessRpcResponse() don't need arg |
| 779 | policy::ProcessRpcResponse(msg); |
| 780 | } |
| 781 | |
| 782 | int StreamWrite(StreamId stream_id, const butil::IOBuf &message, |
| 783 | const StreamWriteOptions* options) { |
no test coverage detected