Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • v1.0.0
  • v1.0.1
  • v1.1.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.11.0
  • v1.12.0
  • v1.12.1
  • v1.12.2
  • v1.12.3
  • v1.12.4
  • v1.12.5
  • v1.12.6
  • v1.12.7
  • v1.12.8
  • v1.13.0
  • v1.13.1
  • v1.13.2
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.15.10
  • v1.15.11
  • v1.15.12
  • v1.15.13
  • v1.15.14
  • v1.15.15
  • v1.15.16
  • v1.15.17
  • v1.15.2
  • v1.15.3
  • v1.15.4
  • v1.15.5
  • v1.15.6
  • v1.15.7
  • v1.15.8
  • v1.15.9
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.18.0
  • v1.18.1
  • v1.18.2
  • v1.19.0
  • v1.19.1
  • v1.19.2
  • v1.19.3
  • v1.19.4
  • v1.2.0
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.20.3
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.7.0
  • v1.7.1
  • v1.7.2
  • v1.7.3
  • v1.8.0
  • v1.8.1
  • v1.9.0
76 results

Target

Select target project
  • oss/libraries/go/services/job-queues
1 result
Select Git revision
  • master
  • v1.0.0
  • v1.0.1
  • v1.1.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.11.0
  • v1.12.0
  • v1.12.1
  • v1.12.2
  • v1.12.3
  • v1.12.4
  • v1.12.5
  • v1.12.6
  • v1.12.7
  • v1.12.8
  • v1.13.0
  • v1.13.1
  • v1.13.2
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.15.10
  • v1.15.11
  • v1.15.12
  • v1.15.13
  • v1.15.14
  • v1.15.15
  • v1.15.16
  • v1.15.17
  • v1.15.2
  • v1.15.3
  • v1.15.4
  • v1.15.5
  • v1.15.6
  • v1.15.7
  • v1.15.8
  • v1.15.9
  • v1.16.0
  • v1.16.1
  • v1.17.0
  • v1.18.0
  • v1.18.1
  • v1.18.2
  • v1.19.0
  • v1.19.1
  • v1.19.2
  • v1.19.3
  • v1.19.4
  • v1.2.0
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.20.3
  • v1.21.0
  • v1.21.1
  • v1.22.0
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.7.0
  • v1.7.1
  • v1.7.2
  • v1.7.3
  • v1.8.0
  • v1.8.1
  • v1.9.0
