SSH connection status indicators
- Add Connected bool field to vfs.Entry and RemoteMount - Track connection status in sshState.connectedHosts - Show status icon (connected/disconnected) in pane header when browsing remote host - Async SSH connection test with cancel support for Add Host dialog - Colored labels and styled help text in SSH dialogs - Confirmation dialog when deleting manually-added SSH hosts
This commit is contained in:
parent
df4df6b8f6
commit
1ed2d3defb
224 changed files with 33447 additions and 236 deletions
42
vendor/github.com/pkg/sftp/errno_plan9.go
generated
vendored
Normal file
42
vendor/github.com/pkg/sftp/errno_plan9.go
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package sftp
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
var EBADF = syscall.NewError("fd out of range or not open")
|
||||
|
||||
func wrapPathError(filepath string, err error) error {
|
||||
if errno, ok := err.(syscall.ErrorString); ok {
|
||||
return &os.PathError{Path: filepath, Err: errno}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// translateErrno translates a syscall error number to a SFTP error code.
|
||||
func translateErrno(errno syscall.ErrorString) uint32 {
|
||||
switch errno {
|
||||
case "":
|
||||
return sshFxOk
|
||||
case syscall.ENOENT:
|
||||
return sshFxNoSuchFile
|
||||
case syscall.EPERM:
|
||||
return sshFxPermissionDenied
|
||||
}
|
||||
|
||||
return sshFxFailure
|
||||
}
|
||||
|
||||
func translateSyscallError(err error) (uint32, bool) {
|
||||
switch e := err.(type) {
|
||||
case syscall.ErrorString:
|
||||
return translateErrno(e), true
|
||||
case *os.PathError:
|
||||
debug("statusFromError,pathError: error is %T %#v", e.Err, e.Err)
|
||||
if errno, ok := e.Err.(syscall.ErrorString); ok {
|
||||
return translateErrno(errno), true
|
||||
}
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue