Commit Graph

153 Commits

Author SHA1 Message Date
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
Florian Goetghebeur
827e50c0bd Add support for append (APPE) command 2020-03-10 11:43:17 +01: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
Julian Kornberger
c1312a7102 Correctly parse symlink (#152)
fixes #151
2019-06-24 10:48:59 +02:00
Gary Kim
8f5b34ce00 Complete Implicit FTPS support (#143)
feat: complete implicit ftps support
2019-05-19 22:39:11 +02:00
John Episcopo
e6e290ca7f Added initial logic and tests for the Walker 2019-05-01 17:00:01 +01:00
Alexander Pevzner
6a014d5e22 Add DialWithDialFunc to specify dial function used for both control and data connections (#140)
Add DialWithDialFunc to specify dial function used for both control and data connections

If used DialWithNetConn, DialWithNetConn takes precedence for
the control connection, while data connections will be established
using function specified with the DialWithDialFunc option
2019-04-27 18:36:46 +02:00
Julien Laffaye
e6de3d35bf Replace DialWithOptions with Dial
No need for a dedicated function as Dial can take no options.
2019-04-23 14:04:25 +02:00
Julien Laffaye
8b7b512afb Add DialWithDebugOutput to log commands. 2019-04-17 13:16:26 +02:00
Julien Laffaye
52d3001130 Specify that a server conn is not concurrent safe.
Fixes #128
2019-04-11 17:57:07 +02:00
Julien Laffaye
04b1878733 Add DialWithOptions
DialWithOptions accept a variadic number of options, allowing to
introduce more options in the fure without breaking the API.
2019-04-10 20:25:16 +02:00
Julien Laffaye
f75dead520 error strings should not be capitalized (ST1005) 2019-01-22 14:50:39 +01:00
Julien Laffaye
509a294b60 Add missing error check in RemoveDirRecur 2019-01-22 14:47:31 +01:00
Vladimir Buyanov
3f6433f7ea Workaround for FTP servers, that does not support UTF8 option. (#120)
* Workaround for FTP servers, that does not support UTF8 option.
2018-08-08 23:16:05 +02:00
Shannon Wynter
4772add9d0 Make it possible to specify what timezone to parse timestamps in 2018-03-20 15:07:44 +10:00
Nick Craig-Wood
8aeb589fce Parse IP address returned with PASV to fix load balanced FTP servers
Fixes #114
2018-02-04 16:02:56 +00:00
Julien Laffaye
83891dbe00
Merge pull request #110 from digineo/time-parsing
Fix time parsing and reduce syscalls
2018-01-05 08:56:08 +01:00
Julian Kornberger
38ce06637b Fix golint warning 2018-01-04 15:23:55 +01:00
Julian Kornberger
352a1d8821 Fix time parsing and reduce syscalls
closes #109
2018-01-04 13:28:55 +01:00
Julian Kornberger
f5cdbb9f1e Use net.TCPAddr to extract remote IP address 2017-08-12 01:24:47 +02:00
Joe
479d87b91a added recursively deleting folders
added tests for recursive delete

added change dir to fix test + refactor

fixed path issues

changes directory now instead of deleting by path

proftpd fix

added file edge case + more tests

added directory does not exist test

added correct directory after delete test

fixed correct directory test

renamed test directories + files

missed a renamed
2017-06-13 21:21:50 +01:00
Davide D'Agostino
980e2e09a5 Document that closing two times doesn't do anything 2017-05-04 19:03:56 -07:00
Davide D'Agostino
cb362c4101 Rename connClosed -> closed 2017-05-04 17:46:41 -07:00
Davide D'Agostino
7e3820b35d Address comments 2017-05-04 13:03:00 -07:00
Davide D'Agostino
58864d889b Avoid forever lock
If we close the connection two times the second time will hang forever waiting for a server code.
2017-05-01 18:56:43 -07:00
Julian Kornberger
569481fc3b Add SetDeadline to Response
closes #70
2017-04-15 12:18:04 +02:00
Julien Laffaye
7b85eb4638 Document ServerConn is not safe for concurrent use.
Mention textproto.Error so users can access the error code via type
assertion (issue #78).
2017-03-04 13:34:31 +01:00
mappu
28c104197d ftp: fix OPTS UTF8 ON for Filezilla Server
Closes #77
2017-03-03 17:14:13 +13:00
Vahid Sohrabloo
7e0dbe8c48 Add more test in FileSize 2017-02-20 09:04:20 +03:30
Vahid Sohrabloo
468423d44a Change file Size type from int to int64 and add test for it 2017-02-20 00:13:08 +03:30
vahid-sohrabloo
7bbfa218f9 Add Size Command 2017-02-19 17:14:20 +03:30
Julien Laffaye
de604c9776 Expose disableEPSV
Fixes #71
2017-02-05 21:02:16 +01:00
Julian Kornberger
47d41e8ddd Switch to UTF-8 after login
closes #72
2017-02-04 12:24:16 +01:00
Julian Kornberger
04544dbe82 Use MLST if supported
closes #46
2017-01-29 16:38:35 +01:00
Julien Laffaye
5a8b8eeb12 Merge pull request #66 from zeast/master
use utf8 default
2017-01-20 09:08:54 +01:00
zeast
bb08d6425f use utf8 default 2017-01-09 11:45:58 +08:00
Julian Kornberger
8082b59766 Refactoring the line parsing 2016-12-31 18:20:29 +01:00
Svett Ralchev
08566066b1 Fix incorrect filename parsing
When the file creation year, file size and filename contains the same
substring the parsed filename should contains only the correct filename
2016-12-29 00:37:08 +00:00
Julien Laffaye
988909ab28 Disable EPSV for tests.
Also disable it for next attempts when it failed.
2016-11-24 14:49:16 +01:00
Julien Laffaye
17dda2a76c Merge pull request #59 from digineo/close-fix
Add missing Close() before return
2016-11-24 10:15:47 +01:00
Julian Kornberger
73c8ae2c86 Add missing Close() before return 2016-11-18 01:20:19 +01:00
codeman
6a290aff81 fix ls bug for file or folder name includes multiple spaces 2016-03-10 15:56:39 +08:00
Julien Laffaye
0e072be722 Merge pull request #43 from HnH/master
ServerConn::openDataConn() recursively tries to use EPSV and PASV.
2016-02-27 11:10:24 +01:00
Ludovic Fauvet
b8e5af955b Fix a crash with pasv invalid responses 2016-02-08 10:32:55 +01:00
Julian Kornberger
1fc6b70adc Another fix for the line parser 2015-12-28 12:17:09 +01:00
Julian Kornberger
107079411b Do not crash on invalid lines 2015-12-28 00:12:10 +01:00
Сергей Трейнис
e252713eb1 ServerConn::openDataConn() recursively tries to use EPSV and PASV. 2015-12-02 15:06:05 +02:00
Julien Laffaye
ff69fe44f1 Make gofmt and golint happy. 2015-11-30 12:22:16 +01:00
Julian Kornberger
b9430bdb4a Avoid strings.Split
This results in less function calls.
2015-08-29 13:20:47 +02:00
Andy Balholm
95346071de Add support for directory listings in MS-DOS DIR format. 2015-08-24 16:03:52 -07:00
Julien Laffaye
c741076986 Merge pull request #35 from digineo/code_optimizations
Some code optimizations
2015-08-18 23:43:34 +02:00
Julien Laffaye
b33f6e0005 Fix EPSV for domains with multiple A entries.
We can not use the DNS name to open the data connection, as we might get
another IP than the current host from the DNS resolution.
2015-08-18 23:38:53 +02:00
Julian Kornberger
3a78f26034 Some code optimizations 2015-08-18 23:34:52 +02:00
Julian Kornberger
72db6844f1 Improve line parsing 2015-08-18 22:33:04 +02:00
Julien Laffaye
e6587b1638 Merge pull request #31 from digineo/listings
Add support for more listing formats
2015-08-18 19:17:10 +02:00
Julien Laffaye
e987451f99 SplitHostPort before connecting to the remote.
This, way, we dont have to cleanup the tcp connection if SplitHostPort fails.
2015-08-18 19:00:56 +02:00
Julian Kornberger
d827b56882 Unexport SetTime and SetSize 2015-08-18 18:54:40 +02:00
Julian Kornberger
4c910c8b22 Add support for a third listing format 2015-08-18 18:54:40 +02:00
Julian Kornberger
94120171fb Add support for another listing format 2015-08-18 18:54:40 +02:00
Julien Laffaye
a6e47bb27d Merge branch 'ipv6' of https://github.com/stacktic/ftp into stacktic-ipv6
Conflicts:
	ftp.go
2015-08-18 18:52:29 +02:00
Julien Laffaye
a5b2614a99 Merge pull request #8 from dsluis/master
Changing expected status response for Logout call
2015-08-18 18:13:03 +02:00
Julien Laffaye
061d4ea288 Merge pull request #13 from stacktic/rest
Add support for the REST command
2015-08-18 18:05:20 +02:00
Dan Goldsmith
9a62d18b47 Copy Paste Error / Typo
Error Created in pasv() states EPSV rather than PASV
2015-04-23 14:02:53 +01:00
Julien Laffaye
a9410e3e51 Implements timeouts.
Added DialTimeout and Dial functions.
Fixes issue #27.
2015-03-16 23:45:56 +01:00
Julien Laffaye
5807e676a3 Add comments to make golint happy. 2015-03-05 11:57:38 +01:00
Julien Laffaye
816e28448f Specify the fields to make govet happy. 2015-03-05 11:49:26 +01:00
Peter Nguyen
a595f7d8e4 Changed to using ReadResponse instead of ReadCodeLine for cmdDataConn 2014-10-30 11:55:46 +01:00
jfbus
d54ea712cb Allow multi-line 226 responses to STOR commands - fixes #17 2014-03-25 09:35:34 +01:00
Ludovic Fauvet
fb61796944 Handle multi-line 226 status code 2014-02-18 17:01:20 +01:00
Ludovic Fauvet
7a3697af8c PASS command may be optional if the server answers 230 after issuing USER 2014-02-18 13:19:43 +01:00
Arnaud Ysmal
6bad3e176c Try EPSV when PASV fails 2013-12-05 19:29:22 +01:00
Arnaud Ysmal
8d3a48a8c7 The REST command must precede RETR/STOR 2013-12-05 00:09:55 +01:00
Arnaud Ysmal
a3bb5b8714 Use net.JoinHostPort and net.SplitHostPort 2013-12-04 23:58:02 +01:00
Arnaud Ysmal
691fac98af Force EPSV for IPv6 hosts and fix split of IPv6:port 2013-12-04 23:57:46 +01:00
Bob Uhl
a40f117d27 Added NLST-equivalent command 2013-12-03 17:09:55 -07:00
Daniel Sluis
169efda0b5 Changing expected status response for Logout call 2013-10-18 09:30:28 -07:00
Julien Laffaye
962edd16c2 Remove obsolete comment. 2013-09-07 18:49:50 +02:00
Julien Laffaye
1b161dcaad gofmt ftp.go 2013-09-07 18:48:40 +02:00
Gerben Castel
9fdb4d975a PASV support 2013-09-04 14:54:57 +02:00
SunRunAway
65a25a2848 do ReadCodeLine in Close() @ ReadCloser 2013-07-10 18:18:32 +08:00
SunRunAway
60f85a4eb0 Merge branch 'feature/connect' 2013-07-08 13:59:53 +08:00
SunRunAway
66a09f43d5 use ReadResponse @Connect 2013-07-08 13:48:11 +08:00
SunRunAway
6416febc89 add Time for Entry 2013-07-08 13:21:43 +08:00
Julien Laffaye
732309446f Use strings.TrimSpace() instead of strings.Trim(). 2013-05-20 01:30:03 +02:00
Julien Laffaye
b82b87bce2 Fix spelling. 2013-05-20 01:20:29 +02:00
Julien Laffaye
f23c3ddfab Added feature discovery as per RFC 2389. 2013-05-19 21:54:57 +02:00
Julien Laffaye
2257d14f75 Use ReadResponse instead of ReadCodeLine.
ReadResponse deals with multi-lines reponse, ReadCodeLine does not.
While I'm here, use the cmd() helper in epsv() method.
2013-05-19 21:23:29 +02:00
Julien Laffaye
91fc6ada34 Added Logout() method. 2013-05-19 21:15:23 +02:00
Julien Laffaye
e00e1f11a0 Revise godoc comments. 2013-05-19 19:54:14 +02:00
Julien Laffaye
ebf946ada5 Switch to binary mode once logged-in.
Data transfer in binary mode works for both ASCII and binary (such as JPEG
images) files. Therefore it should be the default.

Fixes #3
2013-05-08 17:46:48 +02:00
Julien Laffaye
d69e9326f4 Set the size of the entry in List() 2013-02-17 10:03:46 +01:00
jlaffaye
47b339b57b Update to latest Go weekly. 2011-12-27 22:50:50 +01:00
jlaffaye
6110501482 Added CurrentDir() and ChangeDirToParent()
Added more tests.
2011-09-07 16:52:52 +02:00
jlaffaye
68f080c45f Returns a textproto.Error
It easier for the client to extract the code and message with type assertions.
2011-09-06 19:15:39 +02:00
jlaffaye
af6f5aac6a Add helpers functions to cleanup code. 2011-09-06 19:12:22 +02:00
jlaffaye
6aaa275d08 Login() is a function on its own.
It allows to try multiple logins without closing the connection.
Drop the useless ConnectAnonymous.
2011-09-06 18:27:30 +02:00
jlaffaye
b70c76ed28 More commands and their tests.
Delete()
MakeDir()
RemoveDir()
2011-09-06 00:02:01 +02:00
jlaffaye
a87255661d Better error handling, new commands.
The code is no safer.
Added Stor(), Rename(), NoOp()
Improved Retr()
Added client tests (requires a ftp server on localhost)
2011-09-05 23:36:14 +02:00
jlaffaye
faca79d4ea List() takes an argument. 2011-05-08 13:08:31 +01:00