The Trunk: WebClient-Core-topa.105.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: WebClient-Core-topa.105.mcz

commits-2
Tobias Pape uploaded a new version of WebClient-Core to project The Trunk:
http://source.squeak.org/trunk/WebClient-Core-topa.105.mcz

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

Name: WebClient-Core-topa.105
Author: topa
Time: 2 May 2017, 4:14:21.755129 pm
UUID: 769fdf43-8b26-4ae0-83f2-e38d3ddb74d8
Ancestors: WebClient-Core-jr.104

Remove the retry code as it was a hack anyways and now masked legitimate SqueakSSLCertificateError on some Linux

=============== Diff against WebClient-Core-jr.104 ===============

Item was changed:
  ----- Method: WebClient>>connect (in category 'initialize') -----
  connect
  "Connect the client to a web server. Returns nil if successful,
  a WebResponse if a proxy CONNECT request fails."
 
  | actualServer actualPort |
 
  "Determine which server to connect to (proxy or real)"
  proxyServer ifNil:[
  actualServer := self serverName.
  actualPort := self serverPort.
  ] ifNotNil:[
  actualServer := self proxyServerName.
  actualPort := self proxyServerPort.
  ].
 
  "Check if we can use the same stream or if we need to reconnect"
  (stream notNil
  and:[stream isConnected
  and:[lastServer = actualServer
  and:[lastPort = actualPort
  and:[lastScheme = scheme]]]]) ifTrue:[^nil].
 
  self close.
  lastServer := actualServer.
  lastPort := actualPort.
  lastScheme := scheme.
  stream := SocketStream openConnectionToHostNamed: lastServer port: lastPort.
  stream timeout: timeout.
  "Perform ssl initialization if necessary"
+ scheme = 'https' ifTrue:[^self sslConnect].
- scheme = 'https' ifTrue:[self retryOnce: [^self sslConnect]].
  ^nil!

Item was removed:
- ----- Method: WebClient>>retryOnce: (in category 'initialize') -----
- retryOnce: aTryBlock
- " Retry the block once if it failes,
- except for direct network errors.
- This can help in cases like temporary failing
- SqueakSSL primitives"
- | again |
- again := true.
- [^ aTryBlock value.
- ] on: Error do: [:e |
- ((e isKindOf: NetworkError) or: [again not])
- ifTrue: [e pass]
- ifFalse: [again := false. e retry]].!

Item was changed:
  ----- Method: WebClient>>writeRequest:on: (in category 'sending') -----
  writeRequest: request on: aStream
  "Write all the request headers on the given stream"
 
+ self writeRequestLine: request on: aStream.
+ self writeHeadersFor: request on: aStream.
+ self writeCookiesFor: request on: aStream.
+ aStream crlf.
+ aStream flush.!
- self retryOnce: [
- self writeRequestLine: request on: aStream.
- self writeHeadersFor: request on: aStream.
- self writeCookiesFor: request on: aStream.
- aStream crlf.
- aStream flush].!