Re: CFReadStreamOpen 550 error
Re: CFReadStreamOpen 550 error
- Subject: Re: CFReadStreamOpen 550 error
- From: Mark Pauley <email@hidden>
- Date: Sat, 1 Mar 2008 13:52:06 -0800
What does the traffic on the wire look like?
Can you
sudo tcpdump -s0 -A host <ftphost>
and attach the output while you connect?
I'll see if I can fake up a server that thinks for a long time before
responding...
_Mark
On Feb 29, 2008, at 10:38 PM, Mike wrote:
I have a very slow FTP server I am trying to download a file from.
Logging in in passive mode can take anywhere between 30 seconds to 2
minutes, but login never fails given enough time.
When I open a CFReadStreamRef for downloading a file via
CFReadStreamCreateWithFTPURL and then loop checking
CFReadStreamGetStatus immediately after opening it, it first returns
CFStreamStatusOpening and a few seconds later fails with
kCFStreamStatusError, which I believe is because the FTP server
doesn't respond immediately.
Is there a way to set the timeout on the stream's opening so that it
will wait longer for really slow servers? I've verified everything
else is correct: user name, password, path to file, the stream gets
created and opens properly.
Here is my code:
// Make URL to file...
ftpURL = CFURLCreateWithString( kCFAllocatorDefault,
kmaCurrentVersionsFIleURLCFString, NULL );
if( ftpURL )
{
// Make Read stream...
readStreamCFRef = CFReadStreamCreateWithFTPURL(kCFAllocatorDefault,
ftpURL );
if( readStreamCFRef )
{
// Set properties
streamPropertySet = CFReadStreamSetProperty( readStreamCFRef,
kCFStreamPropertyFTPUserName, CFSTR( "michael1" ) );
streamPropertySet = CFReadStreamSetProperty( readStreamCFRef,
kCFStreamPropertyFTPPassword, CFSTR( "a1a1a1" ) );
streamPropertySet = CFReadStreamSetProperty( readStreamCFRef,
kCFStreamPropertyFTPUsePassiveMode, kCFBooleanTrue );
streamPropertySet = CFReadStreamSetProperty( readStreamCFRef,
kCFStreamPropertyFTPResourceSize,
(CFNumberRef)kmaCurrentVersionsFIleSizeInBytes );
streamPropertySet = CFReadStreamSetProperty( readStreamCFRef,
kCFStreamPropertyFTPFetchResourceInfo, kCFBooleanFalse );
streamPropertySet = CFReadStreamSetProperty( readStreamCFRef,
kCFStreamPropertyFTPFileTransferOffset, 0 );
streamPropertySet = CFReadStreamSetProperty( readStreamCFRef,
kCFStreamPropertyFTPAttemptPersistentConnection, kCFBooleanTrue );
// Open the stream...
streamOpened = CFReadStreamOpen( readStreamCFRef );
if( streamOpened )
{
// Wait for stream open success
while( ( streamStatus != kCFStreamStatusOpen ) && ( streamStatus !=
kCFStreamStatusError ) )
{
// Wait for open to complete...
streamStatus = CFReadStreamGetStatus( readStreamCFRef );
}
I get kCFStreamStatusError at this point and CFReadStreamGetError
returns 6 and 550 for the domain & error which appears to be "SSL/
TLS required on the control channel". Is there anything I else I
need to set in order to avoid this error?
Thanks,
Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden