[squeak-dev] The Trunk: Network-eem.92.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Oct 22 17:37:55 UTC 2010


Eliot Miranda uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-eem.92.mcz

==================== Summary ====================

Name: Network-eem.92
Author: eem
Time: 22 October 2010, 10:37:43.088 am
UUID: b673bf6a-f14f-4975-b1c4-edd30eeb521d
Ancestors: Network-nice.91

fix an unused block slip in FTPClient>>lookForCode:ifDifferent:.

=============== Diff against Network-nice.91 ===============

Item was changed:
  ----- Method: FTPClient>>lookForCode:ifDifferent: (in category 'private protocol') -----
  lookForCode: code ifDifferent: handleBlock 
  	"We are expecting a certain numeric code next.  
  	However, in the FTP protocol, multiple lines are allowed.  
  	If the response is multi-line, the fourth character of the first line is a  
  	$- and the last line repeats the numeric code but the code is followed by 
  	a space. So it's possible that there are more lines left of the last response that 
  	we need to throw away. We use peekForAll: so that we don't discard the
  	next response that is not a continuation line."
  
  	
  	"check for multi-line response"
  	(self lastResponse size > 3
  			and: [(self lastResponse at: 4) = $-])
+ 		ifTrue: "Discard continuation lines."
- 		ifTrue: ["Discard continuation lines."
  			[ | headToDiscard |
  			headToDiscard := self lastResponse first: 4.
  			[[self stream peekForAll: headToDiscard]
  				whileTrue: [self stream nextLine]]
  				on: Exception
+ 				do: [:ex | ^handleBlock value: nil]].
- 				do: [:ex | ^handleBlock value: nil]]].
  	^ super lookForCode: code ifDifferent: handleBlock!




More information about the Squeak-dev mailing list