Skip to content

Commit

Permalink
immediately close the control connection if a client send a line too …
Browse files Browse the repository at this point in the history
…long (fclairamb#216)

c.end() only close the transfer connection
  • Loading branch information
drakkan authored Dec 27, 2020
1 parent cfd1766 commit 472e9a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,12 @@ func (c *clientHandler) HandleCommands() {
lineSlice, isPrefix, err := c.reader.ReadLine()

if isPrefix {
err = c.conn.Close()

if c.debug {
c.logger.Warn("Received line too long, disconnecting client",
"size", len(lineSlice))
"line_size", len(lineSlice),
"close_err", err)
}

return
Expand Down

0 comments on commit 472e9a1

Please sign in to comment.