mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
transfer: initialize lastActivity
This avoid a random value for transfer of empty file where no reads or writes happen
This commit is contained in:
@@ -193,7 +193,7 @@ REST API is designed to run on localhost or on a trusted network, if you need ht
|
|||||||
|
|
||||||
The OpenAPI 3 schema for the exposed API can be found inside the source tree: [openapi.yaml](https://github.com/drakkan/sftpgo/tree/master/api/schema/openapi.yaml "OpenAPI 3 specs").
|
The OpenAPI 3 schema for the exposed API can be found inside the source tree: [openapi.yaml](https://github.com/drakkan/sftpgo/tree/master/api/schema/openapi.yaml "OpenAPI 3 specs").
|
||||||
|
|
||||||
A sample CLI client for the REST API can be find inside the source tree: [scripts](https://github.com/drakkan/sftpgo/tree/master/scripts "scripts") directory.
|
A sample CLI client for the REST API can be found inside the source tree: [scripts](https://github.com/drakkan/sftpgo/tree/master/scripts "scripts") directory.
|
||||||
|
|
||||||
## Logs
|
## Logs
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ func (c Connection) Fileread(request *sftp.Request) (io.ReaderAt, error) {
|
|||||||
user: c.User,
|
user: c.User,
|
||||||
connectionID: c.ID,
|
connectionID: c.ID,
|
||||||
transferType: transferDownload,
|
transferType: transferDownload,
|
||||||
|
lastActivity: time.Now(),
|
||||||
isNewFile: false,
|
isNewFile: false,
|
||||||
}
|
}
|
||||||
addTransfer(&transfer)
|
addTransfer(&transfer)
|
||||||
@@ -134,6 +135,7 @@ func (c Connection) Filewrite(request *sftp.Request) (io.WriterAt, error) {
|
|||||||
user: c.User,
|
user: c.User,
|
||||||
connectionID: c.ID,
|
connectionID: c.ID,
|
||||||
transferType: transferUpload,
|
transferType: transferUpload,
|
||||||
|
lastActivity: time.Now(),
|
||||||
isNewFile: true,
|
isNewFile: true,
|
||||||
}
|
}
|
||||||
addTransfer(&transfer)
|
addTransfer(&transfer)
|
||||||
@@ -187,6 +189,7 @@ func (c Connection) Filewrite(request *sftp.Request) (io.WriterAt, error) {
|
|||||||
user: c.User,
|
user: c.User,
|
||||||
connectionID: c.ID,
|
connectionID: c.ID,
|
||||||
transferType: transferUpload,
|
transferType: transferUpload,
|
||||||
|
lastActivity: time.Now(),
|
||||||
isNewFile: false,
|
isNewFile: false,
|
||||||
}
|
}
|
||||||
addTransfer(&transfer)
|
addTransfer(&transfer)
|
||||||
|
|||||||
Reference in New Issue
Block a user