| 127 | } |
| 128 | |
| 129 | void Stream::BeforeRecycle(Socket *) { |
| 130 | // No one holds reference now, so we don't need lock here |
| 131 | bthread_id_list_reset(&_writable_wait_list, ECONNRESET); |
| 132 | if (_connected) { |
| 133 | // Send CLOSE frame |
| 134 | RPC_VLOG << "Send close frame"; |
| 135 | CHECK(_host_socket != NULL); |
| 136 | policy::SendStreamClose(_host_socket, |
| 137 | _remote_settings.stream_id(), id()); |
| 138 | } |
| 139 | |
| 140 | if (_host_socket) { |
| 141 | _host_socket->RemoveStream(id()); |
| 142 | } |
| 143 | |
| 144 | // The instance is to be deleted in the consumer thread |
| 145 | bthread::execution_queue_stop(_consumer_queue); |
| 146 | } |
| 147 | |
| 148 | ssize_t Stream::CutMessageIntoFileDescriptor(int /*fd*/, |
| 149 | butil::IOBuf **data_list, |
no test coverage detected