[Pkg] The Trunk: UpdateStream-tpr.11.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Feb 19 03:25:43 UTC 2019

tim Rowledge uploaded a new version of UpdateStream to project The Trunk:

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

Name: UpdateStream-tpr.11
Author: tpr
Time: 18 February 2019, 7:25:41.894118 pm
UUID: 00e59d34-daaf-40f8-b4ee-306f21613bfc
Ancestors: UpdateStream-ul.10

Part of deprecating HTTPClient for 6.0
Stop using it

=============== Diff against UpdateStream-ul.10 ===============

Item was removed:
- ----- Method: AutoStart class>>checkForUpdates (in category '*UpdateStream') -----
- checkForUpdates
- 	| availableUpdate updateServer |
- 	HTTPClient isRunningInBrowser ifFalse: [ ^ self processUpdates ].
- 	availableUpdate := (Smalltalk namedArguments
- 		at: 'UPDATE'
- 		ifAbsent: [ '' ]) asInteger.
- 	availableUpdate ifNil: [ ^ false ].
- 	updateServer := Smalltalk namedArguments
- 		ifAbsent:
- 			[ Smalltalk namedArguments
- 				at: 'UPDATE_SERVER'
- 				ifAbsent: [ 'Squeakland' ] ].
- 	UpdateStreamDownloader default setUpdateServer: updateServer.
- 	^ SystemVersion checkAndApplyUpdates: availableUpdate!

Item was changed:
  ----- Method: UpdateStreamDownloader class>>newUpdatesOn:special:throughNumber: (in category 'fetching updates') -----
  newUpdatesOn: serverList special: indexPrefix throughNumber: aNumber
  	"Return a list of fully formed URLs of update files we do not yet have.  Go to the listed servers and look at the file 'updates.list' for the names of the last N update files.  We look backwards for the first one we have, and make the list from there.  tk 9/10/97
  	No updates numbered higher than aNumber (if it is not nil) are returned " 
  	| existing out maxNumber |
  	maxNumber := aNumber ifNil: [99999].
  	out := OrderedCollection new.
  	existing := SystemVersion current updates.
  	serverList do: [:server | | raw doc list char |
+ 		doc := HTTPSocket httpGet: 'http://' , server,indexPrefix,'updates.list'.
- 		doc := HTTPClient httpGet: 'http://' , server,indexPrefix,'updates.list'.
  		"test here for server being up"
  		doc class == RWBinaryOrTextStream ifTrue:
  			[raw := doc reset; contents.	"one file name per line"
  			list := self extractThisVersion: raw.
  			list reverseDo: [:fileName | | ff itsNumber |
  				ff := (fileName findTokens: '/') last.	"allow subdirectories"
  				itsNumber := ff initialIntegerOrNil. 
  				(existing includes: itsNumber)
  						(itsNumber == nil or: [itsNumber <= maxNumber])
  								[out addFirst: 'http://' , server, fileName]]
  					ifTrue: [^ out]].
  			((out size > 0) or: [char := doc reset; skipSeparators; next.
  				(char == $*) | (char == $#)]) ifTrue:
  					[^ out "we have our list"]].	"else got error msg instead of file"
  		"Server was down, try next one"].
  	self inform: 'All code update servers seem to be unavailable'.
  	^ out!

Item was changed:
  ----- Method: UpdateStreamDownloader class>>retrieveUrls:ontoQueue:withWaitSema: (in category 'fetching updates') -----
  retrieveUrls: urls ontoQueue: queue withWaitSema: waitSema 
  	"download the given list of URLs. The queue will be loaded alternately  
  	with url's and with the retrieved contents. If a download fails, the  
  	contents will be #failed. If all goes well, a special pair with an empty  
  	URL and the contents #finished will be put on the queue. waitSema is  
  	waited on every time before a new document is downloaded; this keeps 
  	the downloader from getting too far  ahead of the main process"
  	"kill the existing downloader if there is one"
  	| updateCounter |
  		ifNotNil: [UpdateDownloader terminate].
  	updateCounter := 0.
  	"fork a new downloading process"
  	UpdateDownloader := [
  		'Downloading updates' displayProgressFrom: 0 to: urls size during: [:bar |
  				do: [:url | | front canPeek doc | 
  					waitSema wait.
  					queue nextPut: url.
+ 					doc := HTTPSocket httpGet: url.
- 					doc := HTTPClient httpGet: url.
  					doc isString
  						ifTrue: [queue nextPut: #failed.
  							UpdateDownloader := nil.
  							Processor activeProcess terminate]
  						ifFalse: [canPeek := 120 min: doc size.
  							front := doc next: canPeek.  doc skip: -1 * canPeek.
  							(front beginsWith: '<!!DOCTYPE') ifTrue: [
  								(front includesSubstring: 'Not Found') ifTrue: [
  									queue nextPut: #failed.
  									UpdateDownloader := nil.
  									Processor activeProcess terminate]]].
  						UpdateDownloader ifNotNil: [queue nextPut: doc. updateCounter := updateCounter + 1. bar value: updateCounter]]].
  			queue nextPut: ''.
  			queue nextPut: #finished.
  			UpdateDownloader := nil] newProcess.
  	UpdateDownloader priority: Processor userInterruptPriority.
  	"start the process running"
  	UpdateDownloader resume!

More information about the Packages mailing list