From 22c969acc900d2b5ecc0ecd6b7ec2c16332589ec Mon Sep 17 00:00:00 2001 From: Joannis Orlandos Date: Mon, 4 Mar 2024 10:48:42 +0100 Subject: [PATCH] Make sure that data is buffered instead of discarded --- Sources/Citadel/TTY/Client/TTY.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Citadel/TTY/Client/TTY.swift b/Sources/Citadel/TTY/Client/TTY.swift index 0ec9086..d4cc01b 100644 --- a/Sources/Citadel/TTY/Client/TTY.swift +++ b/Sources/Citadel/TTY/Client/TTY.swift @@ -155,7 +155,7 @@ extension SSHClient { /// - inShell: Whether to request the remote server to start a shell before executing the command. public func executeCommandStream(_ command: String, inShell: Bool = false) async throws -> AsyncThrowingStream { var streamContinuation: AsyncThrowingStream.Continuation! - let stream = AsyncThrowingStream { continuation in + let stream = AsyncThrowingStream(bufferingPolicy: .unbounded) { continuation in streamContinuation = continuation } @@ -218,11 +218,11 @@ extension SSHClient { public func executeCommandPair(_ command: String, inShell: Bool = false) async throws -> ExecCommandStream { var stdoutContinuation: AsyncThrowingStream.Continuation! var stderrContinuation: AsyncThrowingStream.Continuation! - let stdout = AsyncThrowingStream { continuation in + let stdout = AsyncThrowingStream(bufferingPolicy: .unbounded) { continuation in stdoutContinuation = continuation } - let stderr = AsyncThrowingStream { continuation in + let stderr = AsyncThrowingStream(bufferingPolicy: .unbounded) { continuation in stderrContinuation = continuation }