Skip to content
Merged
Changes from 1 commit
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
Next Next commit
fix lost file handle error
  • Loading branch information
maartene committed Jan 18, 2023
commit 5f409842c7298fd434363264c5ad70b1293940b1
2 changes: 1 addition & 1 deletion Sources/NIOSSHServer/ExecHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ final class ExampleExecHandler: ChannelDuplexHandler {
.channelOption(ChannelOptions.allowRemoteHalfClosure, value: true)
.channelInitializer { pipeChannel in
pipeChannel.pipeline.addHandler(theirs)
}.withPipes(inputDescriptor: outPipe.fileHandleForReading.fileDescriptor, outputDescriptor: inPipe.fileHandleForWriting.fileDescriptor).wait()
}.withPipes(inputDescriptor: dup(outPipe.fileHandleForReading.fileDescriptor), outputDescriptor: dup(inPipe.fileHandleForWriting.fileDescriptor)).wait()

// Ok, great, we've sorted stdout and stdin. For stderr we need a different strategy: we just park a thread for this.
DispatchQueue(label: "stderrorwhatever").async {
Expand Down