Commit Graph

346 Commits

Author SHA1 Message Date
Nick Craig-Wood
c0343a706b Fix Stor() no longer reporting errors from the io.Reader passed in
This commit

4a68979b89 always return the ReadResponse error after an upload

Broke the error return from Stor().  If you attempt to upload a file
with Stor() and the io.Reader that you passed in returns an error,
this was not returned by the Stor() command leading the user to think
the file was uploaded correctly.

This was detected by rclone's unit tests and the exact commit was
pinpointed with git commit.

This commit fixes it by returning the error from io.Copy or the error
from ReadResponse - the latter if they are both set.

Fixes #198
2020-09-11 17:14:05 +01:00
Julien Laffaye
39e3779af0
Merge pull request #192 from drakkan/resp_error
try to read the server response after a failed upload
2020-08-12 10:35:50 -04:00
Nicola Murino
4a68979b89 always return the ReadResponse error after an upload 2020-08-06 16:44:05 +02:00
Julien Laffaye
c2ee4fa250
Merge pull request #178 from crazy-max/optional-utf8
Make "OPTS UTF8 ON" optional
2020-07-30 09:57:23 -04:00
Nicola Murino
08a1e2e380 try to read the server response after a failed upload
if the upload failed we still need to try to read the server
response otherwise if the failure is not due to a connection problem,
for example the server denied the upload for quota limits, we miss
the response and we cannot use the connection to send other commands

Here is what happen before this patch:

C->S STOR test_file1.dat
S->C 150 Using transfer connection
S->C 550 Could not transfer file: denying write due to space limit

the client does not read the above 550 response and send the next command, so
the response for the STOR response will be readed as response for the next
command
2020-07-30 14:55:31 +02:00
CrazyMax
696d865fa3
Opt-out 2020-07-28 21:13:33 +02:00
Julien Laffaye
a3536fc55e
Merge pull request #183 from jawr/walker_path_fix
Rework walker.Next
2020-07-28 14:05:16 -04:00
Julien Laffaye
e31b4effea
Merge pull request #188 from Techassi/typeentry-string
EntryType String() function
2020-07-28 13:54:05 -04:00
Julien Laffaye
13949d3891
Merge pull request #190 from ncw/fix-pureftpd
Workaround pure-ftpd connections failing with "Unknown command"
2020-07-20 15:47:10 -04:00
Nick Craig-Wood
6563ce9dff Workaround pure-ftpd connections failing with "Unknown command"
pure-ftpd 1.0.49-4 as supplied as part of Ubuntu 20.04 advertises UTF8
support in the FEAT command but the OPTS command fails to turn it on.

    OPTS UTF8 ON
    504 Unknown command

