omserv 0.0.0.dev250__tar.gz → 0.0.0.dev252__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.
- {omserv-0.0.0.dev250/omserv.egg-info → omserv-0.0.0.dev252}/PKG-INFO +2 -2
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/protocols/h2.py +44 -29
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252/omserv.egg-info}/PKG-INFO +2 -2
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv.egg-info/requires.txt +1 -1
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/pyproject.toml +2 -2
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/LICENSE +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/MANIFEST.in +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/README.rst +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/.manifests.json +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/__about__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/__init__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/apps/__init__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/apps/base.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/apps/inject.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/apps/markers.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/apps/routes.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/apps/sessions.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/apps/templates.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nginx/__init__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nginx/build.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nginx/logs.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nginx/patches/__init__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nginx/patches/nginx-1.27.4_http_status.patch +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nginx/stubstatus.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nodes/__init__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nodes/models.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nodes/registry.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nodes/sql.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/LICENSE +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/__init__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/config.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/debug.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/default.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/events.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/headers.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/inject.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/lifespans.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/listener.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/multiprocess.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/protocols/__init__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/protocols/h11.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/protocols/protocols.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/protocols/types.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/resources/__init__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/resources/favicon.ico +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/server.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/sockets.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/ssl.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/streams/__init__.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/streams/httpstream.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/streams/utils.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/streams/wsstream.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/taskspawner.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/types.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/server/workercontext.py +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv.egg-info/SOURCES.txt +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv.egg-info/dependency_links.txt +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv.egg-info/entry_points.txt +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv.egg-info/top_level.txt +0 -0
- {omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: omserv
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev252
|
4
4
|
Summary: omserv
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Operating System :: POSIX
|
13
13
|
Requires-Python: >=3.12
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omlish==0.0.0.
|
15
|
+
Requires-Dist: omlish==0.0.0.dev252
|
16
16
|
Provides-Extra: all
|
17
17
|
Requires-Dist: h11~=0.14; extra == "all"
|
18
18
|
Requires-Dist: h2~=4.1; extra == "all"
|
@@ -6,8 +6,11 @@ import h2.connection
|
|
6
6
|
import h2.events
|
7
7
|
import h2.exceptions
|
8
8
|
import h2.settings
|
9
|
+
import hpack
|
9
10
|
import priority
|
10
11
|
|
12
|
+
from omlish import check
|
13
|
+
|
11
14
|
from ..config import Config
|
12
15
|
from ..events import Body
|
13
16
|
from ..events import Closed
|
@@ -137,7 +140,9 @@ class H2Protocol(Protocol):
|
|
137
140
|
settings: str | None = None,
|
138
141
|
) -> None:
|
139
142
|
if settings is not None:
|
140
|
-
self.connection.initiate_upgrade_connection(
|
143
|
+
self.connection.initiate_upgrade_connection(
|
144
|
+
settings.encode('ascii') if settings is not None else None,
|
145
|
+
)
|
141
146
|
else:
|
142
147
|
self.connection.initiate_connection()
|
143
148
|
|
@@ -146,7 +151,7 @@ class H2Protocol(Protocol):
|
|
146
151
|
if headers is not None:
|
147
152
|
event = h2.events.RequestReceived()
|
148
153
|
event.stream_id = 1
|
149
|
-
event.headers = headers
|
154
|
+
event.headers = [hpack.HeaderTuple(*t) for t in headers]
|
150
155
|
await self._create_stream(event)
|
151
156
|
await self.streams[event.stream_id].handle(EndBody(stream_id=event.stream_id))
|
152
157
|
|
@@ -258,7 +263,7 @@ class H2Protocol(Protocol):
|
|
258
263
|
for event in events:
|
259
264
|
if isinstance(event, h2.events.RequestReceived):
|
260
265
|
if self.context.terminated.is_set():
|
261
|
-
self.connection.reset_stream(event.stream_id)
|
266
|
+
self.connection.reset_stream(check.not_none(event.stream_id))
|
262
267
|
self.connection.update_settings(
|
263
268
|
{h2.settings.SettingCodes.MAX_CONCURRENT_STREAMS: 0},
|
264
269
|
)
|
@@ -270,23 +275,26 @@ class H2Protocol(Protocol):
|
|
270
275
|
self.connection.close_connection()
|
271
276
|
|
272
277
|
elif isinstance(event, h2.events.DataReceived):
|
273
|
-
await self.streams[event.stream_id].handle(Body(
|
274
|
-
stream_id=event.stream_id,
|
275
|
-
data=event.data,
|
278
|
+
await self.streams[check.not_none(event.stream_id)].handle(Body(
|
279
|
+
stream_id=check.not_none(event.stream_id),
|
280
|
+
data=check.not_none(event.data),
|
276
281
|
))
|
277
282
|
self.connection.acknowledge_received_data(
|
278
|
-
event.flow_controlled_length,
|
283
|
+
check.not_none(event.flow_controlled_length),
|
284
|
+
check.not_none(event.stream_id),
|
279
285
|
)
|
280
286
|
|
281
287
|
elif isinstance(event, h2.events.StreamEnded):
|
282
|
-
await self.streams[event.stream_id].handle(
|
288
|
+
await self.streams[check.not_none(event.stream_id)].handle(
|
289
|
+
EndBody(stream_id=check.not_none(event.stream_id)),
|
290
|
+
)
|
283
291
|
|
284
292
|
elif isinstance(event, h2.events.StreamReset):
|
285
|
-
await self._close_stream(event.stream_id)
|
293
|
+
await self._close_stream(check.not_none(event.stream_id))
|
286
294
|
await self._window_updated(event.stream_id)
|
287
295
|
|
288
296
|
elif isinstance(event, h2.events.WindowUpdated):
|
289
|
-
await self._window_updated(event.stream_id)
|
297
|
+
await self._window_updated(check.not_none(event.stream_id))
|
290
298
|
|
291
299
|
elif isinstance(event, h2.events.PriorityUpdated):
|
292
300
|
await self._priority_updated(event)
|
@@ -315,34 +323,41 @@ class H2Protocol(Protocol):
|
|
315
323
|
await self.has_data.set()
|
316
324
|
|
317
325
|
async def _priority_updated(self, event: h2.events.PriorityUpdated) -> None:
|
326
|
+
stream_id = check.not_none(event.stream_id)
|
327
|
+
|
318
328
|
try:
|
319
329
|
self.priority.reprioritize(
|
320
|
-
stream_id=
|
330
|
+
stream_id=stream_id,
|
321
331
|
depends_on=event.depends_on or None,
|
322
|
-
weight=event.weight,
|
323
|
-
exclusive=event.exclusive,
|
332
|
+
weight=check.not_none(event.weight),
|
333
|
+
exclusive=check.not_none(event.exclusive),
|
324
334
|
)
|
325
335
|
|
326
336
|
except priority.MissingStreamError:
|
327
337
|
# Received PRIORITY frame before HEADERS frame
|
328
338
|
self.priority.insert_stream(
|
329
|
-
stream_id=
|
339
|
+
stream_id=stream_id,
|
330
340
|
depends_on=event.depends_on or None,
|
331
|
-
weight=event.weight,
|
332
|
-
exclusive=event.exclusive,
|
341
|
+
weight=check.not_none(event.weight),
|
342
|
+
exclusive=check.not_none(event.exclusive),
|
333
343
|
)
|
334
|
-
self.priority.block(
|
344
|
+
self.priority.block(stream_id)
|
345
|
+
|
335
346
|
await self.has_data.set()
|
336
347
|
|
337
348
|
async def _create_stream(self, request: h2.events.RequestReceived) -> None:
|
338
|
-
|
349
|
+
method: str | None = None
|
350
|
+
for name, value in request.headers or []:
|
339
351
|
if name == b':method':
|
340
352
|
method = value.decode('ascii').upper()
|
341
353
|
elif name == b':path':
|
342
354
|
raw_path = value
|
343
355
|
|
356
|
+
method = check.not_none(method)
|
357
|
+
stream_id = check.not_none(request.stream_id)
|
358
|
+
|
344
359
|
if method == 'CONNECT':
|
345
|
-
self.streams[
|
360
|
+
self.streams[stream_id] = WsStream(
|
346
361
|
self.app,
|
347
362
|
self.config,
|
348
363
|
self.context,
|
@@ -350,11 +365,11 @@ class H2Protocol(Protocol):
|
|
350
365
|
self.client,
|
351
366
|
self.server,
|
352
367
|
self.stream_send,
|
353
|
-
|
368
|
+
stream_id,
|
354
369
|
)
|
355
370
|
|
356
371
|
else:
|
357
|
-
self.streams[
|
372
|
+
self.streams[stream_id] = HttpStream(
|
358
373
|
self.app,
|
359
374
|
self.config,
|
360
375
|
self.context,
|
@@ -362,22 +377,22 @@ class H2Protocol(Protocol):
|
|
362
377
|
self.client,
|
363
378
|
self.server,
|
364
379
|
self.stream_send,
|
365
|
-
|
380
|
+
stream_id,
|
366
381
|
)
|
367
382
|
|
368
|
-
self.stream_buffers[
|
383
|
+
self.stream_buffers[stream_id] = StreamBuffer(self.context.event_class)
|
369
384
|
|
370
385
|
try:
|
371
|
-
self.priority.insert_stream(request.stream_id)
|
386
|
+
self.priority.insert_stream(check.not_none(request.stream_id))
|
372
387
|
except priority.DuplicateStreamError:
|
373
388
|
# Recieved PRIORITY frame before HEADERS frame
|
374
389
|
pass
|
375
390
|
else:
|
376
|
-
self.priority.block(request.stream_id)
|
391
|
+
self.priority.block(check.not_none(request.stream_id))
|
377
392
|
|
378
|
-
await self.streams[
|
379
|
-
stream_id=
|
380
|
-
headers=filter_pseudo_headers(request.headers),
|
393
|
+
await self.streams[stream_id].handle(Request(
|
394
|
+
stream_id=stream_id,
|
395
|
+
headers=filter_pseudo_headers(check.not_none(request.headers)), # type: ignore[arg-type]
|
381
396
|
http_version='2',
|
382
397
|
method=method,
|
383
398
|
raw_path=raw_path,
|
@@ -412,7 +427,7 @@ class H2Protocol(Protocol):
|
|
412
427
|
else:
|
413
428
|
event = h2.events.RequestReceived()
|
414
429
|
event.stream_id = push_stream_id
|
415
|
-
event.headers = request_headers
|
430
|
+
event.headers = [hpack.HeaderTuple(*t) for t in request_headers]
|
416
431
|
await self._create_stream(event)
|
417
432
|
await self.streams[event.stream_id].handle(EndBody(stream_id=event.stream_id))
|
418
433
|
self.keep_alive_requests += 1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: omserv
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev252
|
4
4
|
Summary: omserv
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Operating System :: POSIX
|
13
13
|
Requires-Python: >=3.12
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omlish==0.0.0.
|
15
|
+
Requires-Dist: omlish==0.0.0.dev252
|
16
16
|
Provides-Extra: all
|
17
17
|
Requires-Dist: h11~=0.14; extra == "all"
|
18
18
|
Requires-Dist: h2~=4.1; extra == "all"
|
@@ -12,7 +12,7 @@ authors = [
|
|
12
12
|
urls = {source = 'https://github.com/wrmsr/omlish'}
|
13
13
|
license = {text = 'BSD-3-Clause'}
|
14
14
|
requires-python = '>=3.12'
|
15
|
-
version = '0.0.0.
|
15
|
+
version = '0.0.0.dev252'
|
16
16
|
classifiers = [
|
17
17
|
'License :: OSI Approved :: BSD License',
|
18
18
|
'Development Status :: 2 - Pre-Alpha',
|
@@ -22,7 +22,7 @@ classifiers = [
|
|
22
22
|
]
|
23
23
|
description = 'omserv'
|
24
24
|
dependencies = [
|
25
|
-
'omlish == 0.0.0.
|
25
|
+
'omlish == 0.0.0.dev252',
|
26
26
|
]
|
27
27
|
|
28
28
|
[project.optional-dependencies]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{omserv-0.0.0.dev250 → omserv-0.0.0.dev252}/omserv/nginx/patches/nginx-1.27.4_http_status.patch
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|