wisp-python 0.4.2__tar.gz → 0.4.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wisp-python
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: An implementation of a Wisp proxy server in Python
5
5
  Author: ading2210
6
6
  Project-URL: Homepage, https://github.com/MercuryWorkshop/wisp-server-python
@@ -11,7 +11,7 @@ package-dir = {"" = "src"}
11
11
 
12
12
  [project]
13
13
  name = "wisp-python"
14
- version = "0.4.2"
14
+ version = "0.4.3"
15
15
  authors = [
16
16
  {name="ading2210"},
17
17
  ]
@@ -1,3 +1,3 @@
1
1
  from wisp import server
2
2
 
3
- version = "0.4.2"
3
+ version = "0.4.3"
@@ -163,7 +163,8 @@ class WispConnection:
163
163
  if not stream_id in self.active_streams:
164
164
  return #stream already closed
165
165
  stream = self.active_streams[stream_id]
166
- stream["conn"].close()
166
+ if stream["conn"]:
167
+ stream["conn"].close()
167
168
 
168
169
  #kill the running tasks associated with this stream
169
170
  if not stream["connect_task"].done():
@@ -181,6 +182,12 @@ class WispConnection:
181
182
  data = await self.ws.recv()
182
183
  except ConnectionClosed:
183
184
  break
185
+ except Exception as e:
186
+ print(f"Receiving data from websocket failed: {e}")
187
+ break
188
+
189
+ if not isinstance(data, bytes):
190
+ continue #ignore non binary frames
184
191
 
185
192
  #implement bandwidth limits
186
193
  await ratelimit.limit_client_bandwidth(self.client_ip, len(data), "ws")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wisp-python
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: An implementation of a Wisp proxy server in Python
5
5
  Author: ading2210
6
6
  Project-URL: Homepage, https://github.com/MercuryWorkshop/wisp-server-python
File without changes
File without changes
File without changes