fix preload alignment for custom buffer sizes

This commit is contained in:
ston1th 2022-04-07 16:13:08 +02:00
commit cb7f2dee54
6 changed files with 12 additions and 46 deletions

View file

@ -92,8 +92,6 @@ func (fs *FS) dial() (err error) {
func (fs *FS) connect(ctx context.Context) {
log := fs.log
t := time.NewTicker(time.Second * 2)
defer t.Stop()
for {
log.V(2).Info("connecting")
err := fs.dial()
@ -106,8 +104,7 @@ func (fs *FS) connect(ctx context.Context) {
fs.client, err = sftp.NewClient(fs.c,
sftp.UseFstat(true),
sftp.UseConcurrentReads(true),
//sftp.UseConcurrentWrites(true),
//sftp.MaxPacket(23552),
sftp.UseConcurrentWrites(true),
)
select {
case <-ctx.Done():
@ -124,7 +121,7 @@ func (fs *FS) connect(ctx context.Context) {
select {
case <-ctx.Done():
return
case <-t.C:
case <-time.After(time.Second * 2):
}
}
}
@ -142,6 +139,7 @@ func (fs *FS) wait(ctx context.Context) <-chan error {
func (fs *FS) keepAlive(ctx context.Context) {
t := time.NewTicker(time.Second * 15)
defer t.Stop()
for {
if fs.c != nil {
_, _, err := fs.c.SendRequest("keepalive@cachefs", true, nil)