Merge branch 'develop' of github.com:nymtech/nym into develop

This commit is contained in:
Jedrzej Stuczynski
2020-03-09 12:05:28 +00:00
3 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -49,10 +49,10 @@ async fn process_socket_connection(
}
Ok(n) => {
if n != sphinx::PACKET_SIZE {
warn!("read data of different length than expected sphinx packet size - {} (expected {})", n, sphinx::PACKET_SIZE);
error!("read data of different length than expected sphinx packet size - {} (expected {})", n, sphinx::PACKET_SIZE);
continue;
}
warn!("About to process packet. If you see this, we made it past the Sphinx size error");
// we must be able to handle multiple packets from same connection independently
tokio::spawn(process_received_packet(
buf,
@@ -64,7 +64,7 @@ async fn process_socket_connection(
))
}
Err(e) => {
warn!(
error!(
"failed to read from socket. Closing the connection; err = {:?}",
e
);
+2 -1
View File
@@ -91,6 +91,7 @@ impl PacketProcessor {
match packet.process(self.secret_key.deref().inner()) {
Ok(ProcessedPacket::ProcessedPacketForwardHop(packet, address, delay)) => {
warn!("Returning a process packet. We're good.");
self.process_forward_hop(packet, address, delay).await
}
Ok(ProcessedPacket::ProcessedPacketFinalHop(_, _, _)) => {
@@ -98,7 +99,7 @@ impl PacketProcessor {
Err(MixProcessingError::ReceivedFinalHopError)
}
Err(e) => {
warn!("Failed to unwrap Sphinx packet: {:?}", e);
error!("Failed to unwrap Sphinx packet: {:?}", e);
Err(MixProcessingError::SphinxProcessingError)
}
}
@@ -88,11 +88,12 @@ impl PacketProcessor {
Err(MixProcessingError::ReceivedForwardHopError)
}
Ok(ProcessedPacket::ProcessedPacketFinalHop(client_address, surb_id, payload)) => {
warn!("About to process final hop. If you see this we made it past the Failed to unwrap error");
self.process_final_hop(client_address, surb_id, payload)
.await
}
Err(e) => {
warn!("Failed to unwrap Sphinx packet: {:?}", e);
error!("Failed to unwrap Sphinx packet: {:?}", e);
Err(MixProcessingError::SphinxProcessingError)
}
}