mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
fix connection limits
an SFTP client can start multiple transfers on a single connection Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -317,6 +317,13 @@ func uploadUserFiles(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
defer common.Connections.Remove(connection.GetID())
|
||||
|
||||
if err := common.Connections.IsNewTransferAllowed(connection.User.Username); err != nil {
|
||||
connection.Log(logger.LevelInfo, "denying file write due to number of transfer limits")
|
||||
sendAPIResponse(w, r, err, "Denying file write due to transfer count limits",
|
||||
http.StatusConflict)
|
||||
return
|
||||
}
|
||||
|
||||
transferQuota := connection.GetTransferQuota()
|
||||
if !transferQuota.HasUploadSpace() {
|
||||
connection.Log(logger.LevelInfo, "denying file write due to transfer quota limits")
|
||||
|
||||
Reference in New Issue
Block a user