Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 1xx as expected response when requesting a data connection #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ftps.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (ftps *FTPS) List() (entries []Entry, err error) {

// TODO add support for MLSD

dataConn, err := ftps.requestDataConn("LIST -a", 150) // TODO use also -L to resolve links?
dataConn, err := ftps.requestDataConn("LIST -a", 1) // TODO use also -L to resolve links?
if err != nil {
return
}
Expand Down Expand Up @@ -304,7 +304,7 @@ func (ftps *FTPS) parseEntryLine(line string) (entry *Entry, err error) {

func (ftps *FTPS) StoreFile(remoteFilepath string, data []byte) (err error) {

dataConn, err := ftps.requestDataConn(fmt.Sprintf("STOR %s", remoteFilepath), 150)
dataConn, err := ftps.requestDataConn(fmt.Sprintf("STOR %s", remoteFilepath), 1)
if err != nil {
return
}
Expand All @@ -330,7 +330,7 @@ func (ftps *FTPS) StoreFile(remoteFilepath string, data []byte) (err error) {

func (ftps *FTPS) RetrieveFileData(remoteFilepath string) (data []byte, err error) {

dataConn, err := ftps.requestDataConn(fmt.Sprintf("RETR %s", remoteFilepath), 150)
dataConn, err := ftps.requestDataConn(fmt.Sprintf("RETR %s", remoteFilepath), 1)
if err != nil {
return
}
Expand Down Expand Up @@ -360,7 +360,7 @@ func (ftps *FTPS) RetrieveFileData(remoteFilepath string) (data []byte, err erro

func (ftps *FTPS) RetrieveFile(remoteFilepath, localFilepath string) (err error) {

dataConn, err := ftps.requestDataConn(fmt.Sprintf("RETR %s", remoteFilepath), 150)
dataConn, err := ftps.requestDataConn(fmt.Sprintf("RETR %s", remoteFilepath), 1)
if err != nil {
return
}
Expand Down