@@ -19,20 +19,20 @@ use crucible_common::{
19
19
verbose_timeout, Block , CrucibleError , RegionDefinition , MAX_BLOCK_SIZE ,
20
20
} ;
21
21
use crucible_protocol:: {
22
- BlockContext , CrucibleDecoder , CrucibleEncoder , JobId , Message ,
23
- ReadRequest , ReconciliationId , SnapshotDetails , CRUCIBLE_MESSAGE_VERSION ,
22
+ BlockContext , CrucibleDecoder , JobId , Message , MessageWriter , ReadRequest ,
23
+ ReconciliationId , SnapshotDetails , CRUCIBLE_MESSAGE_VERSION ,
24
24
} ;
25
25
use repair_client:: Client ;
26
26
27
27
use anyhow:: { bail, Result } ;
28
28
use bytes:: BytesMut ;
29
- use futures:: { SinkExt , StreamExt } ;
29
+ use futures:: StreamExt ;
30
30
use rand:: prelude:: * ;
31
31
use slog:: { debug, error, info, o, warn, Logger } ;
32
32
use tokio:: net:: TcpListener ;
33
33
use tokio:: sync:: { mpsc, oneshot} ;
34
34
use tokio:: time:: { sleep_until, Instant } ;
35
- use tokio_util:: codec:: { FramedRead , FramedWrite } ;
35
+ use tokio_util:: codec:: FramedRead ;
36
36
use uuid:: Uuid ;
37
37
38
38
pub mod admin;
@@ -594,15 +594,15 @@ async fn proc_stream(
594
594
let ( read, write) = sock. into_split ( ) ;
595
595
596
596
let fr = FramedRead :: new ( read, CrucibleDecoder :: new ( ) ) ;
597
- let fw = FramedWrite :: new ( write, CrucibleEncoder :: new ( ) ) ;
597
+ let fw = MessageWriter :: new ( write) ;
598
598
599
599
proc ( ads, fr, fw) . await
600
600
}
601
601
WrappedStream :: Https ( stream) => {
602
602
let ( read, write) = tokio:: io:: split ( stream) ;
603
603
604
604
let fr = FramedRead :: new ( read, CrucibleDecoder :: new ( ) ) ;
605
- let fw = FramedWrite :: new ( write, CrucibleEncoder :: new ( ) ) ;
605
+ let fw = MessageWriter :: new ( write) ;
606
606
607
607
proc ( ads, fr, fw) . await
608
608
}
@@ -626,7 +626,7 @@ pub struct UpstairsConnection {
626
626
async fn proc < RT , WT > (
627
627
ads : & Arc < Mutex < Downstairs > > ,
628
628
mut fr : FramedRead < RT , CrucibleDecoder > ,
629
- mut fw : FramedWrite < WT , CrucibleEncoder > ,
629
+ mut fw : MessageWriter < WT > ,
630
630
) -> Result < ( ) >
631
631
where
632
632
RT : tokio:: io:: AsyncRead + std:: marker:: Unpin + std:: marker:: Send ,
@@ -1074,7 +1074,7 @@ where
1074
1074
1075
1075
async fn reply_task < WT > (
1076
1076
mut resp_channel_rx : mpsc:: UnboundedReceiver < Message > ,
1077
- mut fw : FramedWrite < WT , CrucibleEncoder > ,
1077
+ mut fw : MessageWriter < WT > ,
1078
1078
) -> Result < ( ) >
1079
1079
where
1080
1080
WT : tokio:: io:: AsyncWrite
@@ -1096,7 +1096,7 @@ where
1096
1096
async fn resp_loop < RT , WT > (
1097
1097
ads : & Arc < Mutex < Downstairs > > ,
1098
1098
mut fr : FramedRead < RT , CrucibleDecoder > ,
1099
- fw : FramedWrite < WT , CrucibleEncoder > ,
1099
+ fw : MessageWriter < WT > ,
1100
1100
mut another_upstairs_active_rx : oneshot:: Receiver < UpstairsConnection > ,
1101
1101
upstairs_connection : UpstairsConnection ,
1102
1102
) -> Result < ( ) >
@@ -1120,7 +1120,7 @@ where
1120
1120
* Create tasks for:
1121
1121
* Doing the work then sending the ACK
1122
1122
* Pulling work off the socket and putting on the work queue.
1123
- * Sending messages back on the FramedWrite
1123
+ * Sending messages back on the MessageWriter
1124
1124
*
1125
1125
* These tasks and this function must be able to handle the
1126
1126
* Upstairs connection going away at any time, as well as a forced
@@ -6174,7 +6174,7 @@ mod test {
6174
6174
let tcp = start_ds_and_connect ( 5555 , 5556 ) . await . unwrap ( ) ;
6175
6175
let ( read, write) = tcp. into_split ( ) ;
6176
6176
let mut fr = FramedRead :: new ( read, CrucibleDecoder :: new ( ) ) ;
6177
- let mut fw = FramedWrite :: new ( write, CrucibleEncoder :: new ( ) ) ;
6177
+ let mut fw = MessageWriter :: new ( write) ;
6178
6178
6179
6179
// Our downstairs version is CRUCIBLE_MESSAGE_VERSION
6180
6180
let m = Message :: HereIAm {
@@ -6212,7 +6212,7 @@ mod test {
6212
6212
let tcp = start_ds_and_connect ( 5557 , 5558 ) . await . unwrap ( ) ;
6213
6213
let ( read, write) = tcp. into_split ( ) ;
6214
6214
let mut fr = FramedRead :: new ( read, CrucibleDecoder :: new ( ) ) ;
6215
- let mut fw = FramedWrite :: new ( write, CrucibleEncoder :: new ( ) ) ;
6215
+ let mut fw = MessageWriter :: new ( write) ;
6216
6216
6217
6217
// Our downstairs version is CRUCIBLE_MESSAGE_VERSION
6218
6218
let m = Message :: HereIAm {
@@ -6246,7 +6246,7 @@ mod test {
6246
6246
let tcp = start_ds_and_connect ( 5579 , 5560 ) . await . unwrap ( ) ;
6247
6247
let ( read, write) = tcp. into_split ( ) ;
6248
6248
let mut fr = FramedRead :: new ( read, CrucibleDecoder :: new ( ) ) ;
6249
- let mut fw = FramedWrite :: new ( write, CrucibleEncoder :: new ( ) ) ;
6249
+ let mut fw = MessageWriter :: new ( write) ;
6250
6250
6251
6251
// Our downstairs version is CRUCIBLE_MESSAGE_VERSION
6252
6252
let m = Message :: HereIAm {
@@ -6280,7 +6280,7 @@ mod test {
6280
6280
let tcp = start_ds_and_connect ( 5561 , 5562 ) . await . unwrap ( ) ;
6281
6281
let ( read, write) = tcp. into_split ( ) ;
6282
6282
let mut fr = FramedRead :: new ( read, CrucibleDecoder :: new ( ) ) ;
6283
- let mut fw = FramedWrite :: new ( write, CrucibleEncoder :: new ( ) ) ;
6283
+ let mut fw = MessageWriter :: new ( write) ;
6284
6284
6285
6285
// Our downstairs version is CRUCIBLE_MESSAGE_VERSION
6286
6286
let m = Message :: HereIAm {
@@ -6321,7 +6321,7 @@ mod test {
6321
6321
let tcp = start_ds_and_connect ( 5563 , 5564 ) . await . unwrap ( ) ;
6322
6322
let ( read, write) = tcp. into_split ( ) ;
6323
6323
let mut fr = FramedRead :: new ( read, CrucibleDecoder :: new ( ) ) ;
6324
- let mut fw = FramedWrite :: new ( write, CrucibleEncoder :: new ( ) ) ;
6324
+ let mut fw = MessageWriter :: new ( write) ;
6325
6325
6326
6326
// Our downstairs version is CRUCIBLE_MESSAGE_VERSION
6327
6327
let m = Message :: HereIAm {
0 commit comments