File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -588,19 +588,29 @@ def initiate_upgrade_connection(self, settings_header=None):
588
588
"""
589
589
frame_data = None
590
590
591
+ # Begin by getting the preamble in place.
592
+ self .initiate_connection ()
593
+
591
594
if self .config .client_side :
592
595
f = SettingsFrame (0 )
593
596
for setting , value in self .local_settings .items ():
594
597
f .settings [setting ] = value
595
598
596
599
frame_data = f .serialize_body ()
597
600
frame_data = base64 .urlsafe_b64encode (frame_data )
601
+ elif settings_header :
602
+ # We have a settings header from the client. This needs to be
603
+ # applied, but we want to throw away the ACK. We do this by
604
+ # inserting the data into a Settings frame and then passing it to
605
+ # the state machine, but ignoring the return value.
606
+ settings_header = base64 .urlsafe_b64decode (settings_header )
607
+ f = SettingsFrame (0 )
608
+ f .parse_body (settings_header )
609
+ self ._receive_settings_frame (f )
598
610
599
611
# Set up appropriate state. Stream 1 in a half-closed state:
600
612
# half-closed(local) for clients, half-closed(remote) for servers.
601
613
# Additionally, we need to set up the Connection state machine.
602
- self .initiate_connection ()
603
-
604
614
connection_input = (
605
615
ConnectionInputs .SEND_HEADERS if self .config .client_side
606
616
else ConnectionInputs .RECV_HEADERS
You can’t perform that action at this time.
0 commit comments