|
|
@@ -203,14 +203,7 @@ extension HTTP1ToRawGRPCServerCodec: ChannelOutboundHandler {
|
|
|
// Store the response into an independent buffer. We can't return the message directly as
|
|
|
// it needs to be aggregated with all the responses plus the trailers, in order to have
|
|
|
// the base64 response properly encoded in a single byte stream.
|
|
|
- #if swift(>=4.2)
|
|
|
messageWriter.write(messageBytes, into: &self.responseTextBuffer, usingCompression: .none)
|
|
|
- #else
|
|
|
- // Write into a temporary buffer to avoid: "error: cannot pass immutable value as inout argument: 'self' is immutable"
|
|
|
- var responseBuffer = context.channel.allocator.buffer(capacity: LengthPrefixedMessageWriter.metadataLength)
|
|
|
- messageWriter.write(messageBytes, into: &responseBuffer, usingCompression: .none)
|
|
|
- responseTextBuffer.writeBuffer(&responseBuffer)
|
|
|
- #endif
|
|
|
|
|
|
// Since we stored the written data, mark the write promise as successful so that the
|
|
|
// ServerStreaming provider continues sending the data.
|