python-engineio 4.9.1__py3-none-any.whl → 4.10.0__py3-none-any.whl
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.
- engineio/async_client.py +1 -1
- engineio/async_drivers/asgi.py +7 -1
- engineio/async_drivers/eventlet.py +1 -1
- engineio/async_server.py +22 -12
- engineio/client.py +1 -2
- engineio/server.py +20 -14
- {python_engineio-4.9.1.dist-info → python_engineio-4.10.0.dist-info}/METADATA +1 -1
- {python_engineio-4.9.1.dist-info → python_engineio-4.10.0.dist-info}/RECORD +11 -11
- {python_engineio-4.9.1.dist-info → python_engineio-4.10.0.dist-info}/WHEEL +1 -1
- {python_engineio-4.9.1.dist-info → python_engineio-4.10.0.dist-info}/LICENSE +0 -0
- {python_engineio-4.9.1.dist-info → python_engineio-4.10.0.dist-info}/top_level.txt +0 -0
engineio/async_client.py
CHANGED
|
@@ -62,7 +62,7 @@ class AsyncClient(base_client.BaseClient):
|
|
|
62
62
|
:param http_session: an initialized ``aiohttp.ClientSession`` object to be
|
|
63
63
|
used when sending requests to the server. Use it if
|
|
64
64
|
you need to add special client options such as proxy
|
|
65
|
-
servers, SSL certificates, etc.
|
|
65
|
+
servers, SSL certificates, custom CA bundle, etc.
|
|
66
66
|
:param ssl_verify: ``True`` to verify SSL certificates, or ``False`` to
|
|
67
67
|
skip SSL certificate verification, allowing
|
|
68
68
|
connections to servers with self signed certificates.
|
engineio/async_drivers/asgi.py
CHANGED
|
@@ -63,7 +63,8 @@ class ASGIApp:
|
|
|
63
63
|
await self.lifespan(scope, receive, send)
|
|
64
64
|
elif scope['type'] in ['http', 'websocket'] and (
|
|
65
65
|
self.engineio_path is None
|
|
66
|
-
or scope['path'].startswith(
|
|
66
|
+
or self._ensure_trailing_slash(scope['path']).startswith(
|
|
67
|
+
self.engineio_path)):
|
|
67
68
|
await self.engineio_server.handle_request(scope, receive, send)
|
|
68
69
|
else:
|
|
69
70
|
static_file = get_static_file(scope['path'], self.static_files) \
|
|
@@ -127,6 +128,11 @@ class ASGIApp:
|
|
|
127
128
|
await send({'type': 'http.response.body',
|
|
128
129
|
'body': b'Not Found'})
|
|
129
130
|
|
|
131
|
+
def _ensure_trailing_slash(self, path):
|
|
132
|
+
if not path.endswith('/'):
|
|
133
|
+
path += '/'
|
|
134
|
+
return path
|
|
135
|
+
|
|
130
136
|
|
|
131
137
|
async def translate_request(scope, receive, send):
|
|
132
138
|
class AwaitablePayload(object): # pragma: no cover
|
engineio/async_server.py
CHANGED
|
@@ -70,6 +70,10 @@ class AsyncServer(base_server.BaseServer):
|
|
|
70
70
|
:param async_handlers: If set to ``True``, run message event handlers in
|
|
71
71
|
non-blocking threads. To run handlers synchronously,
|
|
72
72
|
set to ``False``. The default is ``True``.
|
|
73
|
+
:param monitor_clients: If set to ``True``, a background task will ensure
|
|
74
|
+
inactive clients are closed. Set to ``False`` to
|
|
75
|
+
disable the monitoring task (not recommended). The
|
|
76
|
+
default is ``True``.
|
|
73
77
|
:param transports: The list of allowed transports. Valid transports
|
|
74
78
|
are ``'polling'`` and ``'websocket'``. Defaults to
|
|
75
79
|
``['polling', 'websocket']``.
|
|
@@ -284,18 +288,24 @@ class AsyncServer(base_server.BaseServer):
|
|
|
284
288
|
r = self._bad_request('Invalid session ' + sid)
|
|
285
289
|
else:
|
|
286
290
|
socket = self._get_socket(sid)
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
291
|
+
if self.transport(sid) != transport:
|
|
292
|
+
self._log_error_once(
|
|
293
|
+
'Invalid transport for session ' + sid,
|
|
294
|
+
'bad-transport')
|
|
295
|
+
r = self._bad_request('Invalid transport')
|
|
296
|
+
else:
|
|
297
|
+
try:
|
|
298
|
+
packets = await socket.handle_get_request(environ)
|
|
299
|
+
if isinstance(packets, list):
|
|
300
|
+
r = self._ok(packets, jsonp_index=jsonp_index)
|
|
301
|
+
else:
|
|
302
|
+
r = packets
|
|
303
|
+
except exceptions.EngineIOError:
|
|
304
|
+
if sid in self.sockets: # pragma: no cover
|
|
305
|
+
await self.disconnect(sid)
|
|
306
|
+
r = self._bad_request()
|
|
307
|
+
if sid in self.sockets and self.sockets[sid].closed:
|
|
308
|
+
del self.sockets[sid]
|
|
299
309
|
elif method == 'POST':
|
|
300
310
|
if sid is None or sid not in self.sockets:
|
|
301
311
|
self._log_error_once('Invalid session ' + sid, 'bad-sid')
|
engineio/client.py
CHANGED
|
@@ -510,8 +510,7 @@ class Client(base_client.BaseClient):
|
|
|
510
510
|
except Exception as e: # pragma: no cover
|
|
511
511
|
if type(e) is OSError and e.errno == 9:
|
|
512
512
|
self.logger.info(
|
|
513
|
-
'WebSocket connection is closing, aborting'
|
|
514
|
-
str(e))
|
|
513
|
+
'WebSocket connection is closing, aborting')
|
|
515
514
|
else:
|
|
516
515
|
self.logger.info(
|
|
517
516
|
'Unexpected error receiving packet: "%s", aborting',
|
engineio/server.py
CHANGED
|
@@ -180,7 +180,7 @@ class Server(base_server.BaseServer):
|
|
|
180
180
|
if sid in self.sockets: # pragma: no cover
|
|
181
181
|
del self.sockets[sid]
|
|
182
182
|
else:
|
|
183
|
-
for client in self.sockets.values():
|
|
183
|
+
for client in self.sockets.copy().values():
|
|
184
184
|
client.close()
|
|
185
185
|
self.sockets = {}
|
|
186
186
|
|
|
@@ -270,19 +270,25 @@ class Server(base_server.BaseServer):
|
|
|
270
270
|
r = self._bad_request('Invalid session')
|
|
271
271
|
else:
|
|
272
272
|
socket = self._get_socket(sid)
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
273
|
+
if self.transport(sid) != transport:
|
|
274
|
+
self._log_error_once(
|
|
275
|
+
'Invalid transport for session ' + sid,
|
|
276
|
+
'bad-transport')
|
|
277
|
+
r = self._bad_request('Invalid transport')
|
|
278
|
+
else:
|
|
279
|
+
try:
|
|
280
|
+
packets = socket.handle_get_request(
|
|
281
|
+
environ, start_response)
|
|
282
|
+
if isinstance(packets, list):
|
|
283
|
+
r = self._ok(packets, jsonp_index=jsonp_index)
|
|
284
|
+
else:
|
|
285
|
+
r = packets
|
|
286
|
+
except exceptions.EngineIOError:
|
|
287
|
+
if sid in self.sockets: # pragma: no cover
|
|
288
|
+
self.disconnect(sid)
|
|
289
|
+
r = self._bad_request()
|
|
290
|
+
if sid in self.sockets and self.sockets[sid].closed:
|
|
291
|
+
del self.sockets[sid]
|
|
286
292
|
elif method == 'POST':
|
|
287
293
|
if sid is None or sid not in self.sockets:
|
|
288
294
|
self._log_error_once(
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
engineio/__init__.py,sha256=0R2PY1EXu3sicP7mkA0_QxEVGRlFlgvsxfhByqREE1A,481
|
|
2
|
-
engineio/async_client.py,sha256=
|
|
3
|
-
engineio/async_server.py,sha256=
|
|
2
|
+
engineio/async_client.py,sha256=jC7T6r_ya9LV46q4OdIQ041-3uLlRr6aUt__YmHNPEM,27950
|
|
3
|
+
engineio/async_server.py,sha256=q29JCvIpCriUXZoqHwjJUwV2bK2MRypMQptROGw6imI,25738
|
|
4
4
|
engineio/async_socket.py,sha256=P8OZW1N5y7jr2hW1qLLK2y_Clt7aHdv2ucYW69mbU4Q,10305
|
|
5
5
|
engineio/base_client.py,sha256=Q_w0Stvy89wPHwWk7411dRxpGjxNPypm4xy_4XMPZ9M,4872
|
|
6
6
|
engineio/base_server.py,sha256=Em2RRpbohulKjmYTWHnf_lALKvTT_jHr442Rr2g_BEQ,14013
|
|
7
7
|
engineio/base_socket.py,sha256=Bw6TWv1pnlXcDdqT59C5CyTaBi7l-_mkykIUuZLjz-g,400
|
|
8
|
-
engineio/client.py,sha256=
|
|
8
|
+
engineio/client.py,sha256=m_eLSes3b-mE5MYajELquSktkAWceCNGZOtUU78as50,26285
|
|
9
9
|
engineio/exceptions.py,sha256=FyuMb5qhX9CUYP3fEoe1m-faU96ApdQTSbblaaoo8LA,292
|
|
10
10
|
engineio/json.py,sha256=SG5FTojqd1ix6u0dKXJsZVqqdYioZLO4S2GPL7BKl3U,405
|
|
11
11
|
engineio/middleware.py,sha256=BF_qHAIZZnIbfiP256SD1CX3kzNWbSuto1cpih8oIFg,3766
|
|
12
12
|
engineio/packet.py,sha256=ETMeLgdpZghXK9fth93IZO8pIft6Sg3d1QGpyTx4xBE,3189
|
|
13
13
|
engineio/payload.py,sha256=2iLIFgIweTWkLok_UZ5zCgELmRSGyUUI5eeYcEerFSs,1547
|
|
14
|
-
engineio/server.py,sha256=
|
|
14
|
+
engineio/server.py,sha256=v0QnoLCD1ReVAhzQRn5keHmjZ61jEJXNQeikfXaELl0,21926
|
|
15
15
|
engineio/socket.py,sha256=dasec3jXoV2eR1jmIrhEIfHzyUuuv8FwvxLB3DpyjeY,9996
|
|
16
16
|
engineio/static_files.py,sha256=pwez9LQFaSQXMbtI0vLyD6UDiokQ4rNfmRYgVLKOthc,2064
|
|
17
17
|
engineio/async_drivers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
18
|
engineio/async_drivers/_websocket_wsgi.py,sha256=FGoRBGOUsEtlfklYNylR0o3oLOGmXIR8QzaCsGLgr3I,949
|
|
19
19
|
engineio/async_drivers/aiohttp.py,sha256=zJdujjO6dSL_oKDDr4xfO4ID_Vd8faEp1AOIW4ogKME,3768
|
|
20
|
-
engineio/async_drivers/asgi.py,sha256=
|
|
21
|
-
engineio/async_drivers/eventlet.py,sha256=
|
|
20
|
+
engineio/async_drivers/asgi.py,sha256=mvCErNpYw1T7XE_1Ixb0YQN0YqJkKMpWqNV5_tZQYMg,11011
|
|
21
|
+
engineio/async_drivers/eventlet.py,sha256=_ZgPg0HTx_yhSm5iBcd3ez01yMg3KRFmb2ycKD8o8pY,1775
|
|
22
22
|
engineio/async_drivers/gevent.py,sha256=hnJHeWdDQE2jfoLCP5DnwVPzsQlcTLJUMA5EVf1UL-k,2962
|
|
23
23
|
engineio/async_drivers/gevent_uwsgi.py,sha256=cnjCsnDHTa6rKgwDKD6rLvIw1Yun-g4c1QbujOC_bMY,5962
|
|
24
24
|
engineio/async_drivers/sanic.py,sha256=SY0HIp5DUHF7B55tJCBB_8qDjrRTD_FyNQ2cIwRIGR8,4538
|
|
25
25
|
engineio/async_drivers/threading.py,sha256=ywmG59d4H6OHZjKarBN97-9BHEsRxFEz9YN-E9QAu_I,463
|
|
26
26
|
engineio/async_drivers/tornado.py,sha256=9bB7FvY47Snx_h4rsNwRk5wIINf2ju7hXWTAqF3intA,5909
|
|
27
|
-
python_engineio-4.
|
|
28
|
-
python_engineio-4.
|
|
29
|
-
python_engineio-4.
|
|
30
|
-
python_engineio-4.
|
|
31
|
-
python_engineio-4.
|
|
27
|
+
python_engineio-4.10.0.dist-info/LICENSE,sha256=yel9Pbwfu82094CLKCzWRtuIev9PUxP-a76NTDFAWpw,1082
|
|
28
|
+
python_engineio-4.10.0.dist-info/METADATA,sha256=SaBVFlF_cqRa2i_sQ3Fdiaz6GdxT1qASxZpSugLD57A,2245
|
|
29
|
+
python_engineio-4.10.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
30
|
+
python_engineio-4.10.0.dist-info/top_level.txt,sha256=u8PmNisCZLwRYcWrNLe9wutQ2tt4zNi8IH362c-HWuA,9
|
|
31
|
+
python_engineio-4.10.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|