ServerDirectory openFTP problems

russell.allen at firebirdmedia.com russell.allen at firebirdmedia.com
Fri Oct 9 14:18:32 UTC 1998


G'day!

I've been really enjoying the new email client and web browser, (there's a definate buzz in emailing the Squeak mailing list from within Squeak) and have been delving into Squeak's networking code.  However, trying to add my free Xoom (www.xoom.com) web account to the file list as a server, I was having problems when openFTP was changing to passive mode.

The problem was the code in the method openFTP in class ServerDirectory:

	so sendCommand: 'PASV'.
	resp _ (so getResponseUpTo: FTPSocket crLf) first.
		"Tells which port on server to use for data"
	Transcript show: resp; cr.
	(resp beginsWith: '227 Entering Passive Mode (') ifFalse: [
		so sendCommand: 'QUIT'.
		so destroy.
		^ self error: 'can''t get into passive mode'].

Instead of returning '227 Entering Passive Mode (', Xoom returned: '227        PASV(', which broke the method.

changing to:

	so sendCommand: 'PASV'.
	resp _ (so getResponseUpTo: FTPSocket crLf) first.
		"Tells which port on server to use for data"
	Transcript show: resp; cr.
	(resp beginsWith: '227 ') ifFalse: [ "Check for Entering Passive Mode"
		so sendCommand: 'QUIT'.
		so destroy.
		^ self error: 'can''t get into passive mode'].

seems to fix the problem.

I don't know whether this is only a Xoom problem or not, but my ability to solve this problem in a complicated piece of software such as Squeak fairly quickly and simply is nothing short of amazing.  Why isn't all progamming like this?

Thanks,

Russell





More information about the Squeak-dev mailing list