fn on_chunk_request(&self, gossip_request: GossipChunkRequest, node_id: NodeId) {
        let start = std::time::Instant::now();
        let artifact_chunk = self.serve_chunk(&gossip_request);
        self.metrics
            .op_duration
            .with_label_values(&["serve_chunk"])
            .observe(start.elapsed().as_millis() as f64);
        let gossip_chunk = GossipChunk {
            artifact_id: gossip_request.artifact_id.clone(),
            integrity_hash: gossip_request.integrity_hash.clone(),
            chunk_id: gossip_request.chunk_id,
            artifact_chunk,
        };
        use_gossip_malicious_behavior_on_chunk_request!(
            self,
            self.malicious_behavior_on_chunk_request(gossip_chunk, node_id),
            {
                self.download_manager
                    .send_chunk_to_peer(gossip_chunk, node_id);
            }
        );
    }
/// The method handles the given chunk request received from the peer with
/// the given node ID.
The method handles the given chunk request received from the peer with
the given node ID.
The method handles the given chunk request received from the peer with the given node ID .
fn on_chunk_request(&self, gossip_request: GossipChunkRequest, node_id: NodeId) {
        let start = std::time::Instant::now();
        let artifact_chunk = self.serve_chunk(&gossip_request);
        self.metrics
            .op_duration
            .with_label_values(&["serve_chunk"])
            .observe(start.elapsed().as_millis() as f64);
        let gossip_chunk = GossipChunk {
            artifact_id: gossip_request.artifact_id.clone(),
            integrity_hash: gossip_request.integrity_hash.clone(),
            chunk_id: gossip_request.chunk_id,
            artifact_chunk,
        };
        use_gossip_malicious_behavior_on_chunk_request!(
            self,
            self.malicious_behavior_on_chunk_request(gossip_chunk, node_id),
            {
                self.download_manager
                    .send_chunk_to_peer(gossip_chunk, node_id);
            }
        );
    }
fn on_chunk_request ( & self , gossip_request : GossipChunkRequest , node_id : NodeId ) { let start = std :: time :: Instant :: now ( ) ; let artifact_chunk = self . serve_chunk ( & gossip_request ) ; self . metrics . op_duration . with_label_values ( & [ " " ] ) . observe ( start . elapsed ( ) . as_millis ( ) as f64 ) ; let gossip_chunk = GossipChunk { artifact_id : gossip_request . artifact_id . clone ( ) , integrity_hash : gossip_request . integrity_hash . clone ( ) , chunk_id : gossip_request . chunk_id , artifact_chunk , } ; use_gossip_malicious_behavior_on_chunk_request ! ( self self malicious_behavior_on_chunk_request ( gossip_chunk node_id ) { self download_manager send_chunk_to_peer ( gossip_chunk node_id ) } ) ; }
The method handles the given chunk request received from the peer with
the given node ID.
The method handles the given chunk request received from the peer with the given node ID .
&self
gossip_request
GossipChunkRequest
node_id
NodeId
&self
gossip_request
GossipChunkRequest
node_id
NodeId