This patch introduces a workaround to ignore the error which enables
this library to work with this version of pure-ftpd. Filezilla appears
to ignore this error in a similar way.
2020-07-18 14:21:12 +01:00
Techassi
3e3979ddc6
Add String() function 2020-07-17 18:01:41 +02:00
Julien Laffaye
5d10dd64f6
Merge pull request #187 from novalagung/master
add documentation shortcut
2020-07-15 12:42:56 -04:00
Noval Agung Prayogo
ee0d349f0d
add documentation shortcut, to make user able to go there easlity without typing it 2020-07-15 12:50:26 +07:00
Julien Laffaye
55bbb372b8
Merge pull request #185 from digineo/code-improvements
Code improvements
2020-07-08 13:50:26 -04:00
Julian Kornberger
7ec48e555e Use subtests and assert() 2020-07-08 08:33:57 +02:00
Julian Kornberger
c6fe263756 Add status string for unknown status codes 2020-07-08 08:23:44 +02:00
Julian Kornberger
0d36957938 Update dependencies 2020-07-08 08:20:38 +02:00
jawr
226f00fd00 try and improve coveralls 2020-06-15 09:53:47 +09:00
jawr
06706f2625 Rework walker.Next to (hopefully) be clearer. Fix issues where it wouldn't correctly walk a directory with one file. Also prevent it trimming leading '/' from root. 2020-06-15 09:33:28 +09:00
Julien Laffaye
5563613968
Merge pull request #176 from vcraescu/fix_walk
fix_walk
2020-06-02 14:09:15 -04:00
CrazyMax
01c291065f
Move func 2020-05-05 21:04:03 +02:00
CrazyMax
83f3ade61d
Fix ftpMock 2020-05-05 13:34:35 +02:00
CrazyMax
0a6572881e
Udpate ftpMock 2020-05-05 13:22:37 +02:00
CrazyMax
c21b2b322e
Update tests 2020-05-05 13:08:53 +02:00
CrazyMax
60012218fd
Make "OPTS UTF8 ON" optional (#172) 2020-05-05 13:04:49 +02:00
Viorel Craescu
3b6697e5b6 fix_walk 2020-04-26 10:28:15 +03:00
Julien Laffaye
b9f3ade291 Merge branch 'master' of github.com:jlaffaye/ftp 2020-04-23 00:49:57 +02:00
Julien Laffaye
ac1574d383 Add DialWithExplicitTLS 2020-04-23 00:49:43 +02:00
Julien Laffaye
59f85871cf
Merge pull request #169 from flowrean/append-cmd
Add support for FTP append (APPE) command
2020-04-22 18:29:36 -04:00
Julien Laffaye
d4caf6ffca Add close on read example
Fixes #171
2020-03-31 16:49:19 +02:00
Julien Laffaye
041eae9a3d
Merge pull request #141 from johnepiscopo/add-walk
Adds the ability to walk through a directory tree
2020-03-13 11:03:37 -04:00
johnepiscopo
37a04759dd Fixed a typo so that we are no longer ignoring an error and am now using path.Join instead of fmt.Sprintf() 2020-03-10 14:26:54 +00:00
Florian Goetghebeur
827e50c0bd Add support for append (APPE) command 2020-03-10 11:43:17 +01:00
Florian Goetghebeur
adfb8ed9f3 Actually store file content in mock 2020-03-10 11:41:46 +01:00
Julien Laffaye
6841a2daa0 stale bot: ignore accepted issues 2020-03-09 18:13:36 +01:00
Julien Laffaye
e1b8fdd0dc Add stale bot 2019-12-17 23:19:57 -05:00
Julien Laffaye
a59fe673c9
Merge pull request #165 from xperimental/fix-travis
Fix Travis build
2019-10-25 13:51:06 -04:00
Robert Jacob
dfb8646068 Fix get of golint 2019-10-19 14:58:47 +02:00
Julien Laffaye
072f1b4f5a
Merge pull request #163 from xperimental/go-module
Add Go module definition
2019-10-18 14:46:50 -04:00
Robert Jacob
1fb6f135ee Run travis with current version. 2019-10-14 21:14:40 +02:00
Robert Jacob
c037483193 Create Go module. 2019-10-14 21:14:25 +02:00
Julian Kornberger
6aaa91c779 Run CI with currently supported Go versions (#159) 2019-08-28 13:37:36 -04:00
Julien Laffaye
7cd8b0bcf3 Fix spelling errors 2019-07-21 21:44:32 +02:00
Julien Laffaye
1c9975e197 gofmt 2019-07-21 21:36:15 +02:00
Ben Osborne
9bf9e0098a Improve readme (#154)
Improved the README.md file to include an example of storing and reading a file.
2019-07-18 21:16:16 +02:00
Julian Kornberger
c1312a7102 Correctly parse symlink (#152)
fixes #151
2019-06-24 10:48:59 +02:00
Julian Kornberger
9284a88df5 Support line with ACL permissions (#146)
closes #145
2019-05-22 12:26:03 +02:00
John Episcopo
74a8c4bcbc Renamed Step func to Next() as per PR comments 2019-05-20 08:56:38 +01:00
Gary Kim
8f5b34ce00 Complete Implicit FTPS support (#143)
feat: complete implicit ftps support
2019-05-19 22:39:11 +02:00
John Episcopo
434fa14f3d Added test to check the creation of the walker is 2019-05-02 09:47:29 +01:00