76 results
Show changes
Showing
with 635 additions and 466 deletions
//go:build darwin || dragonfly || freebsd || (!android && linux) || netbsd || openbsd || solaris || aix || js //go:build darwin || dragonfly || freebsd || (!android && linux) || netbsd || openbsd || solaris || aix || js || zos
// +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris aix js // +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris aix js zos
package sftp package sftp
......
This diff is collapsed.
package sftp package sftp
import ( import (
"context"
"encoding" "encoding"
"fmt" "fmt"
"io" "io"
...@@ -128,14 +129,19 @@ type idmarshaler interface { ...@@ -128,14 +129,19 @@ type idmarshaler interface {
encoding.BinaryMarshaler encoding.BinaryMarshaler
} }
func (c *clientConn) sendPacket(ch chan result, p idmarshaler) (byte, []byte, error) { func (c *clientConn) sendPacket(ctx context.Context, ch chan result, p idmarshaler) (byte, []byte, error) {
if cap(ch) < 1 { if cap(ch) < 1 {
ch = make(chan result, 1) ch = make(chan result, 1)
} }
c.dispatchRequest(ch, p) c.dispatchRequest(ch, p)
s := <-ch
return s.typ, s.data, s.err select {
case <-ctx.Done():
return 0, nil, ctx.Err()
case s := <-ch:
return s.typ, s.data, s.err
}
} }
// dispatchRequest should ideally only be called by race-detection tests outside of this file, // dispatchRequest should ideally only be called by race-detection tests outside of this file,
......
//go:build aix || darwin || dragonfly || freebsd || (!android && linux) || netbsd || openbsd || solaris || js //go:build aix || darwin || dragonfly || freebsd || (!android && linux) || netbsd || openbsd || solaris || js || zos
// +build aix darwin dragonfly freebsd !android,linux netbsd openbsd solaris js // +build aix darwin dragonfly freebsd !android,linux netbsd openbsd solaris js zos
package sftp package sftp
......
This diff is collapsed.
...@@ -3,7 +3,6 @@ package sftp ...@@ -3,7 +3,6 @@ package sftp
// Methods on the Request object to make working with the Flags bitmasks and // Methods on the Request object to make working with the Flags bitmasks and
// Attr(ibutes) byte blob easier. Use Pflags() when working with an Open/Write // Attr(ibutes) byte blob easier. Use Pflags() when working with an Open/Write
// request and AttrFlags() and Attributes() when working with SetStat requests. // request and AttrFlags() and Attributes() when working with SetStat requests.
import "os"
// FileOpenFlags defines Open and Write Flags. Correlate directly with with os.OpenFile flags // FileOpenFlags defines Open and Write Flags. Correlate directly with with os.OpenFile flags
// (https://golang.org/pkg/os/#pkg-constants). // (https://golang.org/pkg/os/#pkg-constants).
...@@ -50,14 +49,9 @@ func (r *Request) AttrFlags() FileAttrFlags { ...@@ -50,14 +49,9 @@ func (r *Request) AttrFlags() FileAttrFlags {
return newFileAttrFlags(r.Flags) return newFileAttrFlags(r.Flags)
} }
// FileMode returns the Mode SFTP file attributes wrapped as os.FileMode
func (a FileStat) FileMode() os.FileMode {
return os.FileMode(a.Mode)
}
// Attributes parses file attributes byte blob and return them in a // Attributes parses file attributes byte blob and return them in a
// FileStat object. // FileStat object.
func (r *Request) Attributes() *FileStat { func (r *Request) Attributes() *FileStat {
fs, _ := unmarshalFileStat(r.Flags, r.Attrs) fs, _, _ := unmarshalFileStat(r.Flags, r.Attrs)
return fs return fs
} }
...@@ -30,7 +30,7 @@ type FileReader interface { ...@@ -30,7 +30,7 @@ type FileReader interface {
// FileWriter should return an io.WriterAt for the filepath. // FileWriter should return an io.WriterAt for the filepath.
// //
// The request server code will call Close() on the returned io.WriterAt // The request server code will call Close() on the returned io.WriterAt
// ojbect if an io.Closer type assertion succeeds. // object if an io.Closer type assertion succeeds.
// Note in cases of an error, the error text will be sent to the client. // Note in cases of an error, the error text will be sent to the client.
// Note when receiving an Append flag it is important to not open files using // Note when receiving an Append flag it is important to not open files using
// O_APPEND if you plan to use WriteAt, as they conflict. // O_APPEND if you plan to use WriteAt, as they conflict.
...@@ -144,6 +144,8 @@ type NameLookupFileLister interface { ...@@ -144,6 +144,8 @@ type NameLookupFileLister interface {
// //
// If a populated entry implements [FileInfoExtendedData], extended attributes will also be returned to the client. // If a populated entry implements [FileInfoExtendedData], extended attributes will also be returned to the client.
// //
// The request server code will call Close() on ListerAt if an io.Closer type assertion succeeds.
//
// Note in cases of an error, the error text will be sent to the client. // Note in cases of an error, the error text will be sent to the client.
type ListerAt interface { type ListerAt interface {
ListAt([]os.FileInfo, int64) (int, error) ListAt([]os.FileInfo, int64) (int, error)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
//go:build plan9 || windows || (js && wasm)
// +build plan9 windows js,wasm
// Go defines S_IFMT on windows, plan9 and js/wasm as 0x1f000 instead of
// 0xf000. None of the the other S_IFxyz values include the "1" (in 0x1f000)
// which prevents them from matching the bitmask.
package sftp
const S_IFMT = 0xf000
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.