aboutsummaryrefslogtreecommitdiff
path: root/src/proto.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-10 22:01:48 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-10 22:01:48 +0200
commit3477864142ed09c36abea1111937b829fb41c8a4 (patch)
treed95221e66b9c014af7f4dba61ae4ff113c0e409a /src/proto.rs
parentd66c0d6833ddbeb61e34ee222dde92a5363bda1f (diff)
downloadgarage-3477864142ed09c36abea1111937b829fb41c8a4.tar.gz
garage-3477864142ed09c36abea1111937b829fb41c8a4.zip
Fix the Sync issue. Details:
So the HTTP client future of Hyper is not Sync, thus the stream that read blocks wasn't either. However Hyper's default Body type requires a stream to be Sync for wrap_stream. Solution: reimplement a custom HTTP body type.
Diffstat (limited to 'src/proto.rs')
-rw-r--r--src/proto.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/proto.rs b/src/proto.rs
index df64a438..b39f49ed 100644
--- a/src/proto.rs
+++ b/src/proto.rs
@@ -1,6 +1,6 @@
-use std::time::Duration;
+use serde::{Deserialize, Serialize};
use std::net::SocketAddr;
-use serde::{Serialize, Deserialize};
+use std::time::Duration;
use crate::data::*;
@@ -11,7 +11,7 @@ pub enum Message {
Ok,
Error(String),
- Ping(PingMessage),
+ Ping(PingMessage),
PullStatus,
PullConfig,
AdvertiseNodesUp(Vec<AdvertisedNode>),
@@ -42,6 +42,6 @@ pub struct AdvertisedNode {
pub struct PutBlockMessage {
pub hash: Hash,
- #[serde(with="serde_bytes")]
+ #[serde(with = "serde_bytes")]
pub data: Vec<u8>,
}