Add a generic Ack message, use it instead of Pong

Remove the `id` field from `Ping`, because it isn't used.
There is already an id on the message envelope.
This commit is contained in:
Max Brunsfeld
2021-09-09 11:24:16 -07:00
parent 000305472a
commit 38bfaba135
5 changed files with 17 additions and 40 deletions
+1 -8
View File
@@ -246,14 +246,7 @@ impl Server {
}
async fn ping(self: Arc<Server>, request: TypedEnvelope<proto::Ping>) -> tide::Result<()> {
self.peer
.respond(
request.receipt(),
proto::Pong {
id: request.payload.id,
},
)
.await?;
self.peer.respond(request.receipt(), proto::Ack {}).await?;
Ok(())
}