Skip to content

Commit

Permalink
use the correct logger in cmd.go (#115)
Browse files Browse the repository at this point in the history
Merge branch 'master' into temp

Merge branch 'master' into temp

use the correct logger in cmd.go

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: Cagri Aksay <[email protected]>
Reviewed-on: https://gitea.com/goftp/server/pulls/115
Reviewed-by: Lunny Xiao <[email protected]>
Co-Authored-By: nitper <[email protected]>
Co-Committed-By: nitper <[email protected]>
  • Loading branch information
3 people committed Nov 2, 2020
1 parent 0e4408d commit 5d8b38b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package core
import (
"encoding/binary"
"fmt"
"log"
"strconv"
"strings"
)
Expand Down Expand Up @@ -416,7 +415,7 @@ func (cmd commandEpsv) RequireAuth() bool {
func (cmd commandEpsv) Execute(conn *Conn, param string) {
socket, err := conn.newPassiveSocket()
if err != nil {
log.Println(err)
conn.logger.Printf(conn.sessionID, "%s\n", err)
conn.writeMessage(425, "Data connection failed")
return
}
Expand Down Expand Up @@ -1114,7 +1113,7 @@ func (cmd commandSize) Execute(conn *Conn, param string) {
path := conn.buildPath(param)
stat, err := conn.driver.Stat(path)
if err != nil {
log.Printf("Size: error(%s)", err)
conn.logger.Printf(conn.sessionID, "Size: error(%s)\n", err)
conn.writeMessage(450, fmt.Sprint("path", path, "not found"))
} else {
conn.writeMessage(213, strconv.Itoa(int(stat.Size())))
Expand Down

0 comments on commit 5d8b38b

Please sign in to comment.