Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-ul.43.mcz ==================== Summary ==================== Name: Network-ul.43 Author: ul Time: 14 December 2009, 2:59:36 am UUID: e14321f4-7104-4745-bda1-c3138b4f537f Ancestors: Network-ar.42 - fix: use isKindOf: String instead of class == String =============== Diff against Network-ar.42 =============== Item was changed: ----- Method: HTTPSocket class>>useProxyServerNamed:port: (in category 'proxy settings') ----- useProxyServerNamed: proxyServerName port: portNum "Direct all HTTP requests to the HTTP proxy server with the given name and port number." proxyServerName ifNil: [ "clear proxy settings" self httpProxyServer: nil. self httpProxyPort: 80. ^ self]. proxyServerName isString ifFalse: [self error: 'Server name must be a String or nil']. self httpProxyServer: proxyServerName. self httpProxyPort: portNum. + (self httpProxyPort isKindOf: String) ifTrue: [HTTPPort := portNum asNumber]. - self httpProxyPort class == String ifTrue: [HTTPPort := portNum asNumber]. self httpProxyPort ifNil: [self httpProxyPort: self defaultPort].! |
2009/12/14 <[hidden email]>:
> Levente Uzonyi uploaded a new version of Network to project The Trunk: > http://source.squeak.org/trunk/Network-ul.43.mcz > > ==================== Summary ==================== > > Name: Network-ul.43 > Author: ul > Time: 14 December 2009, 2:59:36 am > UUID: e14321f4-7104-4745-bda1-c3138b4f537f > Ancestors: Network-ar.42 > > - fix: use isKindOf: String instead of class == String > > =============== Diff against Network-ar.42 =============== > > Item was changed: > ----- Method: HTTPSocket class>>useProxyServerNamed:port: (in category 'proxy settings') ----- > useProxyServerNamed: proxyServerName port: portNum > "Direct all HTTP requests to the HTTP proxy server with the given name and port number." > > proxyServerName ifNil: [ "clear proxy settings" > self httpProxyServer: nil. > self httpProxyPort: 80. > ^ self]. > > proxyServerName isString > ifFalse: [self error: 'Server name must be a String or nil']. > self httpProxyServer: proxyServerName. > > self httpProxyPort: portNum. > + (self httpProxyPort isKindOf: String) ifTrue: [HTTPPort := portNum asNumber]. > - self httpProxyPort class == String ifTrue: [HTTPPort := portNum asNumber]. why not just do: portNum ifNotNil: [ self httpProxyPort: portNum asNumber. ] ifNil: [ ... ] and get rid of class checking altogether? > self httpProxyPort ifNil: [self httpProxyPort: self defaultPort].! > > > -- Best regards, Igor Stasenko AKA sig. |
On Mon, 14 Dec 2009, Igor Stasenko wrote:
> why not just do: > > portNum ifNotNil: [ > self httpProxyPort: portNum asNumber. > ] ifNil: [ ... ] > > and get rid of class checking altogether? > I didn't look at the code at all, just fixed the issue some way. #isString would be better than the class check, but your idea is even better. The "funny" thing is that the HTTPPort variable is never read (I guess this is the reason why this bug was not fixed before), so something is broken here. Levente > > > > -- > Best regards, > Igor Stasenko AKA sig. > > |
Free forum by Nabble | Edit this page |