X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/ba29c43bb23de83c7715271e0830cb9f00e9e1c1..8796b4494547be6825004d82bf40db71524a6400:/hotline/server.go?ds=sidebyside diff --git a/hotline/server.go b/hotline/server.go index 1a6d163..76cc248 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -693,6 +693,8 @@ func (s *Server) handleFileTransfer(conn io.ReadWriteCloser) error { switch fileTransfer.Type { case FileDownload: + s.Stats.DownloadCounter += 1 + fullFilePath, err := readPath(s.Config.FileRoot, fileTransfer.FilePath, fileTransfer.FileName) if err != nil { return err @@ -744,6 +746,8 @@ func (s *Server) handleFileTransfer(conn io.ReadWriteCloser) error { } } case FileUpload: + s.Stats.UploadCounter += 1 + destinationFile := s.Config.FileRoot + ReadFilePath(fileTransfer.FilePath) + "/" + string(fileTransfer.FileName) var file *os.File @@ -829,6 +833,8 @@ func (s *Server) handleFileTransfer(conn io.ReadWriteCloser) error { i := 0 err = filepath.Walk(fullFilePath+"/", func(path string, info os.FileInfo, err error) error { + s.Stats.DownloadCounter += 1 + if err != nil { return err } @@ -1039,8 +1045,6 @@ func (s *Server) handleFileTransfer(conn io.ReadWriteCloser) error { nextAction = dlFldrActionResumeFile } - fmt.Printf("Next Action: %v\n", nextAction) - if _, err := conn.Write([]byte{0, uint8(nextAction)}); err != nil { return err }