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 {
68
68
InvalidLocalGeneration ( u32 , u32 ) ,
69
69
#[ error( "invalid local state: {0}" ) ]
70
70
InvalidLocalState ( String ) ,
71
+ #[ error( "invalid remote state: {0}" ) ]
72
+ InvalidRemoteState ( String ) ,
71
73
#[ error( "server returned invalid length of frames: {0}" ) ]
72
74
InvalidPullFrameBytes ( usize ) ,
73
75
}
@@ -614,8 +616,10 @@ impl SyncContext {
614
616
. await
615
617
. map_err ( SyncError :: HttpBody ) ?;
616
618
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
+ }
619
623
Ok ( info)
620
624
}
621
625
You can’t perform that action at this time.
0 commit comments