File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ func (c *clientHandler) HasTLSForControl() bool {
142142 return c .controlTLS
143143}
144144
145+ // GetLastCommand returns the last received command
146+ func (c * clientHandler ) GetLastCommand () string {
147+ return c .command
148+ }
149+
145150// HasTLSForTransfers returns true if the transfer connection is over TLS
146151func (c * clientHandler ) HasTLSForTransfers () bool {
147152 if c .server .settings .TLSRequired == ImplicitEncryption {
Original file line number Diff line number Diff line change 66 "testing"
77
88 "github.com/secsy/goftp"
9+ "github.com/stretchr/testify/assert"
910 "github.com/stretchr/testify/require"
1011)
1112
@@ -44,6 +45,11 @@ func TestConcurrency(t *testing.T) {
4445 waitGroup .Wait ()
4546}
4647
48+ func TestLastCommand (t * testing.T ) {
49+ cc := clientHandler {}
50+ assert .Empty (t , cc .GetLastCommand ())
51+ }
52+
4753func TestTLSMethods (t * testing.T ) {
4854 t .Run ("without-tls" , func (t * testing.T ) {
4955 cc := clientHandler {
You can’t perform that action at this time.
0 commit comments