Re: CFReadStreamOpen 550 error
Re: CFReadStreamOpen 550 error
- Subject: Re: CFReadStreamOpen 550 error
- From: Mike <email@hidden>
- Date: Sun, 02 Mar 2008 15:31:50 -0700
False alarm. I was getting distracted with the 550 error in the FTP
domain which is TLS, etc. when in fact it was a 550 dir not found error
because my ISP puts an additional directory at the root before my files.
I had missed the extra dir name in my URL.
It generally works for the most part although very rarely on occasion
the read on the stream will fail. I have mitigated this somewhat by
setting the flag to reuse connections to false to force a new connection
each time. But it does still fail for inexplicit reasons on very rare
occasions in which I just break out of my wait loop and tell the user to
try again. This is good enough for now.
Thanks.
Mike
Mark Pauley wrote:
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
_______________________________________________
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