 |
Changeset 3469
- Timestamp:
- 04/27/08 13:45:00
(7 months ago)
- Author:
- lmartin92
- Message:
MLST works now(or if fails goes back to regular LIST)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3467 |
r3469 |
|
| 756 | 756 | // Try to pull out the (possibly not parenthesized) address. |
|---|
| 757 | 757 | auto r = Regex(`\([^0-9][^0-9][^0-9](\d+)[^0-9]\)`); |
|---|
| 758 | | debug(UnitTest) |
|---|
| 759 | | { |
|---|
| 760 | | Stdout(response.message).newline.flush; |
|---|
| 761 | | Stdout(response.message[0 .. find(response.message, '\n') ]).newline.flush; |
|---|
| 762 | | } |
|---|
| 763 | 758 | if ( !r.test(response.message[0 .. find(response.message, '\n') ])) |
|---|
| 764 | 759 | throw new FtpException("CLIENT: Unable to parse address", "501"); |
|---|
| … | … | |
| 777 | 772 | auto response = this.readResponse("227"); |
|---|
| 778 | 773 | |
|---|
| 779 | | debug(UnitTest) |
|---|
| 780 | | { |
|---|
| 781 | | Stdout(response.message).newline.flush; |
|---|
| 782 | | Stdout(response.message[0 .. find(response.message, '\n') ]).newline.flush; |
|---|
| 783 | | } |
|---|
| 784 | 774 | // Try to pull out the (possibly not parenthesized) address. |
|---|
| 785 | 775 | auto r = Regex(`(\d+),\s*(\d+),\s*(\d+),\s*(\d+),\s*(\d+)(,\s*(\d+))?`); |
|---|
| … | … | |
| 932 | 922 | |
|---|
| 933 | 923 | // Try it if it could/might/maybe is supported. |
|---|
| 934 | | /*if (this.isSupported("MLST")) |
|---|
| | 924 | if (this.isSupported("MLST")) |
|---|
| 935 | 925 | { |
|---|
| 936 | 926 | mlsd_success = true; |
|---|
| … | … | |
| 964 | 954 | { |
|---|
| 965 | 955 | // Parse each line exactly like MLST does. |
|---|
| 966 | | FtpFileInfo info = this.parseMlstLine(line); |
|---|
| 967 | | if (info.name.length > 0) |
|---|
| 968 | | dir ~= info; |
|---|
| | 956 | try |
|---|
| | 957 | { |
|---|
| | 958 | FtpFileInfo info = this.parseMlstLine(line); |
|---|
| | 959 | if (info.name.length > 0) |
|---|
| | 960 | dir ~= info; |
|---|
| | 961 | } |
|---|
| | 962 | catch(FtpException) |
|---|
| | 963 | { |
|---|
| | 964 | return this.sendListCommand(path); |
|---|
| | 965 | } |
|---|
| 969 | 966 | } |
|---|
| 970 | 967 | |
|---|
| … | … | |
| 972 | 969 | } |
|---|
| 973 | 970 | // Fall back to LIST. |
|---|
| 974 | | else*/ |
|---|
| | 971 | else |
|---|
| 975 | 972 | return this.sendListCommand(path); |
|---|
| 976 | 973 | } |
|---|
| … | … | |
| 1268 | 1265 | if (filename_pos == line.length) |
|---|
| 1269 | 1266 | throw new FtpException("CLIENT: Bad syntax in MLSx response", "501"); |
|---|
| | 1267 | /*{ |
|---|
| | 1268 | info.name = ""; |
|---|
| | 1269 | return info; |
|---|
| | 1270 | }*/ |
|---|
| 1270 | 1271 | |
|---|
| 1271 | 1272 | info.name = line[filename_pos .. line.length]; |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic