On Tue, 30 Aug 2016, commits@source.squeak.org wrote:
Tim Felgentreff uploaded a new version of Network to project The Trunk: http://source.squeak.org/trunk/Network-tfel.184.mcz
==================== Summary ====================
Name: Network-tfel.184 Author: tfel Time: 30 August 2016, 11:53:57.083946 am UUID: b90acf7c-5796-a347-8939-59955c0588dd Ancestors: Network-tfel.183, Network-ul.183
merge a few fixes from Squeakland Etoys.
- ServerDirectories always use forward slashes, even on windows
- FTPClient connections should go through the NetNameResolver
- sockets can only accept if they are connected.
=============== Diff against Network-ul.183 ===============
Item was changed: ----- Method: FTPClient>>openPassiveDataConnection (in category 'private protocol') ----- openPassiveDataConnection | portInfo list dataPort remoteHostAddress | self sendCommand: 'PASV'. self lookForCode: 227 ifDifferent: [:response | (TelnetProtocolError protocolInstance: self) signal: 'Could not enter passive mode: ' , response].
- portInfo := (self lastResponse findTokens: '()') at: 2. list := portInfo findTokens: ','.
- remoteHostAddress := NetNameResolver addressForName: (list at: 1)
, '.'
, (list at: 2) , '.'
, (list at: 3) , '.'
, (list at: 4) timeout: 30.
- remoteHostAddress := ByteArray
with: (list at: 1) asNumber
with: (list at: 2) asNumber
with: (list at: 3) asNumber
dataPort := (list at: 5) asNumber * 256 + (list at: 6) asNumber.with: (list at: 4) asNumber.
- self openDataSocket: remoteHostAddress port: dataPort!
- self openDataSocket: remoteHostAddress port: dataPort
- !
Item was changed: ----- Method: ServerDirectory>>isRoot (in category 'testing') ----- isRoot
- ^ directory = '/'!
- ^directory = (String with: self pathNameDelimiter)!
Item was changed: ----- Method: Socket>>waitForAcceptFor:ifTimedOut: (in category 'waiting') ----- waitForAcceptFor: timeout ifTimedOut: timeoutBlock "Wait and accept an incoming connection" self waitForConnectionFor: timeout ifTimedOut: [^timeoutBlock value].
- ^self isConnected
Does this change actually do anything? Won't the previous line return when the socket is not connected?
Levente
ifTrue:[self accept]
- !
- ^self accept!