Skip to content

Commit

Permalink
ignore eof ftp error
Browse files Browse the repository at this point in the history
  • Loading branch information
glaslos committed Dec 26, 2024
1 parent b928813 commit e650c46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion protocols/tcp/ftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bufio"
"context"
"fmt"
"io"
"log/slog"
"net"
"strconv"
Expand Down Expand Up @@ -77,9 +78,12 @@ func HandleFTP(ctx context.Context, conn net.Conn, md connection.Metadata, logge
return err
}
msg, err := server.read(logger, h)
if len(msg) < 4 || err != nil {
if err != nil || err != io.EOF {
return err
}
if len(msg) < 4 {
continue
}
cmd := strings.ToUpper(msg[:4])

logger.Info(
Expand Down

0 comments on commit e650c46

Please sign in to comment.