@@ -363,15 +363,15 @@ impl IoHandler<Message> for Handler {
363
363
const CHECK_BOOTSTRAP_INTERVAL : Duration = Duration :: from_secs ( 15 ) ;
364
364
io. register_timer_once ( CONNECT_TO_BOOTSTRAP , CHECK_BOOTSTRAP_INTERVAL ) ;
365
365
}
366
- FIRST_WAIT_SYNC ... LAST_WAIT_SYNC => {
366
+ FIRST_WAIT_SYNC ..= LAST_WAIT_SYNC => {
367
367
cwarn ! ( NETWORK , "No sync message from {}" , timer) ;
368
368
io. deregister_stream ( wait_sync_stream ( timer) ) ;
369
369
}
370
- FIRST_WAIT_ACK ... LAST_WAIT_ACK => {
370
+ FIRST_WAIT_ACK ..= LAST_WAIT_ACK => {
371
371
cwarn ! ( NETWORK , "No ack message from {}" , timer) ;
372
372
io. deregister_stream ( wait_ack_stream ( timer) ) ;
373
373
}
374
- FIRST_TRY_SYNC ... LAST_TRY_SYNC => {
374
+ FIRST_TRY_SYNC ..= LAST_TRY_SYNC => {
375
375
let stream = retry_sync_stream ( timer) ;
376
376
let mut outgoing_connections = self . outgoing_connections . write ( ) ;
377
377
if let Some ( con) = outgoing_connections. get_mut ( & stream) {
@@ -430,7 +430,7 @@ impl IoHandler<Message> for Handler {
430
430
let stream =
431
431
* self . remote_node_ids_reverse . read ( ) . get ( & node_id) . ok_or_else ( || Error :: InvalidNode ( node_id) ) ?;
432
432
let ( network_message_size, peer_addr) = match stream {
433
- FIRST_OUTBOUND ... LAST_OUTBOUND => {
433
+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
434
434
let mut outbound_connections = self . outbound_connections . write ( ) ;
435
435
if let Some ( con) = outbound_connections. get_mut ( & stream) {
436
436
let _f = finally ( || {
@@ -445,7 +445,7 @@ impl IoHandler<Message> for Handler {
445
445
return Err ( format ! ( "{} is an invalid stream" , stream) . into ( ) )
446
446
}
447
447
}
448
- FIRST_INBOUND ... LAST_INBOUND => {
448
+ FIRST_INBOUND ..= LAST_INBOUND => {
449
449
let mut inbound_connections = self . inbound_connections . write ( ) ;
450
450
if let Some ( con) = inbound_connections. get_mut ( & stream) {
451
451
let _f = finally ( || {
@@ -577,19 +577,19 @@ impl IoHandler<Message> for Handler {
577
577
578
578
fn stream_hup ( & self , io : & IoContext < Message > , stream : StreamToken ) -> IoHandlerResult < ( ) > {
579
579
match stream {
580
- FIRST_INBOUND ... LAST_INBOUND => {
580
+ FIRST_INBOUND ..= LAST_INBOUND => {
581
581
cinfo ! ( NETWORK , "Hang-up inbound stream({})" , stream) ;
582
582
io. deregister_stream ( stream) ;
583
583
}
584
- FIRST_OUTBOUND ... LAST_OUTBOUND => {
584
+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
585
585
cinfo ! ( NETWORK , "Hang-up outbound stream({})" , stream) ;
586
586
io. deregister_stream ( stream) ;
587
587
}
588
- FIRST_INCOMING ... LAST_INCOMING => {
588
+ FIRST_INCOMING ..= LAST_INCOMING => {
589
589
cinfo ! ( NETWORK , "Hang-up incoming stream({})" , stream) ;
590
590
io. deregister_stream ( stream) ;
591
591
}
592
- FIRST_OUTGOING ... LAST_OUTGOING => {
592
+ FIRST_OUTGOING ..= LAST_OUTGOING => {
593
593
cinfo ! ( NETWORK , "Hang-up outgoing stream({})" , stream) ;
594
594
io. deregister_stream ( stream) ;
595
595
}
@@ -647,7 +647,7 @@ impl IoHandler<Message> for Handler {
647
647
io. register_timer_once ( wait_sync_timer ( token) , WAIT_SYNC ) ;
648
648
}
649
649
}
650
- FIRST_INBOUND ... LAST_INBOUND => {
650
+ FIRST_INBOUND ..= LAST_INBOUND => {
651
651
let mut inbound_connections = self . inbound_connections . write ( ) ;
652
652
if let Some ( con) = inbound_connections. get_mut ( & stream_token) {
653
653
let should_update = AtomicBool :: new ( true ) ;
@@ -716,7 +716,7 @@ impl IoHandler<Message> for Handler {
716
716
cdebug ! ( NETWORK , "Invalid inbound token({}) on read" , stream_token) ;
717
717
}
718
718
}
719
- FIRST_OUTBOUND ... LAST_OUTBOUND => {
719
+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
720
720
let mut outbound_connections = self . outbound_connections . write ( ) ;
721
721
if let Some ( con) = outbound_connections. get_mut ( & stream_token) {
722
722
let should_update = AtomicBool :: new ( true ) ;
@@ -761,7 +761,7 @@ impl IoHandler<Message> for Handler {
761
761
cdebug ! ( NETWORK , "Invalid outbound token({}) on read" , stream_token) ;
762
762
}
763
763
}
764
- FIRST_INCOMING ... LAST_INCOMING => {
764
+ FIRST_INCOMING ..= LAST_INCOMING => {
765
765
let mut incoming_connections = self . incoming_connections . write ( ) ;
766
766
if let Some ( con) = incoming_connections. get_mut ( & stream_token) {
767
767
let should_update = AtomicBool :: new ( true ) ;
@@ -855,7 +855,7 @@ impl IoHandler<Message> for Handler {
855
855
cdebug ! ( NETWORK , "Invalid incoming token({}) on read" , stream_token) ;
856
856
}
857
857
}
858
- FIRST_OUTGOING ... LAST_OUTGOING => {
858
+ FIRST_OUTGOING ..= LAST_OUTGOING => {
859
859
let mut outgoing_connections = self . outgoing_connections . write ( ) ;
860
860
if let Some ( con) = outgoing_connections. get_mut ( & stream_token) {
861
861
let should_update = AtomicBool :: new ( true ) ;
@@ -904,28 +904,28 @@ impl IoHandler<Message> for Handler {
904
904
905
905
fn stream_writable ( & self , _io : & IoContext < Message > , stream : StreamToken ) -> IoHandlerResult < ( ) > {
906
906
match stream {
907
- FIRST_INBOUND ... LAST_INBOUND => {
907
+ FIRST_INBOUND ..= LAST_INBOUND => {
908
908
if let Some ( con) = self . inbound_connections . write ( ) . get_mut ( & stream) {
909
909
con. flush ( ) ?;
910
910
} else {
911
911
cdebug ! ( NETWORK , "Invalid inbound token({}) on write" , stream) ;
912
912
}
913
913
}
914
- FIRST_OUTBOUND ... LAST_OUTBOUND => {
914
+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
915
915
if let Some ( con) = self . outbound_connections . write ( ) . get_mut ( & stream) {
916
916
con. flush ( ) ?;
917
917
} else {
918
918
cdebug ! ( NETWORK , "Invalid outbound token({}) on write" , stream) ;
919
919
}
920
920
}
921
- FIRST_INCOMING ... LAST_INCOMING => {
921
+ FIRST_INCOMING ..= LAST_INCOMING => {
922
922
if let Some ( con) = self . incoming_connections . write ( ) . get_mut ( & stream) {
923
923
con. flush ( ) ?;
924
924
} else {
925
925
cdebug ! ( NETWORK , "Invalid incoming token({}) on write" , stream) ;
926
926
}
927
927
}
928
- FIRST_OUTGOING ... LAST_OUTGOING => {
928
+ FIRST_OUTGOING ..= LAST_OUTGOING => {
929
929
if let Some ( con) = self . outgoing_connections . write ( ) . get_mut ( & stream) {
930
930
con. flush ( ) ?;
931
931
} else {
@@ -948,31 +948,31 @@ impl IoHandler<Message> for Handler {
948
948
event_loop. register ( & self . listener , reg, Ready :: readable ( ) , PollOpt :: edge ( ) ) ?;
949
949
ctrace ! ( NETWORK , "TCP connection starts for {}" , self . socket_address) ;
950
950
}
951
- FIRST_INBOUND ... LAST_INBOUND => {
951
+ FIRST_INBOUND ..= LAST_INBOUND => {
952
952
if let Some ( con) = self . inbound_connections . read ( ) . get ( & stream) {
953
953
con. register ( reg, event_loop) ?;
954
954
ctrace ! ( NETWORK , "Inbound connect({}) registered" , stream) ;
955
955
} else {
956
956
cdebug ! ( NETWORK , "Invalid inbound token({}) on register" , stream) ;
957
957
}
958
958
}
959
- FIRST_OUTBOUND ... LAST_OUTBOUND => {
959
+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
960
960
if let Some ( con) = self . outbound_connections . read ( ) . get ( & stream) {
961
961
con. register ( reg, event_loop) ?;
962
962
ctrace ! ( NETWORK , "Outbound connect({}) registered" , stream) ;
963
963
} else {
964
964
cdebug ! ( NETWORK , "Invalid outbound token({}) on register" , stream) ;
965
965
}
966
966
}
967
- FIRST_INCOMING ... LAST_INCOMING => {
967
+ FIRST_INCOMING ..= LAST_INCOMING => {
968
968
if let Some ( con) = self . incoming_connections . read ( ) . get ( & stream) {
969
969
con. register ( reg, event_loop) ?;
970
970
ctrace ! ( NETWORK , "Incoming connect({}) registered" , stream) ;
971
971
} else {
972
972
cdebug ! ( NETWORK , "Invalid incoming token({}) on register" , stream) ;
973
973
}
974
974
}
975
- FIRST_OUTGOING ... LAST_OUTGOING => {
975
+ FIRST_OUTGOING ..= LAST_OUTGOING => {
976
976
if let Some ( con) = self . outgoing_connections . read ( ) . get ( & stream) {
977
977
con. register ( reg, event_loop) ?;
978
978
ctrace ! ( NETWORK , "Outgoing connect({}) registered" , stream) ;
@@ -1000,31 +1000,31 @@ impl IoHandler<Message> for Handler {
1000
1000
ACCEPT => {
1001
1001
event_loop. reregister ( & self . listener , reg, Ready :: readable ( ) , PollOpt :: edge ( ) ) ?;
1002
1002
}
1003
- FIRST_INBOUND ... LAST_INBOUND => {
1003
+ FIRST_INBOUND ..= LAST_INBOUND => {
1004
1004
if let Some ( con) = self . inbound_connections . read ( ) . get ( & stream) {
1005
1005
con. reregister ( reg, event_loop) ?;
1006
1006
ctrace ! ( NETWORK , "Inbound connect({}) updated" , stream) ;
1007
1007
} else {
1008
1008
cdebug ! ( NETWORK , "Invalid inbound token({}) on update" , stream) ;
1009
1009
}
1010
1010
}
1011
- FIRST_OUTBOUND ... LAST_OUTBOUND => {
1011
+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
1012
1012
if let Some ( con) = self . outbound_connections . read ( ) . get ( & stream) {
1013
1013
con. reregister ( reg, event_loop) ?;
1014
1014
ctrace ! ( NETWORK , "Outbound connect({}) updated" , stream) ;
1015
1015
} else {
1016
1016
cdebug ! ( NETWORK , "Invalid outbound token({}) on update" , stream) ;
1017
1017
}
1018
1018
}
1019
- FIRST_INCOMING ... LAST_INCOMING => {
1019
+ FIRST_INCOMING ..= LAST_INCOMING => {
1020
1020
if let Some ( con) = self . incoming_connections . read ( ) . get ( & stream) {
1021
1021
con. reregister ( reg, event_loop) ?;
1022
1022
ctrace ! ( NETWORK , "Incoming connect({}) updated" , stream) ;
1023
1023
} else {
1024
1024
cdebug ! ( NETWORK , "Invalid incoming token({}) on update" , stream) ;
1025
1025
}
1026
1026
}
1027
- FIRST_OUTGOING ... LAST_OUTGOING => {
1027
+ FIRST_OUTGOING ..= LAST_OUTGOING => {
1028
1028
if let Some ( con) = self . outgoing_connections . read ( ) . get ( & stream) {
1029
1029
con. reregister ( reg, event_loop) ?;
1030
1030
ctrace ! ( NETWORK , "Outgoing connect({}) updated" , stream) ;
@@ -1044,7 +1044,7 @@ impl IoHandler<Message> for Handler {
1044
1044
) -> IoHandlerResult < ( ) > {
1045
1045
self . channel . send ( Message :: StartConnect ) ?;
1046
1046
match stream {
1047
- FIRST_INBOUND ... LAST_INBOUND => {
1047
+ FIRST_INBOUND ..= LAST_INBOUND => {
1048
1048
let mut inbound_connections = self . inbound_connections . write ( ) ;
1049
1049
if let Some ( con) = inbound_connections. remove ( & stream) {
1050
1050
if let Some ( node_id) = self . remote_node_ids . write ( ) . remove ( & stream) {
@@ -1061,7 +1061,7 @@ impl IoHandler<Message> for Handler {
1061
1061
cdebug ! ( NETWORK , "Invalid inbound token({}) on deregister" , stream) ;
1062
1062
}
1063
1063
}
1064
- FIRST_OUTBOUND ... LAST_OUTBOUND => {
1064
+ FIRST_OUTBOUND ..= LAST_OUTBOUND => {
1065
1065
let mut outbound_connections = self . outbound_connections . write ( ) ;
1066
1066
if let Some ( con) = outbound_connections. remove ( & stream) {
1067
1067
if let Some ( node_id) = self . remote_node_ids . write ( ) . remove ( & stream) {
@@ -1078,7 +1078,7 @@ impl IoHandler<Message> for Handler {
1078
1078
cdebug ! ( NETWORK , "Invalid outbound token({}) on deregister" , stream) ;
1079
1079
}
1080
1080
}
1081
- FIRST_INCOMING ... LAST_INCOMING => {
1081
+ FIRST_INCOMING ..= LAST_INCOMING => {
1082
1082
let mut incoming_connections = self . incoming_connections . write ( ) ;
1083
1083
if let Some ( con) = incoming_connections. remove ( & stream) {
1084
1084
con. deregister ( event_loop) ?;
@@ -1107,7 +1107,7 @@ impl IoHandler<Message> for Handler {
1107
1107
cdebug ! ( NETWORK , "Invalid incoming token({}) on deregister" , stream) ;
1108
1108
}
1109
1109
}
1110
- FIRST_OUTGOING ... LAST_OUTGOING => {
1110
+ FIRST_OUTGOING ..= LAST_OUTGOING => {
1111
1111
let mut outgoing_connections = self . outgoing_connections . write ( ) ;
1112
1112
if let Some ( con) = outgoing_connections. remove ( & stream) {
1113
1113
con. deregister ( event_loop) ?;
0 commit comments