@@ -184,6 +184,39 @@ impl<'a, N: 'a + Notifier> super::ServerWithNotifier<'a, N> {
184
184
if let Some ( saved) = saved. state {
185
185
self . inner . state = saved. connection . restore ( ) ?;
186
186
187
+ // Restore server state, and resend server notifications if needed. If these notifications
188
+ // were processed before the save, it's harmless as the values will be the same.
189
+ let request = match self . inner . state {
190
+ super :: ConnectionState :: Connecting {
191
+ info,
192
+ next_action : _,
193
+ } => Some ( super :: ModifyConnectionRequest {
194
+ version : Some ( info. version . version as u32 ) ,
195
+ interrupt_page : info. interrupt_page . into ( ) ,
196
+ monitor_page : info. monitor_page . into ( ) ,
197
+ target_message_vp : Some ( info. target_message_vp ) ,
198
+ notify_relay : true ,
199
+ } ) ,
200
+ super :: ConnectionState :: Connected ( info) => Some ( super :: ModifyConnectionRequest {
201
+ version : None ,
202
+ monitor_page : info. monitor_page . into ( ) ,
203
+ interrupt_page : info. interrupt_page . into ( ) ,
204
+ target_message_vp : Some ( info. target_message_vp ) ,
205
+ // If the save didn't happen while modifying, the relay doesn't need to be notified
206
+ // of this info as it doesn't constitute a change, we're just restoring existing
207
+ // connection state.
208
+ notify_relay : info. modifying ,
209
+ } ) ,
210
+ // No action needed for these states; if disconnecting, check_disconnected will resend
211
+ // the reset request if needed.
212
+ super :: ConnectionState :: Disconnected
213
+ | super :: ConnectionState :: Disconnecting { .. } => None ,
214
+ } ;
215
+
216
+ if let Some ( request) = request {
217
+ self . notifier . modify_connection ( request) ?;
218
+ }
219
+
187
220
for saved_channel in saved. channels {
188
221
self . inner . restore_one_channel ( saved_channel) ?;
189
222
}
@@ -211,42 +244,6 @@ impl<'a, N: 'a + Notifier> super::ServerWithNotifier<'a, N> {
211
244
self . inner . pending_messages . 0 . push_back ( message. restore ( ) ?) ;
212
245
}
213
246
214
- // Restore server state, and resend server notifications if needed. If these notifications
215
- // were processed before the save, it's harmless as the values will be the same.
216
- let request = match self . inner . state {
217
- super :: ConnectionState :: Connecting {
218
- info,
219
- next_action : _,
220
- } => Some ( super :: ModifyConnectionRequest {
221
- version : Some ( info. version . version as u32 ) ,
222
- interrupt_page : info. interrupt_page . into ( ) ,
223
- monitor_page : info. monitor_page . into ( ) ,
224
- target_message_vp : Some ( info. target_message_vp ) ,
225
- notify_relay : true ,
226
- } ) ,
227
- super :: ConnectionState :: Connected ( info) => Some ( super :: ModifyConnectionRequest {
228
- version : None ,
229
- monitor_page : info. monitor_page . into ( ) ,
230
- interrupt_page : info. interrupt_page . into ( ) ,
231
- target_message_vp : Some ( info. target_message_vp ) ,
232
- // If the save didn't happen while modifying, the relay doesn't need to be notified
233
- // of this info as it doesn't constitute a change, we're just restoring existing
234
- // connection state.
235
- notify_relay : info. modifying ,
236
- } ) ,
237
- // No action needed for these states; if disconnecting, check_disconnected will resend
238
- // the reset request if needed.
239
- super :: ConnectionState :: Disconnected | super :: ConnectionState :: Disconnecting { .. } => {
240
- None
241
- }
242
- } ;
243
-
244
- if let Some ( request) = request {
245
- self . notifier . modify_connection ( request) ?;
246
- }
247
-
248
- self . check_disconnected ( ) ;
249
-
250
247
Ok ( ( ) )
251
248
}
252
249
}
0 commit comments