Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance/client_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ features:
protocols:
- PROTOCOL_CONNECT
- PROTOCOL_GRPC
- PROTOCOL_GRPC_WEB
codecs:
- CODEC_PROTO
compressions:
Expand All @@ -15,7 +16,6 @@ features:
- STREAM_TYPE_CLIENT_STREAM
- STREAM_TYPE_SERVER_STREAM
- STREAM_TYPE_HALF_DUPLEX_BIDI_STREAM
# - STREAM_TYPE_FULL_DUPLEX_BIDI_STREAM

supports_h2c: true
supports_tls: true
Expand Down
1 change: 1 addition & 0 deletions conformance/server_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ features:
protocols:
- PROTOCOL_CONNECT
- PROTOCOL_GRPC
- PROTOCOL_GRPC_WEB
codecs:
- CODEC_PROTO
- CODEC_JSON
Expand Down
7 changes: 4 additions & 3 deletions src/connect/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class EnvelopeFlags(Flag):

compressed = 0b00000001
end_stream = 0b00000010
trailer = 0b10000000


class Envelope:
Expand Down Expand Up @@ -253,7 +254,7 @@ class EnvelopeReader:
stream: AsyncIterable[bytes] | None
buffer: bytes
bytes_read: int
last_data: bytes | None
last: Envelope | None

def __init__(
self,
Expand All @@ -277,7 +278,7 @@ def __init__(
self.stream = stream
self.buffer = b""
self.bytes_read = 0
self.last_data = None
self.last = None

async def unmarshal(self, message: Any) -> AsyncIterator[tuple[Any, bool]]:
"""Asynchronously unmarshals messages from the stream.
Expand Down Expand Up @@ -325,7 +326,7 @@ async def unmarshal(self, message: Any) -> AsyncIterator[tuple[Any, bool]]:
env.data = self.compression.decompress(env.data, self.read_max_bytes)

if env.flags != EnvelopeFlags(0) and env.flags != EnvelopeFlags.compressed:
self.last_data = env.data
self.last = env
end = True
obj = None
else:
Expand Down
2 changes: 1 addition & 1 deletion src/connect/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def create_protocol_handlers(config: HandlerConfig) -> list[ProtocolHandler]:
list[ProtocolHandler]: A list of initialized protocol handlers.

"""
protocols = [ProtocolConnect(), ProtocolGRPC(web=False)]
protocols = [ProtocolConnect(), ProtocolGRPC(web=False), ProtocolGRPC(web=True)]

codecs = CodecMap(config.codecs)

Expand Down
4 changes: 2 additions & 2 deletions src/connect/protocol_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,8 +1189,8 @@ async def unmarshal(self, message: Any) -> AsyncIterator[tuple[Any, bool]]:

"""
async for obj, end in super().unmarshal(message):
if self.last_data:
error, trailers = end_stream_from_bytes(self.last_data)
if self.last:
error, trailers = end_stream_from_bytes(self.last.data)
self._end_stream_error = error
self._trailers = trailers

Expand Down
Loading
Loading