2021-03-10 18:14:48 +03:00
|
|
|
// Copyright 2021 The Grin Developers
|
2016-10-25 07:35:10 +03:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2019-10-10 11:38:25 +03:00
|
|
|
use crate::chain;
|
2020-09-28 16:43:37 +03:00
|
|
|
use crate::conn::MessageHandler;
|
|
|
|
use crate::core::core::{hash::Hashed, CompactBlock};
|
|
|
|
|
2020-11-25 23:52:09 +03:00
|
|
|
use crate::msg::{
|
|
|
|
Consumed, Headers, Message, Msg, OutputBitmapSegmentResponse, OutputSegmentResponse, PeerAddrs,
|
|
|
|
Pong, SegmentRequest, SegmentResponse, TxHashSetArchive, Type,
|
|
|
|
};
|
2020-09-28 16:43:37 +03:00
|
|
|
use crate::types::{AttachmentMeta, Error, NetAdapter, PeerInfo};
|
2019-05-15 18:51:35 +03:00
|
|
|
use chrono::prelude::Utc;
|
|
|
|
use rand::{thread_rng, Rng};
|
2020-09-28 16:43:37 +03:00
|
|
|
use std::fs::{self, File};
|
2019-08-01 19:46:06 +03:00
|
|
|
use std::sync::atomic::{AtomicBool, Ordering};
|
2019-05-15 18:51:35 +03:00
|
|
|
use std::sync::Arc;
|
2016-10-25 07:35:10 +03:00
|
|
|
|
2018-02-02 05:03:12 +03:00
|
|
|
pub struct Protocol {
|
2018-12-08 02:59:40 +03:00
|
|
|
adapter: Arc<dyn NetAdapter>,
|
2019-04-18 16:11:06 +03:00
|
|
|
peer_info: PeerInfo,
|
2019-08-01 19:46:06 +03:00
|
|
|
state_sync_requested: Arc<AtomicBool>,
|
2016-10-31 22:29:08 +03:00
|
|
|
}
|
|
|
|
|
2018-02-02 05:03:12 +03:00
|
|
|
impl Protocol {
|
2019-08-01 19:46:06 +03:00
|
|
|
pub fn new(
|
|
|
|
adapter: Arc<dyn NetAdapter>,
|
|
|
|
peer_info: PeerInfo,
|
|
|
|
state_sync_requested: Arc<AtomicBool>,
|
|
|
|
) -> Protocol {
|
|
|
|
Protocol {
|
|
|
|
adapter,
|
|
|
|
peer_info,
|
|
|
|
state_sync_requested,
|
|
|
|
}
|
2017-02-02 06:05:17 +03:00
|
|
|
}
|
2016-10-25 07:35:10 +03:00
|
|
|
}
|
|
|
|
|
2018-02-02 05:03:12 +03:00
|
|
|
impl MessageHandler for Protocol {
|
2020-09-28 16:43:37 +03:00
|
|
|
fn consume(&self, message: Message) -> Result<Consumed, Error> {
|
2018-02-02 05:03:12 +03:00
|
|
|
let adapter = &self.adapter;
|
2018-01-30 17:42:04 +03:00
|
|
|
|
2018-03-27 19:09:41 +03:00
|
|
|
// If we received a msg from a banned peer then log and drop it.
|
|
|
|
// If we are getting a lot of these then maybe we are not cleaning
|
|
|
|
// banned peers up correctly?
|
2019-04-18 16:11:06 +03:00
|
|
|
if adapter.is_banned(self.peer_info.addr) {
|
2018-03-27 19:09:41 +03:00
|
|
|
debug!(
|
2020-09-28 16:43:37 +03:00
|
|
|
"handler: consume: peer {:?} banned, received: {}, dropping.",
|
|
|
|
self.peer_info.addr, message,
|
2018-03-27 19:09:41 +03:00
|
|
|
);
|
2020-09-28 16:43:37 +03:00
|
|
|
return Ok(Consumed::Disconnect);
|
2018-03-27 19:09:41 +03:00
|
|
|
}
|
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
let consumed = match message {
|
|
|
|
Message::Attachment(update, _) => {
|
|
|
|
self.adapter.txhashset_download_update(
|
|
|
|
update.meta.start_time,
|
|
|
|
(update.meta.size - update.left) as u64,
|
|
|
|
update.meta.size as u64,
|
|
|
|
);
|
|
|
|
|
|
|
|
if update.left == 0 {
|
|
|
|
let meta = update.meta;
|
|
|
|
trace!(
|
|
|
|
"handle_payload: txhashset archive save to file {:?} success",
|
|
|
|
meta.path,
|
|
|
|
);
|
|
|
|
|
|
|
|
let zip = File::open(meta.path.clone())?;
|
|
|
|
let res =
|
|
|
|
self.adapter
|
|
|
|
.txhashset_write(meta.hash.clone(), zip, &self.peer_info)?;
|
2017-02-08 00:52:17 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
debug!(
|
|
|
|
"handle_payload: txhashset archive for {} at {}, DONE. Data Ok: {}",
|
|
|
|
meta.hash, meta.height, !res
|
|
|
|
);
|
|
|
|
|
|
|
|
if let Err(e) = fs::remove_file(meta.path.clone()) {
|
|
|
|
warn!("fail to remove tmp file: {:?}. err: {}", meta.path, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Consumed::None
|
|
|
|
}
|
|
|
|
|
|
|
|
Message::Ping(ping) => {
|
|
|
|
adapter.peer_difficulty(self.peer_info.addr, ping.total_difficulty, ping.height);
|
|
|
|
Consumed::Response(Msg::new(
|
2018-03-04 03:19:54 +03:00
|
|
|
Type::Pong,
|
|
|
|
Pong {
|
2019-04-08 23:13:28 +03:00
|
|
|
total_difficulty: adapter.total_difficulty()?,
|
|
|
|
height: adapter.total_height()?,
|
2018-03-04 03:19:54 +03:00
|
|
|
},
|
2019-10-07 18:22:05 +03:00
|
|
|
self.peer_info.version,
|
2020-09-28 16:43:37 +03:00
|
|
|
)?)
|
2018-02-02 05:03:12 +03:00
|
|
|
}
|
2018-01-31 23:39:55 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::Pong(pong) => {
|
2019-04-18 16:11:06 +03:00
|
|
|
adapter.peer_difficulty(self.peer_info.addr, pong.total_difficulty, pong.height);
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2018-03-04 03:19:54 +03:00
|
|
|
}
|
2017-12-14 15:19:43 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::BanReason(ban_reason) => {
|
2018-10-21 23:30:56 +03:00
|
|
|
error!("handle_payload: BanReason {:?}", ban_reason);
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::Disconnect
|
2018-05-29 05:45:31 +03:00
|
|
|
}
|
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::TransactionKernel(h) => {
|
|
|
|
debug!("handle_payload: received tx kernel: {}", h);
|
2019-04-18 16:11:06 +03:00
|
|
|
adapter.tx_kernel_received(h, &self.peer_info)?;
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2018-11-07 12:28:17 +03:00
|
|
|
}
|
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::GetTransaction(h) => {
|
|
|
|
debug!("handle_payload: GetTransaction: {}", h);
|
2018-11-07 12:28:17 +03:00
|
|
|
let tx = adapter.get_transaction(h);
|
|
|
|
if let Some(tx) = tx {
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::Response(Msg::new(Type::Transaction, tx, self.peer_info.version)?)
|
2018-11-07 12:28:17 +03:00
|
|
|
} else {
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2018-11-07 12:28:17 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::Transaction(tx) => {
|
|
|
|
debug!("handle_payload: received tx");
|
2019-04-08 23:13:28 +03:00
|
|
|
adapter.transaction_received(tx, false)?;
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2018-03-20 06:18:54 +03:00
|
|
|
}
|
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::StemTransaction(tx) => {
|
|
|
|
debug!("handle_payload: received stem tx");
|
2019-04-08 23:13:28 +03:00
|
|
|
adapter.transaction_received(tx, true)?;
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2017-12-14 15:19:43 +03:00
|
|
|
}
|
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::GetBlock(h) => {
|
|
|
|
trace!("handle_payload: GetBlock: {}", h);
|
2020-09-07 18:58:41 +03:00
|
|
|
let bo = adapter.get_block(h, &self.peer_info);
|
2018-02-02 05:03:12 +03:00
|
|
|
if let Some(b) = bo {
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::Response(Msg::new(Type::Block, b, self.peer_info.version)?)
|
|
|
|
} else {
|
|
|
|
Consumed::None
|
2017-12-14 15:19:43 +03:00
|
|
|
}
|
2017-02-08 00:52:17 +03:00
|
|
|
}
|
2018-01-31 23:39:55 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::Block(b) => {
|
|
|
|
debug!("handle_payload: received block");
|
2019-10-10 11:38:25 +03:00
|
|
|
// We default to NONE opts here as we do not know know yet why this block was
|
|
|
|
// received.
|
|
|
|
// If we requested this block from a peer due to our node syncing then
|
|
|
|
// the peer adapter will override opts to reflect this.
|
2019-10-27 10:40:52 +03:00
|
|
|
adapter.block_received(b.into(), &self.peer_info, chain::Options::NONE)?;
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2018-02-02 05:03:12 +03:00
|
|
|
}
|
2018-02-07 19:26:52 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::GetCompactBlock(h) => {
|
2020-09-07 18:58:41 +03:00
|
|
|
if let Some(b) = adapter.get_block(h, &self.peer_info) {
|
2018-09-18 20:51:37 +03:00
|
|
|
let cb: CompactBlock = b.into();
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::Response(Msg::new(Type::CompactBlock, cb, self.peer_info.version)?)
|
2018-01-31 23:39:55 +03:00
|
|
|
} else {
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2018-01-31 23:39:55 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::CompactBlock(b) => {
|
|
|
|
debug!("handle_payload: received compact block");
|
2019-10-27 10:40:52 +03:00
|
|
|
adapter.compact_block_received(b.into(), &self.peer_info)?;
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2017-12-14 15:19:43 +03:00
|
|
|
}
|
2017-02-08 00:52:17 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::GetHeaders(loc) => {
|
2018-02-02 05:03:12 +03:00
|
|
|
// load headers from the locator
|
2019-04-08 23:13:28 +03:00
|
|
|
let headers = adapter.locate_headers(&loc.hashes)?;
|
2018-01-30 17:42:04 +03:00
|
|
|
|
2018-02-02 05:03:12 +03:00
|
|
|
// serialize and send all the headers over
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::Response(Msg::new(
|
2018-11-16 17:34:05 +03:00
|
|
|
Type::Headers,
|
|
|
|
Headers { headers },
|
2019-10-07 18:22:05 +03:00
|
|
|
self.peer_info.version,
|
2020-09-28 16:43:37 +03:00
|
|
|
)?)
|
2018-02-02 05:03:12 +03:00
|
|
|
}
|
2018-01-30 17:42:04 +03:00
|
|
|
|
2018-02-07 19:26:52 +03:00
|
|
|
// "header first" block propagation - if we have not yet seen this block
|
|
|
|
// we can go request it from some of our peers
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::Header(header) => {
|
2019-10-27 10:40:52 +03:00
|
|
|
adapter.header_received(header.into(), &self.peer_info)?;
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2018-02-07 19:26:52 +03:00
|
|
|
}
|
|
|
|
|
2021-02-16 17:36:28 +03:00
|
|
|
Message::Headers(data) => {
|
|
|
|
adapter.headers_received(&data.headers, &self.peer_info)?;
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2018-02-02 05:03:12 +03:00
|
|
|
}
|
2018-01-30 17:42:04 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::GetPeerAddrs(get_peers) => {
|
2019-02-18 15:15:32 +03:00
|
|
|
let peers = adapter.find_peer_addrs(get_peers.capabilities);
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::Response(Msg::new(
|
2018-03-04 03:19:54 +03:00
|
|
|
Type::PeerAddrs,
|
2019-02-18 15:15:32 +03:00
|
|
|
PeerAddrs { peers },
|
2019-10-07 18:22:05 +03:00
|
|
|
self.peer_info.version,
|
2020-09-28 16:43:37 +03:00
|
|
|
)?)
|
2018-02-02 05:03:12 +03:00
|
|
|
}
|
2017-02-19 05:42:34 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::PeerAddrs(peer_addrs) => {
|
2019-02-18 15:15:32 +03:00
|
|
|
adapter.peer_addrs_received(peer_addrs.peers);
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2017-12-14 15:19:43 +03:00
|
|
|
}
|
2017-02-19 05:42:34 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::TxHashSetRequest(sm_req) => {
|
2018-03-04 03:19:54 +03:00
|
|
|
debug!(
|
2018-10-21 23:30:56 +03:00
|
|
|
"handle_payload: txhashset req for {} at {}",
|
|
|
|
sm_req.hash, sm_req.height
|
2018-03-04 03:19:54 +03:00
|
|
|
);
|
2018-02-10 01:32:16 +03:00
|
|
|
|
2019-07-23 11:46:29 +03:00
|
|
|
let txhashset_header = self.adapter.txhashset_archive_header()?;
|
|
|
|
let txhashset_header_hash = txhashset_header.hash();
|
|
|
|
let txhashset = self.adapter.txhashset_read(txhashset_header_hash);
|
2018-02-10 01:32:16 +03:00
|
|
|
|
2018-03-05 22:33:44 +03:00
|
|
|
if let Some(txhashset) = txhashset {
|
|
|
|
let file_sz = txhashset.reader.metadata()?.len();
|
2019-10-07 18:22:05 +03:00
|
|
|
let mut resp = Msg::new(
|
2018-03-05 22:33:44 +03:00
|
|
|
Type::TxHashSetArchive,
|
|
|
|
&TxHashSetArchive {
|
2019-07-23 11:46:29 +03:00
|
|
|
height: txhashset_header.height as u64,
|
|
|
|
hash: txhashset_header_hash,
|
2018-02-10 01:32:16 +03:00
|
|
|
bytes: file_sz,
|
2018-03-04 03:19:54 +03:00
|
|
|
},
|
2019-10-07 18:22:05 +03:00
|
|
|
self.peer_info.version,
|
2019-02-25 21:48:54 +03:00
|
|
|
)?;
|
2018-03-05 22:33:44 +03:00
|
|
|
resp.add_attachment(txhashset.reader);
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::Response(resp)
|
2018-02-10 01:32:16 +03:00
|
|
|
} else {
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::None
|
2018-02-10 01:32:16 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::TxHashSetArchive(sm_arch) => {
|
2018-03-04 03:19:54 +03:00
|
|
|
debug!(
|
2018-07-23 20:37:35 +03:00
|
|
|
"handle_payload: txhashset archive for {} at {}. size={}",
|
2018-10-21 23:30:56 +03:00
|
|
|
sm_arch.hash, sm_arch.height, sm_arch.bytes,
|
2018-03-04 03:19:54 +03:00
|
|
|
);
|
2018-07-12 19:06:52 +03:00
|
|
|
if !self.adapter.txhashset_receive_ready() {
|
2018-07-23 20:37:35 +03:00
|
|
|
error!(
|
|
|
|
"handle_payload: txhashset archive received but SyncStatus not on TxHashsetDownload",
|
|
|
|
);
|
2018-07-12 19:06:52 +03:00
|
|
|
return Err(Error::BadMessage);
|
|
|
|
}
|
2019-08-01 19:46:06 +03:00
|
|
|
if !self.state_sync_requested.load(Ordering::Relaxed) {
|
|
|
|
error!("handle_payload: txhashset archive received but from the wrong peer",);
|
|
|
|
return Err(Error::BadMessage);
|
|
|
|
}
|
|
|
|
// Update the sync state requested status
|
|
|
|
self.state_sync_requested.store(false, Ordering::Relaxed);
|
2018-10-13 05:12:13 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
let start_time = Utc::now();
|
2018-10-13 05:12:13 +03:00
|
|
|
self.adapter
|
2020-09-28 16:43:37 +03:00
|
|
|
.txhashset_download_update(start_time, 0, sm_arch.bytes);
|
2018-10-13 05:12:13 +03:00
|
|
|
|
2019-04-23 02:54:36 +03:00
|
|
|
let nonce: u32 = thread_rng().gen_range(0, 1_000_000);
|
2020-09-28 16:43:37 +03:00
|
|
|
let path = self.adapter.get_tmpfile_pathname(format!(
|
2019-04-23 02:54:36 +03:00
|
|
|
"txhashset-{}-{}.zip",
|
2020-09-28 16:43:37 +03:00
|
|
|
start_time.timestamp(),
|
2019-04-23 02:54:36 +03:00
|
|
|
nonce
|
|
|
|
));
|
2018-07-23 20:37:35 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
let file = fs::OpenOptions::new()
|
|
|
|
.write(true)
|
|
|
|
.create_new(true)
|
|
|
|
.open(path.clone())?;
|
|
|
|
|
|
|
|
let meta = AttachmentMeta {
|
|
|
|
size: sm_arch.bytes as usize,
|
|
|
|
hash: sm_arch.hash,
|
|
|
|
height: sm_arch.height,
|
|
|
|
start_time,
|
|
|
|
path,
|
|
|
|
};
|
2019-04-23 02:54:36 +03:00
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Consumed::Attachment(Arc::new(meta), file)
|
2018-02-02 05:03:12 +03:00
|
|
|
}
|
2020-11-25 23:52:09 +03:00
|
|
|
|
|
|
|
Message::GetOutputBitmapSegment(req) => {
|
|
|
|
let SegmentRequest {
|
|
|
|
block_hash,
|
|
|
|
identifier,
|
|
|
|
} = req;
|
|
|
|
if let Ok((segment, output_root)) =
|
|
|
|
self.adapter.get_bitmap_segment(block_hash, identifier)
|
|
|
|
{
|
|
|
|
Consumed::Response(Msg::new(
|
|
|
|
Type::OutputBitmapSegment,
|
|
|
|
OutputBitmapSegmentResponse {
|
|
|
|
block_hash,
|
|
|
|
segment: segment.into(),
|
|
|
|
output_root,
|
|
|
|
},
|
|
|
|
self.peer_info.version,
|
|
|
|
)?)
|
|
|
|
} else {
|
|
|
|
Consumed::None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Message::GetOutputSegment(req) => {
|
|
|
|
let SegmentRequest {
|
|
|
|
block_hash,
|
|
|
|
identifier,
|
|
|
|
} = req;
|
|
|
|
if let Ok((segment, output_bitmap_root)) =
|
|
|
|
self.adapter.get_output_segment(block_hash, identifier)
|
|
|
|
{
|
|
|
|
Consumed::Response(Msg::new(
|
|
|
|
Type::OutputSegment,
|
|
|
|
OutputSegmentResponse {
|
|
|
|
response: SegmentResponse {
|
|
|
|
block_hash,
|
|
|
|
segment,
|
|
|
|
},
|
|
|
|
output_bitmap_root,
|
|
|
|
},
|
|
|
|
self.peer_info.version,
|
|
|
|
)?)
|
|
|
|
} else {
|
|
|
|
Consumed::None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Message::GetRangeProofSegment(req) => {
|
|
|
|
let SegmentRequest {
|
|
|
|
block_hash,
|
|
|
|
identifier,
|
|
|
|
} = req;
|
|
|
|
if let Ok(segment) = self.adapter.get_rangeproof_segment(block_hash, identifier) {
|
|
|
|
Consumed::Response(Msg::new(
|
|
|
|
Type::RangeProofSegment,
|
|
|
|
SegmentResponse {
|
|
|
|
block_hash,
|
|
|
|
segment,
|
|
|
|
},
|
|
|
|
self.peer_info.version,
|
|
|
|
)?)
|
|
|
|
} else {
|
|
|
|
Consumed::None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Message::GetKernelSegment(req) => {
|
|
|
|
let SegmentRequest {
|
|
|
|
block_hash,
|
|
|
|
identifier,
|
|
|
|
} = req;
|
|
|
|
if let Ok(segment) = self.adapter.get_kernel_segment(block_hash, identifier) {
|
|
|
|
Consumed::Response(Msg::new(
|
|
|
|
Type::KernelSegment,
|
|
|
|
SegmentResponse {
|
|
|
|
block_hash,
|
|
|
|
segment,
|
|
|
|
},
|
|
|
|
self.peer_info.version,
|
|
|
|
)?)
|
|
|
|
} else {
|
|
|
|
Consumed::None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Message::OutputBitmapSegment(_)
|
|
|
|
| Message::OutputSegment(_)
|
|
|
|
| Message::RangeProofSegment(_)
|
|
|
|
| Message::KernelSegment(_) => Consumed::None,
|
|
|
|
|
2020-09-28 16:43:37 +03:00
|
|
|
Message::Unknown(_) => Consumed::None,
|
|
|
|
};
|
|
|
|
Ok(consumed)
|
2017-02-02 06:05:17 +03:00
|
|
|
}
|
2016-12-16 01:57:04 +03:00
|
|
|
}
|