forked from GsDevKit/GsDevKit
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue GsDevKit#60: today I had an incident where 500ms timeout was cl…
…early not long enough ... going with 20 seconds for now ... I see where a different strategy is called for...
- Loading branch information
1 parent
41687b1
commit d08b2db
Showing
54 changed files
with
187 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
repository/Squeak.v3.package/DateAndTimeANSI.extension/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
repository/Squeak.v3.package/Deprecation.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"class" : { | ||
"deprecationsWhile:" : "eem 7/3/2009 19:13", | ||
"method:explanation:on:in:" : "eem 7/3/2009 19:15" }, | ||
"deprecationsWhile:" : "DaleHenrichs 10/25/2010 16:01", | ||
"method:explanation:on:in:" : "DaleHenrichs 10/25/2010 16:01" }, | ||
"instance" : { | ||
"=" : "eem 7/3/2009 19:10", | ||
"=" : "DaleHenrichs 10/25/2010 16:01", | ||
"defaultAction" : "DaleHenrichs 10/25/2010 16:04", | ||
"deprecationDate" : "eem 7/3/2009 19:07", | ||
"explanationString" : "eem 7/3/2009 19:07", | ||
"hash" : "eem 7/3/2009 19:08", | ||
"messageText" : "AndrewBlack 8/31/2009 03:15", | ||
"method:explanation:on:in:" : "DaleHenrichs 08/12/2010 14:50", | ||
"methodReference" : "eem 7/3/2009 19:07", | ||
"versionString" : "eem 7/3/2009 19:07" } } | ||
"deprecationDate" : "DaleHenrichs 10/25/2010 16:01", | ||
"explanationString" : "DaleHenrichs 10/25/2010 16:01", | ||
"hash" : "DaleHenrichs 10/25/2010 16:01", | ||
"messageText" : "DaleHenrichs 10/25/2010 16:01", | ||
"method:explanation:on:in:" : "DaleHenrichs 10/25/2010 16:01", | ||
"methodReference" : "DaleHenrichs 10/25/2010 16:01", | ||
"versionString" : "DaleHenrichs 10/25/2010 16:01" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
repository/Squeak.v3.package/GsIssue157TestCase.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"class" : { | ||
"fooIssue157" : "DaleHenrichs 08/18/2010 13:13" }, | ||
"fooIssue157" : "DaleHenrichs 10/25/2010 16:01" }, | ||
"instance" : { | ||
"doesNotUnderstand:" : "DaleHenrichs 08/18/2010 13:12", | ||
"doesNotUnderstand:" : "DaleHenrichs 10/25/2010 16:01", | ||
"testIssue157" : "DaleHenrichs 10/25/2010 16:01" } } |
56 changes: 29 additions & 27 deletions
56
repository/Squeak.v3.package/HTTPSocket.class/instance/getResponseUpTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
http | ||
getResponseUpTo: markerString | ||
"Keep reading until the marker is seen. Return three parts: header, marker, beginningOfData. Fails if no marker in first 2000 chars." | ||
"Keep reading until the marker is seen. Return three parts: header, marker, beginningOfData. Fails if no marker in first 2000 chars." | ||
|
||
| buf response bytesRead tester mm tries | | ||
buf := ByteArray new: 2000. | ||
response := WriteStream on: ByteArray new. | ||
tester := 1. mm := 1. | ||
tries := 3. | ||
[tester := tester - markerString size + 1 max: 1. "rewind a little, in case the marker crosses a read boundary" | ||
tester to: response position - 1 do: [:tt | | ||
(Character value: (buf at: tt)) = (markerString at: mm) | ||
ifTrue: [mm := mm + 1] | ||
ifFalse: [mm := 1 ]. | ||
"Not totally correct for markers like xx0xx" | ||
mm > markerString size ifTrue: ["got it" | ||
^ Array with: (buf asString copyFrom: 1 to: tt+1-mm) | ||
with: markerString | ||
with: (buf asString copyFrom: tt+1 to: response position - 1)]]. | ||
tester := 1 max: response position. "OK if mm in the middle" | ||
(response position < buf size) & (self isActive | self readyForRead) | ||
& ((tries := tries - 1) >= 0) ] whileTrue: [ | ||
(self waitForReadDataUpToMs: 500) ifFalse: [ | ||
self error: 'data was late']. | ||
bytesRead := self readInto: buf startingAt: 1 for: buf size. | ||
response nextPutAll: (buf copyFrom: 1 to: bytesRead)]. | ||
|
||
^ Array with: response contents asString | ||
with: '' | ||
with: '' "Marker not found and connection closed" | ||
| buf response bytesRead tester mm tries | | ||
buf := ByteArray new: 2000. | ||
response := WriteStream on: ByteArray new. | ||
tester := 1. | ||
mm := 1. | ||
tries := 3. | ||
[ | ||
tester := tester - markerString size + 1 max: 1. "rewind a little, in case the marker crosses a read boundary" | ||
tester to: response position - 1 do: [ :tt | | ||
(Character value: (buf at: tt)) = (markerString at: mm) | ||
ifTrue: [ mm := mm + 1 ] | ||
ifFalse: [ mm := 1 ]. "Not totally correct for markers like xx0xx" | ||
mm > markerString size | ||
ifTrue: [ | ||
"got it" | ||
^ Array | ||
with: (buf asString copyFrom: 1 to: tt + 1 - mm) | ||
with: markerString | ||
with: (buf asString copyFrom: tt + 1 to: response position - 1) ] ]. | ||
tester := 1 max: response position. "OK if mm in the middle" | ||
response position < buf size & (self isActive | self readyForRead) | ||
& ((tries := tries - 1) >= 0) ] | ||
whileTrue: [ | ||
(self waitForReadDataUpToMs: 20000) | ||
ifFalse: [ self error: 'data was late' ]. | ||
bytesRead := self readInto: buf startingAt: 1 for: buf size. | ||
response nextPutAll: (buf copyFrom: 1 to: bytesRead) ]. | ||
^ Array with: response contents asString with: '' with: '' "Marker not found and connection closed" |
67 changes: 37 additions & 30 deletions
67
repository/Squeak.v3.package/HTTPSocket.class/instance/getResponseUpTo.ignoring..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,41 @@ | ||
http | ||
getResponseUpTo: markerString ignoring: ignoreString | ||
"Keep reading, until the marker is seen, skipping characters in ignoreString when | ||
"Keep reading, until the marker is seen, skipping characters in ignoreString when | ||
comparing to the marker. Return three parts: header, marker, beginningOfData. | ||
Fails if no marker in first 2000 chars." | ||
Fails if no marker in first 2000 chars." | ||
|
||
| buf response bytesRead tester mm skipped | | ||
buf _ ByteArray new: 2000. | ||
response _ WriteStream on: ByteArray new. | ||
tester _ 1. mm _ 1. | ||
skipped _ 0. | ||
[tester _ tester - markerString size + 1 max: 1. "rewind a little, in case the marker crosses a read boundary" | ||
tester to: response position - 1 do: [:tt | | ||
(Character value: (buf at: tt)) = (markerString at: mm) ifFalse: | ||
[[ignoreString includes: (markerString at: mm)] whileTrue: | ||
[mm _ mm + 1. skipped _ skipped + 1]]. | ||
(Character value: (buf at: tt)) = (markerString at: mm) | ||
ifTrue: [mm _ mm + 1] | ||
ifFalse: [mm _ 1. skipped _ 0]. | ||
"Not totally correct for markers like xx0xx" | ||
mm > markerString size ifTrue: ["got it" | ||
^ Array with: (buf asString copyFrom: 1 to: tt+1-mm+skipped) | ||
with: markerString | ||
with: (buf asString copyFrom: tt+1 to: response position - 1)]]. | ||
tester _ 1 max: response position. "OK if mm in the middle" | ||
(response position < buf size) & (self isActive | self readyForRead)] whileTrue: [ | ||
(self waitForReadDataUpToMs: 500) ifFalse: [ | ||
self error: 'data was late']. | ||
bytesRead _ self readInto: buf startingAt: 1 for: buf size. | ||
response nextPutAll: (buf copyFrom: 1 to: bytesRead)]. | ||
|
||
^ Array with: response contents asString | ||
with: '' | ||
with: '' "Marker not found and connection closed" | ||
| buf response bytesRead tester mm skipped | | ||
buf _ ByteArray new: 2000. | ||
response _ WriteStream on: ByteArray new. | ||
tester _ 1. | ||
mm _ 1. | ||
skipped _ 0. | ||
[ | ||
tester _ tester - markerString size + 1 max: 1. "rewind a little, in case the marker crosses a read boundary" | ||
tester to: response position - 1 do: [ :tt | | ||
(Character value: (buf at: tt)) = (markerString at: mm) | ||
ifFalse: [ | ||
[ ignoreString includes: (markerString at: mm) ] | ||
whileTrue: [ | ||
mm _ mm + 1. | ||
skipped _ skipped + 1 ] ]. | ||
(Character value: (buf at: tt)) = (markerString at: mm) | ||
ifTrue: [ mm _ mm + 1 ] | ||
ifFalse: [ | ||
mm _ 1. | ||
skipped _ 0 ]. "Not totally correct for markers like xx0xx" | ||
mm > markerString size | ||
ifTrue: [ | ||
"got it" | ||
^ Array | ||
with: (buf asString copyFrom: 1 to: tt + 1 - mm + skipped) | ||
with: markerString | ||
with: (buf asString copyFrom: tt + 1 to: response position - 1) ] ]. | ||
tester _ 1 max: response position. "OK if mm in the middle" | ||
response position < buf size & (self isActive | self readyForRead) ] | ||
whileTrue: [ | ||
(self waitForReadDataUpToMs: 20000) | ||
ifFalse: [ self error: 'data was late' ]. | ||
bytesRead _ self readInto: buf startingAt: 1 for: buf size. | ||
response nextPutAll: (buf copyFrom: 1 to: bytesRead) ]. | ||
^ Array with: response contents asString with: '' with: '' "Marker not found and connection closed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.