| 163 | } |
| 164 | |
| 165 | int SendStreamData(Socket* sock, const butil::IOBuf* data, |
| 166 | int64_t remote_stream_id, int64_t source_stream_id, |
| 167 | bthread_id_t response_id) { |
| 168 | CHECK(sock != NULL); |
| 169 | StreamFrameMeta fm; |
| 170 | fm.set_stream_id(remote_stream_id); |
| 171 | fm.set_source_stream_id(source_stream_id); |
| 172 | fm.set_frame_type(FRAME_TYPE_DATA); |
| 173 | fm.set_has_continuation(false); |
| 174 | butil::IOBuf out; |
| 175 | PackStreamMessage(&out, fm, data); |
| 176 | Socket::WriteOptions wopt; |
| 177 | if (INVALID_BTHREAD_ID != response_id) { |
| 178 | wopt.id_wait = response_id; |
| 179 | wopt.notify_on_success = true; |
| 180 | } |
| 181 | wopt.ignore_eovercrowded = true; |
| 182 | return sock->Write(&out, &wopt); |
| 183 | } |
| 184 | |
| 185 | } // namespace policy |
| 186 | } // namespace brpc |
no test coverage detected