X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/df1ade5433b027f9cb905e584921692313e647f5..153e2eac3b51a6a426556752fa2c532cfe53f026:/hotline/file_transfer.go diff --git a/hotline/file_transfer.go b/hotline/file_transfer.go index ba4a1e1..194e8b9 100644 --- a/hotline/file_transfer.go +++ b/hotline/file_transfer.go @@ -1,21 +1,21 @@ package hotline import ( + "crypto/rand" "encoding/binary" "fmt" "math" - "math/rand" "path/filepath" "sync" ) // File transfer types const ( - FileDownload = 0 - FileUpload = 1 - FolderDownload = 2 - FolderUpload = 3 - bannerDownload = 4 + FileDownload = iota + FileUpload + FolderDownload + FolderUpload + bannerDownload ) type FileTransfer struct { @@ -51,7 +51,7 @@ func (wc *WriteCounter) Write(p []byte) (int, error) { func (cc *ClientConn) newFileTransfer(transferType int, fileName, filePath, size []byte) *FileTransfer { var transactionRef [4]byte - rand.Read(transactionRef[:]) + _, _ = rand.Read(transactionRef[:]) ft := &FileTransfer{ FileName: fileName,