-
-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
TrzszFilter构造时传入输入 输出流,当我ssh关闭session时,不在使用连接了,TrzszFilter输入输出流是否需要关闭, 不关闭是否产生内存泄漏等问题,目前我只关闭了se
1.关闭的话,我抛出异常这边windows无法退出,会导致cpu飙升,目前我在外部加了sleep 1h,阻塞频繁读取
func (filter *TrzszFilter) wrapInput() {
buffer := make([]byte, 32*1024)
var detectDragFile atomic.Bool
if filter.options.DetectDragFile {
go func() {
if isWarpTerminal() {
time.Sleep(time.Second)
}
detectDragFile.Store(true)
}()
}
for {
n, err := filter.clientIn.Read(buffer)
if n > 0 {
filter.sendInput(buffer[0:n], &detectDragFile)
}
if err == io.EOF {
if isRunningOnWindows() {
filter.sendInput([]byte{0x1A}, &detectDragFile) // ctrl + z
continue
}
filter.serverIn.Close()
break
}
}
}
Metadata
Metadata
Assignees
Labels
No labels