Skip to content

Commit

Permalink
Merge pull request #61 from orlandos-nl/jo/buffer-stream-data
Browse files Browse the repository at this point in the history
Make sure that data is buffered instead of discarded
  • Loading branch information
Joannis committed Mar 13, 2024
2 parents 7a37e82 + 22c969a commit 4342002
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Citadel/TTY/Client/TTY.swift
Expand Up @@ -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<ExecCommandOutput, Error> {
var streamContinuation: AsyncThrowingStream<ExecCommandOutput, Error>.Continuation!
let stream = AsyncThrowingStream<ExecCommandOutput, Error> { continuation in
let stream = AsyncThrowingStream<ExecCommandOutput, Error>(bufferingPolicy: .unbounded) { continuation in
streamContinuation = continuation
}

Expand Down Expand Up @@ -218,11 +218,11 @@ extension SSHClient {
public func executeCommandPair(_ command: String, inShell: Bool = false) async throws -> ExecCommandStream {
var stdoutContinuation: AsyncThrowingStream<ByteBuffer, Error>.Continuation!
var stderrContinuation: AsyncThrowingStream<ByteBuffer, Error>.Continuation!
let stdout = AsyncThrowingStream<ByteBuffer, Error> { continuation in
let stdout = AsyncThrowingStream<ByteBuffer, Error>(bufferingPolicy: .unbounded) { continuation in
stdoutContinuation = continuation
}

let stderr = AsyncThrowingStream<ByteBuffer, Error> { continuation in
let stderr = AsyncThrowingStream<ByteBuffer, Error>(bufferingPolicy: .unbounded) { continuation in
stderrContinuation = continuation
}

Expand Down

0 comments on commit 4342002

Please sign in to comment.