Skip to content

Commit 409b658

Browse files
committed
dev
1 parent 28b2099 commit 409b658

File tree

7 files changed

+15
-5
lines changed

7 files changed

+15
-5
lines changed

Sources/SSH/Channel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public extension SSH {
5353
closed(channel: rawChannel)
5454
return -1
5555
}
56+
let rc = io.Copy(output, ChannelInputStream(rawChannel: rawChannel, ssh: self, wait: true), bufferSize)
5657
if let stderr {
5758
io.Copy(stderr, ChannelInputStream(rawChannel: rawChannel, ssh: self, err: true, wait: true), bufferSize)
5859
}
59-
let rc = io.Copy(output, ChannelInputStream(rawChannel: rawChannel, ssh: self, wait: true), bufferSize)
6060
closed(channel: rawChannel)
6161
return rc
6262
}

Sources/SSH/Machine/Container.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Docker.swift
1+
// Container.swift
22
// Copyright (c) 2025 ssh2.app
33
// Created by [email protected] 2025/2/3.
44

Sources/SSH/Machine/Process.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Foundation
88
public extension SSH {
99
func getSystemProcess(bootTime: Double, clkTck: Double = 0x64) async -> [SystemProcess] {
1010
let ret1: [SystemProcess] = await findSystemProcess(bootTime: bootTime, clkTck: clkTck)
11-
// try? await Task.sleep(for: .seconds(1))
11+
// await Task.sleep(seconds: 1)
1212
// var ret2: [SystemProcess] = await findSystemProcess(bootTime: bootTime,clkTck: clkTck)
1313
// let cout = ret2.count - 1
1414
// guard cout > 0 else {

Sources/SSH/SSH.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SSH {
1515
///
1616
/// This constant holds the version number of the SSH library as a string.
1717
/// It can be used to check the version of the library being used in the project.
18-
public static let version = "0.0.2"
18+
public static let version = "0.0.3"
1919

2020
/// A constant representing the version of the libssh2 library being used.
2121
/// This value is defined by the `LIBSSH2_VERSION` macro.
@@ -96,6 +96,8 @@ public class SSH {
9696

9797
public var encoding: String.Encoding = .utf8
9898

99+
public var container: ContainerType = .docker
100+
99101
var flowSource: DispatchSourceTimer?
100102

101103
/// Initializes a new SSH connection with the specified parameters.

Sources/SSH/Shell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ public extension SSH {
1313
guard rawChannel != nil else {
1414
return false
1515
}
16+
pollShell()
1617
var code = callSSH2 {
1718
libssh2_channel_request_pty_ex(rawChannel, type.name, type.name.count.load(), nil, 0, width, height, LIBSSH2_TERM_WIDTH_PX, LIBSSH2_TERM_HEIGHT_PX)
1819
}
1920
guard code == LIBSSH2_ERROR_NONE else {
2021
closeShell()
2122
return false
2223
}
23-
pollShell()
2424
code = callSSH2 {
2525
libssh2_channel_process_startup(rawChannel, "shell", 5, nil, 0)
2626
}

Sources/SSH/Types.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,11 @@ public struct Connect: Identifiable, Equatable, Hashable, Codable {
226226
case user, host, port, password
227227
}
228228
}
229+
230+
public enum ContainerType: String, CaseIterable {
231+
case docker, podman
232+
233+
var command: String {
234+
rawValue
235+
}
236+
}

Sources/Socket/Dial.swift

Whitespace-only changes.

0 commit comments

Comments
 (0)