Skip to content

Commit 24fc0bb

Browse files
committed
handle error and fix typo
1 parent f911da0 commit 24fc0bb

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/h2spacex/h2_connection.py

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ def send_bytes(self, bytes_data: bytes):
104104
:param bytes_data: bytes data for sending into socket
105105
:return:
106106
"""
107+
if self.is_connection_closed:
108+
return
107109
using_socket = self.get_using_socket()
108110
try:
109111
using_socket.send(bytes_data)

src/h2spacex/h2_frames.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self, h2_connection=None, is_gzipped=False):
5555
self.h2_connection = h2_connection
5656
self.headers_table = h2.HPackHdrTable()
5757

58-
def show_response_of_sent_of_sent_requests(self):
58+
def show_response_of_sent_requests(self):
5959
for s_id in self.headers_and_data_frames.keys():
6060
headers = self.headers_and_data_frames[s_id]['header']
6161
print(f'#- Stream ID: {s_id} -#')

src/h2spacex/h2_tls_connection.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def setup_connection(self):
1919
self._send_client_initial_settings_frame() # send client initial settings frame to server
2020
except Exception as e:
2121
print('# Error in setting the connection up : ' + str(e))
22+
exit(1)
2223

2324
else:
2425
self.is_connection_closed = False

0 commit comments

Comments
 (0)