Skip to content

Commit

Permalink
Log ping events. Investigate "Message over the maximum transmission l…
Browse files Browse the repository at this point in the history
…imit was not sent.".
  • Loading branch information
artemii235 committed Aug 18, 2020
1 parent ba4c257 commit 1f7ad5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion etomic_build/seed/sell_ONE_ANOTHER
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"setprice\",\"base\":\"$1\",\"rel\":\"$2\",\"price\":2}"
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"pass\",\"method\":\"setprice\",\"base\":\"RICK\",\"rel\":\"MORTY\",\"price\":2,\"volume\":1}"
7 changes: 5 additions & 2 deletions mm2src/gossipsub/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,14 @@ impl ProtocolsHandler for GossipsubHandler {
},
Some(OutboundSubstreamState::PendingSend(mut substream, message)) => {
match Sink::poll_ready(Pin::new(&mut substream), cx) {
Poll::Ready(Ok(())) => match Sink::start_send(Pin::new(&mut substream), message) {
Poll::Ready(Ok(())) => match Sink::start_send(Pin::new(&mut substream), message.clone()) {
Ok(()) => self.outbound_substream = Some(OutboundSubstreamState::PendingFlush(substream)),
Err(e) => {
if let io::ErrorKind::PermissionDenied = e.kind() {
error!("Message over the maximum transmission limit was not sent.");
error!(
"Message over the maximum transmission limit was not sent. Message: {:?}",
message
);
self.outbound_substream = Some(OutboundSubstreamState::WaitingOutput(substream));
} else {
return Poll::Ready(ProtocolsHandlerEvent::Close(e));
Expand Down
4 changes: 3 additions & 1 deletion mm2src/mm2_libp2p/src/atomicdex_behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ impl NetworkBehaviourEventProcess<GossipsubEvent> for AtomicDexBehavior {

// TODO: in this impl we might want to save ping statistics and possibly choose the peers to which we have good ping
impl NetworkBehaviourEventProcess<PingEvent> for AtomicDexBehavior {
fn inject_event(&mut self, _event: PingEvent) {}
fn inject_event(&mut self, event: PingEvent) {
println!("Ping event: {:?}", event);
}
}

/// Creates and spawns new AdexBehavior Swarm returning:
Expand Down

0 comments on commit 1f7ad5e

Please sign in to comment.