Send initial HTTP/2 settings to client. Should be called after the SSL handshake completes and before processing any data.
(self)
| 99 | self._initialized = False |
| 100 | |
| 101 | def initiate_connection(self): |
| 102 | """Send initial HTTP/2 settings to client. |
| 103 | |
| 104 | Should be called after the SSL handshake completes and |
| 105 | before processing any data. |
| 106 | """ |
| 107 | if self._initialized: |
| 108 | return |
| 109 | |
| 110 | # Update local settings before initiating |
| 111 | self.h2_conn.update_settings({ |
| 112 | _h2_settings.SettingCodes.MAX_CONCURRENT_STREAMS: self.max_concurrent_streams, |
| 113 | _h2_settings.SettingCodes.INITIAL_WINDOW_SIZE: self.initial_window_size, |
| 114 | _h2_settings.SettingCodes.MAX_FRAME_SIZE: self.max_frame_size, |
| 115 | _h2_settings.SettingCodes.MAX_HEADER_LIST_SIZE: self.max_header_list_size, |
| 116 | }) |
| 117 | |
| 118 | self.h2_conn.initiate_connection() |
| 119 | self._send_pending_data() |
| 120 | self._initialized = True |
| 121 | |
| 122 | def receive_data(self, data=None): |
| 123 | """Process received data and return completed requests. |