File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ pub enum SyncError {
6868 InvalidLocalGeneration ( u32 , u32 ) ,
6969 #[ error( "invalid local state: {0}" ) ]
7070 InvalidLocalState ( String ) ,
71+ #[ error( "invalid remote state: {0}" ) ]
72+ InvalidRemoteState ( String ) ,
7173 #[ error( "server returned invalid length of frames: {0}" ) ]
7274 InvalidPullFrameBytes ( usize ) ,
7375}
@@ -614,8 +616,10 @@ impl SyncContext {
614616 . await
615617 . map_err ( SyncError :: HttpBody ) ?;
616618
617- let info = serde_json:: from_slice ( & body) . map_err ( SyncError :: JsonDecode ) ?;
618-
619+ let info: InfoResult = serde_json:: from_slice ( & body) . map_err ( SyncError :: JsonDecode ) ?;
620+ if info. current_generation == 0 {
621+ return Err ( SyncError :: InvalidRemoteState ( "generation is 0" . to_string ( ) ) . into ( ) ) ;
622+ }
619623 Ok ( info)
620624 }
621625
You can’t perform that action at this time.
0 commit comments