Skip to content

Commit

Permalink
Merge pull request #66 from GsDevKit/issue_58
Browse files Browse the repository at this point in the history
release v2.4.3.1
  • Loading branch information
dalehenrich committed Jan 15, 2015
2 parents 94e3743 + f436c90 commit 452f043
Show file tree
Hide file tree
Showing 469 changed files with 3,404 additions and 823 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
language: erlang

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/c59e6bffa0b41a693676 # GsDevKit/chat (public)
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false

env:
- ST=GemStone-2.4.4.1
# - ST=GemStone-2.4.4.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,27 @@ baseline: spec
configuration: 'GsPharo'
with: [
spec
version: '0.9.2';
version: '0.9.3';
repository: 'http://seaside.gemtalksystems.com/ss/PharoCompat' ];
configuration: 'Cryptography'
baseline: 'Cryptography'
with: [
spec
versionString: #'stable';
repository: 'http://seaside.gemtalksystems.com/ss/Cryptography' ];
baseline: 'NeoJSON'
loads: #('Cryptography');
repository: 'github://GsDevKit/Cryptography:master/repository' ];
baseline: 'GsApplicationTools'
with: [
spec
loads: 'Core';
repository: 'github://GsDevKit/NeoJSON:master/repository' ];
loads: #('Core');
repository:
'github://GsDevKit/gsApplicationTools:v1.?/repository' ];
baseline: 'NeoJSON'
with: [ spec repository: 'github://GsDevKit/NeoJSON:gs_master/repository' ];
yourself.
spec
package: 'SocketStream';
package: 'Zinc-FileSystem-Legacy' with: [ spec requires: #('GLASS1') ];
package: 'Zinc-GemStone-Server-Tools'
with: [ spec requires: #('GsApplicationTools') ];
package: 'Zinc-WebSocket-Core'
with: [ spec requires: #('Zinc-HTTP' 'Cryptography') ];
package: 'Zinc-HTTP'
Expand All @@ -146,7 +151,8 @@ baseline: spec
includes: #('SocketStream') ];
package: 'Zinc-Tests' with: [ spec requires: #('GsPharo') ].
spec
group: 'CI' with: #('REST');
group: 'Core' with: #('Zinc-GemStone-Server-Tools');
group: 'CI' with: #('REST' 'WebSocket');
yourself ].
spec
for: #'gs2.x'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"baseline:" : "dkh 11/17/2014 18:15" } }
"baseline:" : "dkh 01/12/2015 10:56" } }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(name 'BaselineOfZincHTTPComponents-dkh.10' message 'Issue #58: pull WebSockt from CI group ... interested in seeing how things are for NeoJSON and and zinc core' id '3b28664e-1ba7-4d76-aff5-e5c89eb2236b' date '11/17/2014' time '18:16:16' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.9' message 'Issue #60: reference GsDevKit/NeoJSON directory and only load Core, since NeoJSON tests are known not to pass: https://github.com/GsDevKit/NeoJSON/issues/3' id '73c88fdd-cbe7-4a5c-8485-923f314c6c44' date '11/17/2014' time '18:14:59' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.8' message 'Issue #58: re-enable websocket as part of CI ... this will take longer to get straightened out as both NeoJSON and WebSockets have issues' id '342aa976-a532-4d8b-a428-6e7cb9111a41' date '11/17/2014' time '18:03:43' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.7' message 'Issue #58: disable web-socket test load for ''CI'' until Cryptography load issue resolvedIssue #60: fix NeoJSON specification and add ''REST'' to ''CI'' group ... defer reference to GsDevKit/NeoJSON project until travis tests have been enabled ...' id 'fec29f56-7062-41a6-85d2-9d7a439559e4' date '11/17/2014' time '16:33:26' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.6' message 'Issue #58: cryptography configuration needed updating, so added stable version while I was at it ...' id '00296be5-2d30-418d-a474-2f373393e313' date '11/01/2014' time '13:00:26' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.5' message 'Issue #58: no stable version defined in the current Cryptography configuration...' id '67a67e96-6cf9-4c32-a87a-9e3d8bc3d647' date '11/01/2014' time '12:46:46' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.4' message 'Issue #58: create CI group to specifiy packages to be loaded by travis-ci for testing ... for GemStone that includes Zinc-WebSocket-Tests ... expect failures since Cryptography project is not up to snuff...yet' id '15af9af6-9829-412c-be6b-70cdc7fda24a' date '11/01/2014' time '12:28:52' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.3' message 'Issue #55: bump mcz version of the gs_master branch BaselineOfZincHTTPComponents, to avoid duplice mcz versions' id 'e175a78c-9a07-4da1-97a2-96eb0d40ba96' date '10/27/2014' time '15:10:49' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.2' message 'restore Zodiac packages and groups to configuration ... not ported to GemStone yet, see Issue #55 for details' id '6311a4fb-03de-42dc-81c7-b96971d30368' date '10/15/2014' time '11:55:57' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-JohanBrichau.1' message 'renamed BaselineOfZinc to BaselineOfZincHTTPComponents' id 'e022a66b-5bb4-47eb-b582-74a3ebaa1f9e' date '07/09/2014' time '21:16:19' author 'JohanBrichau' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
(name 'BaselineOfZincHTTPComponents-dkh.19' message 'Issue #69: fix mistake in tag spec for baseline ... start adding support for Rest transactional example' id 'b8134660-25eb-46d5-9cbb-b4c4fe2b21d7' date '01/12/2015' time '10:58:15' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.18' message 'Issue #58: change GsApplicationTools project reference back to: gsApplicationTools:v.1.?' id 'f297e739-5425-4c6e-8262-3039ca36e341' date '01/07/2015' time '16:20:29' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.17' message 'Issue #58: use dev branch for GsApplicationTools' id '72892950-b7c5-4a4c-b40a-5cfd0b98688a' date '01/06/2015' time '15:14:41' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.16' message 'Issue #58: mods to be minimally compatible with GsApplicationTools v1.0.0' id '34566c61-ca88-4eaf-b4ad-2149de6755fe' date '01/06/2015' time '11:59:55' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.15' message 'Issue #58: ZnSingleThreadedServer>>handleRequestProtected: don''t pass the exception ... debugMode doesn''t quite appy to GemStone ... need different granularity I think ... GsPharo 0.9.2 needs to be used' id '6f7305be-3dbd-40f9-a81f-3f920132534e' date '12/02/2014' time '16:29:14' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.14' message 'Issue #58: add dependency upon GsApplicationTools for Zinc-GemStone-Server-Tools, a new package which holds ZnServerStarter class needed by web socket tests ...' id 'e09422d2-1065-4ceb-8845-084f10a4c4f7' date '11/26/2014' time '13:39:44' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.13' message 'NeoJSON is on gs_master branch now' id 'f6fdee09-f8c6-4738-907c-215a6eae7bcf' date '11/22/2014' time '12:39:05' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.12' message 'Issue #58: load NeoJSON tests now ... they should be passing?' id '71ee4921-b3f1-4550-bec2-277fe6363086' date '11/20/2014' time '17:43:32' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.11' message 'Issue #58: switch Cryptography project to use GsDevKit/Cryptography project and add backin into CI group, since the project should now load without errors' id '7602ba2b-54cc-45de-a7ad-567191c9b1c5' date '11/18/2014' time '12:09:24' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.10' message 'Issue #58: pull WebSockt from CI group ... interested in seeing how things are for NeoJSON and and zinc core' id '3b28664e-1ba7-4d76-aff5-e5c89eb2236b' date '11/17/2014' time '18:16:16' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.9' message 'Issue #60: reference GsDevKit/NeoJSON directory and only load Core, since NeoJSON tests are known not to pass: https://github.com/GsDevKit/NeoJSON/issues/3' id '73c88fdd-cbe7-4a5c-8485-923f314c6c44' date '11/17/2014' time '18:14:59' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.8' message 'Issue #58: re-enable websocket as part of CI ... this will take longer to get straightened out as both NeoJSON and WebSockets have issues' id '342aa976-a532-4d8b-a428-6e7cb9111a41' date '11/17/2014' time '18:03:43' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.7' message 'Issue #58: disable web-socket test load for ''CI'' until Cryptography load issue resolvedIssue #60: fix NeoJSON specification and add ''REST'' to ''CI'' group ... defer reference to GsDevKit/NeoJSON project until travis tests have been enabled ...' id 'fec29f56-7062-41a6-85d2-9d7a439559e4' date '11/17/2014' time '16:33:26' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.6' message 'Issue #58: cryptography configuration needed updating, so added stable version while I was at it ...' id '00296be5-2d30-418d-a474-2f373393e313' date '11/01/2014' time '13:00:26' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.5' message 'Issue #58: no stable version defined in the current Cryptography configuration...' id '67a67e96-6cf9-4c32-a87a-9e3d8bc3d647' date '11/01/2014' time '12:46:46' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.4' message 'Issue #58: create CI group to specifiy packages to be loaded by travis-ci for testing ... for GemStone that includes Zinc-WebSocket-Tests ... expect failures since Cryptography project is not up to snuff...yet' id '15af9af6-9829-412c-be6b-70cdc7fda24a' date '11/01/2014' time '12:28:52' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.3' message 'Issue #55: bump mcz version of the gs_master branch BaselineOfZincHTTPComponents, to avoid duplice mcz versions' id 'e175a78c-9a07-4da1-97a2-96eb0d40ba96' date '10/27/2014' time '15:10:49' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-dkh.2' message 'restore Zodiac packages and groups to configuration ... not ported to GemStone yet, see Issue #55 for details' id '6311a4fb-03de-42dc-81c7-b96971d30368' date '10/15/2014' time '11:55:57' author 'dkh' ancestors ((name 'BaselineOfZincHTTPComponents-JohanBrichau.1' message 'renamed BaselineOfZinc to BaselineOfZincHTTPComponents' id 'e022a66b-5bb4-47eb-b582-74a3ebaa1f9e' date '07/09/2014' time '21:16:19' author 'JohanBrichau' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
as yet unclassified
openConnectionToHost: host port: portNumber timeout: timeoutSeconds
| socket |
socket := SocketStreamSocket newTCPSocket.
socket connectTo: host port: portNumber timeout: timeoutSeconds.
^ (self on: socket)
timeout: timeoutSeconds;
yourself
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
as yet unclassified
close
"Flush any data still not sent
"Flush any data still not sent
and take care of the socket."

self flush.
socket close.
self destroy.
[ self flush ]
ensure: [
self socket close.
self destroy ]
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
as yet unclassified
destroy
"Destroy the receiver and its underlying socket. Does not attempt to flush the output buffers. For a graceful close use SocketStream>>close instead."
socket ifNotNil: [socket close]
"Destroy the receiver and its underlying socket. Does not attempt to flush the output buffers. For a graceful close use SocketStream>>close instead."

socket ifNotNil: [ self socket close ]
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
as yet unclassified
flush
"If the other end is connected and we have something
"If the other end is connected and we have something
to send, then we send it and reset the outBuffer."

((outNextToWrite > 1) and: [socket isActive])
ifTrue: [
[socket sendData: outBuffer count: outNextToWrite - 1]
on: ConnectionTimedOut
do: [:ex | shouldSignal ifFalse: ["swallow"]].
outNextToWrite := 1]
(outNextToWrite > 1 and: [ self socket isActive ])
ifTrue: [
[ self socket sendData: outBuffer count: outNextToWrite - 1 ]
on: ConnectionTimedOut
do: [ :ex |
shouldSignal
ifFalse: [
"swallow"
] ].
outNextToWrite := 1 ]
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
as yet unclassified
flushComet
"Flushes the receiver and answer if the socket is still in a valid state and both ends are properly connected. Free the socket, as a side-effect if there is a problem."

| result |
result := [ self flush. true ]
on: NetworkError
do: [ :err | false ].
result := result and: [ self isConnected and: [ self isOtherEndConnected ] ].
result ifFalse: [ socket destroy ].
^ result
"Flushes the receiver and answer if the socket is still in a valid state and both ends are properly connected. Free the socket, as a side-effect if there is a problem."

| result |
result := [
self flush.
true ]
on: NetworkError
do: [ :err | false ].
result := result and: [ self isConnected and: [ self isOtherEndConnected ] ].
result
ifFalse: [ self socket destroy ].
^ result
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
as yet unclassified
isConnected
"The stream is connected if the socket is."
"The stream is connected if the socket is."

^socket isConnected
^ self socket isConnected
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
as yet unclassified
isDataAvailable
"It the inbuffer is empty, we check the socket for data.
"It the inbuffer is empty, we check the socket for data.
If it claims to have data available to read, we try to read
some once and recursively call this method again.
If something really was available it is now in the inBuffer.
This is because there has been spurious
dataAvailable when there really is no data to get."

self isInBufferEmpty ifFalse: [^true].
^socket dataAvailable
ifFalse: [false]
ifTrue: [self receiveDataIfAvailable; isDataAvailable]

self isInBufferEmpty
ifFalse: [ ^ true ].
^ self socket dataAvailable
ifFalse: [ false ]
ifTrue: [
self
receiveDataIfAvailable;
isDataAvailable ]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
as yet unclassified
isOtherEndConnected
^socket isConnected
^ self socket isConnected
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
as yet unclassified
nextPutAllFlush: aCollection
"Put a String or a ByteArray onto the stream.
"Put a String or a ByteArray onto the stream.
You can use this if you have very large data - it avoids
copying into the buffer (and avoids buffer growing)
and also flushes any other pending data first."

| toPut |
toPut := binary ifTrue: [aCollection asByteArray] ifFalse: [aCollection asString].
self flush. "first flush pending stuff, then directly send"
socket isConnected ifTrue: [
[socket sendData: toPut count: toPut size]
on: ConnectionTimedOut
do: [:ex | shouldSignal ifFalse: ["swallow"]]]
| toPut |
toPut := binary
ifTrue: [ aCollection asByteArray ]
ifFalse: [ aCollection asString ].
self flush. "first flush pending stuff, then directly send"
self socket isConnected
ifTrue: [
[ self socket sendData: toPut count: toPut size ]
on: ConnectionTimedOut
do: [ :ex |
shouldSignal
ifFalse: [
"swallow"
] ] ]
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
as yet unclassified
receiveAvailableData
"Receive available data (as much as fits in the inBuffer)
"Receive available data (as much as fits in the inBuffer)
but not waiting for more to arrive.
Return the position in the buffer where the
new data starts, regardless if anything
was read, see #adjustInBuffer."

recentlyRead := socket receiveAvailableDataInto: inBuffer startingAt: inNextToWrite.
^self adjustInBuffer: recentlyRead

recentlyRead := self socket
receiveAvailableDataInto: inBuffer
startingAt: inNextToWrite.
^ self adjustInBuffer: recentlyRead
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
as yet unclassified
receiveData
"Receive data with timeout if it has been set.
"Receive data with timeout if it has been set.
If shouldSignal is false we use the Socket methods
that swallow those Exceptions, if it is true the
caller will have to handle those Exceptions.
Return the position in the buffer where the
new data starts, regardless if anything
was read, see #adjustInBuffer."

recentlyRead := shouldSignal ifTrue: [
self shouldTimeout ifTrue: [
socket receiveDataSignallingTimeout: timeout
into: inBuffer startingAt: inNextToWrite]
ifFalse: [
socket receiveDataSignallingClosedInto: inBuffer
startingAt: inNextToWrite]]
ifFalse: [
self shouldTimeout ifTrue: [
"This case is tricky, if it times out and is swallowed

recentlyRead := shouldSignal
ifTrue: [
self shouldTimeout
ifTrue: [
self socket
receiveDataSignallingTimeout: timeout
into: inBuffer
startingAt: inNextToWrite ]
ifFalse: [ self socket receiveDataSignallingClosedInto: inBuffer startingAt: inNextToWrite ] ]
ifFalse: [
self shouldTimeout
ifTrue: [
"This case is tricky, if it times out and is swallowed
how does other methods calling this method repeatedly
get to know that? And what should they do?"
socket receiveDataTimeout: timeout
into: inBuffer startingAt: inNextToWrite]
ifFalse: [
socket receiveDataInto: inBuffer
startingAt: inNextToWrite]].
^self adjustInBuffer: recentlyRead
self socket
receiveDataTimeout: timeout
into: inBuffer
startingAt: inNextToWrite ]
ifFalse: [ self socket receiveDataInto: inBuffer startingAt: inNextToWrite ] ].
^ self adjustInBuffer: recentlyRead
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
as yet unclassified
receiveDataIfAvailable
"Only used to check that there really is data to read
"Only used to check that there really is data to read
from the socket after it signals dataAvailable.
It has been known to signal true and then still
not have anything to read. See also isDataAvailable.
Return the position in the buffer where the
new data starts, regardless if anything
was read, see #adjustInBuffer."

recentlyRead := socket receiveSomeDataInto: inBuffer startingAt: inNextToWrite.
^self adjustInBuffer: recentlyRead
recentlyRead := self socket
receiveSomeDataInto: inBuffer
startingAt: inNextToWrite.
^ self adjustInBuffer: recentlyRead
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
as yet unclassified
socket: aSocket
socket := aSocket
socket := TransientStackValue value: aSocket
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
as yet unclassified
socket
^socket
^ socket value

0 comments on commit 452f043

Please sign in to comment.