@@ -102,7 +102,7 @@ impl Session {
102
102
103
103
configured_connection_timeout : connection_timeout,
104
104
105
- last_zxid : 0 ,
105
+ last_zxid : session . last_zxid ,
106
106
last_recv : now,
107
107
last_send : now,
108
108
last_ping : None ,
@@ -286,15 +286,15 @@ impl Session {
286
286
}
287
287
288
288
fn handle_reply ( & mut self , header : ReplyHeader , body : & [ u8 ] , depot : & mut Depot ) -> Result < ( ) , Error > {
289
- if header. err == ErrorCode :: SessionExpired . into ( ) {
289
+ if header. err == ErrorCode :: SessionExpired as i32 {
290
290
return Err ( Error :: SessionExpired ) ;
291
- } else if header. err == ErrorCode :: AuthFailed . into ( ) {
291
+ } else if header. err == ErrorCode :: AuthFailed as i32 {
292
292
return Err ( Error :: AuthFailed ) ;
293
293
}
294
- if header. xid == PredefinedXid :: Notification . into ( ) {
294
+ if header. xid == PredefinedXid :: Notification as i32 {
295
295
self . handle_notification ( header. zxid , body, depot) ?;
296
296
return Ok ( ( ) ) ;
297
- } else if header. xid == PredefinedXid :: Ping . into ( ) {
297
+ } else if header. xid == PredefinedXid :: Ping as i32 {
298
298
depot. pop_ping ( ) ?;
299
299
if let Some ( last_ping) = self . last_ping . take ( ) {
300
300
let elapsed = Instant :: now ( ) - last_ping;
@@ -514,7 +514,7 @@ impl Session {
514
514
fn send_connect ( & self , depot : & mut Depot ) {
515
515
let request = ConnectRequest {
516
516
protocol_version : 0 ,
517
- last_zxid_seen : 0 ,
517
+ last_zxid_seen : self . last_zxid ,
518
518
timeout : self . session_timeout . as_millis ( ) as i32 ,
519
519
session_id : if self . session . readonly { 0 } else { self . session . id . 0 } ,
520
520
password : self . session . password . as_slice ( ) ,
0 commit comments