Sun 26 Apr 2009 12:04:40 PM UTC, original submission:
NSURL throw an exception for url with spaces like:
ftp://ppftpuser:welcome@ftp01.penguingroup.com/Booksellers and Media/Covers/Covers/0143058436.jpg
("illegal character in path part")
GSFTPURLHandle doesn't not handle FTP Banner connect answer like the following one (I used the same URL):
<<
220-
Welcome to the Pearson ftp server ftp01.penguinputnam.com.
Please note that file times are based on GMT.
THE USE OF THIS SERVER IS RESTRICTED TO PEARSON ACTIVITIES ONLY.
ALL ACTIVITY ON THIS SERVER IS LOGGED. IF YOU DISAGREE WITH
THIS POLICY, PLEASE DISCONNECT NOW.
All unauthorized activity involving this server is subject to
criminal investigation.
You are permitted to use the materials posted on this site only
to market and promote the books identified. You may not license
these materials to or otherwise authorize use by third parties,
or incorporate any part of these materials in any new or different
work. Any use in breach of these restrictions is copyright
infringement.
The publisher has provided these materials without charge for
promotional purposes only. It is a violation of copyright to
alter or manipulate these materials in any way, or to charge
for their use.
220 165.193.130.66 FTP server ready
>>
A quick and dirty fix is replacing
<<
while ((line = [enumerator nextObject]) != nil)
{
if ([line length] > 4 && [line characterAtIndex: 3] != '-')
{
break;
}
}
>>
by
<<
while ((line = [enumerator nextObject]) != nil)
{
if ([line length] > 4 && [line characterAtIndex: 3] != '-')
{
if (state == cConnect && [line hasPrefix:@" "])
{
}
else
break;
}
}
>>
in -_control:
but the problem may come for server answers during other states.
|