diff --git a/repository/Seaside-Core.package/WAComboResponse.class/class/external..st b/repository/Seaside-Core.package/WAComboResponse.class/class/external..st index 198616151..b1767d1b5 100644 --- a/repository/Seaside-Core.package/WAComboResponse.class/class/external..st +++ b/repository/Seaside-Core.package/WAComboResponse.class/class/external..st @@ -1,5 +1,6 @@ instance creation external: anExternalStream ^ self - onBuffered: (GRPlatform current writeCharacterStreamOn: (String new: 4096)) - external: anExternalStream \ No newline at end of file + onStream: anExternalStream + bufferSize: 4096 + codec: GRNullCodec new \ No newline at end of file diff --git a/repository/Seaside-Core.package/WAComboResponse.class/class/onBuffered.external..st b/repository/Seaside-Core.package/WAComboResponse.class/class/onBuffered.external..st deleted file mode 100644 index da998c54e..000000000 --- a/repository/Seaside-Core.package/WAComboResponse.class/class/onBuffered.external..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -onBuffered: aBufferedStream external: anExternalStream - ^ self basicNew initializeOnBuffered: aBufferedStream external: anExternalStream \ No newline at end of file diff --git a/repository/Seaside-Core.package/WAComboResponse.class/class/onStream.bufferSize.codec..st b/repository/Seaside-Core.package/WAComboResponse.class/class/onStream.bufferSize.codec..st new file mode 100644 index 000000000..a758fb706 --- /dev/null +++ b/repository/Seaside-Core.package/WAComboResponse.class/class/onStream.bufferSize.codec..st @@ -0,0 +1,5 @@ +instance creation +onStream: aStream bufferSize: anInteger codec: aGRCodec + ^ self basicNew + initializeOnStream: aStream bufferSize: anInteger codec: aGRCodec; + yourself \ No newline at end of file diff --git a/repository/Seaside-Core.package/WAComboResponse.class/instance/codec..st b/repository/Seaside-Core.package/WAComboResponse.class/instance/codec..st new file mode 100644 index 000000000..ca62e1773 --- /dev/null +++ b/repository/Seaside-Core.package/WAComboResponse.class/instance/codec..st @@ -0,0 +1,3 @@ +accessing +codec: aCodec + ^ codec \ No newline at end of file diff --git a/repository/Seaside-Core.package/WAComboResponse.class/instance/codec.st b/repository/Seaside-Core.package/WAComboResponse.class/instance/codec.st new file mode 100644 index 000000000..3bbf59d40 --- /dev/null +++ b/repository/Seaside-Core.package/WAComboResponse.class/instance/codec.st @@ -0,0 +1,3 @@ +accessing +codec + ^ codec \ No newline at end of file diff --git a/repository/Seaside-Core.package/WAComboResponse.class/instance/commit.st b/repository/Seaside-Core.package/WAComboResponse.class/instance/commit.st index f32d6ee2b..d1ff2e921 100644 --- a/repository/Seaside-Core.package/WAComboResponse.class/instance/commit.st +++ b/repository/Seaside-Core.package/WAComboResponse.class/instance/commit.st @@ -8,7 +8,10 @@ commit self headerAt: 'Transfer-Encoding' put: 'chunked'. committed := true. - self writeStatusOn: externalStream. - self writeHeadersOn: externalStream. - self writeCookiesOn: externalStream. - externalStream crlf; flush \ No newline at end of file + self + writeStatusOn: externalStream; + writeHeadersOn: externalStream; + writeCookiesOn: externalStream. + externalStream + crlf; + flush diff --git a/repository/Seaside-Core.package/WAComboResponse.class/instance/destroy.st b/repository/Seaside-Core.package/WAComboResponse.class/instance/destroy.st index 8bef51679..5a2d40415 100644 --- a/repository/Seaside-Core.package/WAComboResponse.class/instance/destroy.st +++ b/repository/Seaside-Core.package/WAComboResponse.class/instance/destroy.st @@ -4,4 +4,5 @@ destroy super destroy. bufferedStream := nil. - externalStream := nil \ No newline at end of file + externalStream := nil. + codec := nil diff --git a/repository/Seaside-Core.package/WAComboResponse.class/instance/initializeOnBuffered.external..st b/repository/Seaside-Core.package/WAComboResponse.class/instance/initializeOnBuffered.external..st deleted file mode 100644 index 67c936032..000000000 --- a/repository/Seaside-Core.package/WAComboResponse.class/instance/initializeOnBuffered.external..st +++ /dev/null @@ -1,9 +0,0 @@ -initialization -initializeOnBuffered: aBufferedStream external: anExternalStream - "Initialize the receiver" - - self initialize. - bufferedStream := aBufferedStream. - externalStream := anExternalStream. - committed := false. - closed := false \ No newline at end of file diff --git a/repository/Seaside-Core.package/WAComboResponse.class/instance/initializeOnStream.bufferSize.codec..st b/repository/Seaside-Core.package/WAComboResponse.class/instance/initializeOnStream.bufferSize.codec..st new file mode 100644 index 000000000..c29b4e38a --- /dev/null +++ b/repository/Seaside-Core.package/WAComboResponse.class/instance/initializeOnStream.bufferSize.codec..st @@ -0,0 +1,12 @@ +initialization +initializeOnStream: aStream bufferSize: anInteger codec: aGRCodec + "Initialize the receiver" + + | rawBufferedStream | + self initialize. + codec := aGRCodec. + rawBufferedStream := GRPlatform current writeCharacterStreamOn: (String new: anInteger). + bufferedStream := GRCountingStream on: (aGRCodec encoderFor: rawBufferedStream). + externalStream := GRBinaryConvertingStream on: aStream. + committed := false. + closed := false \ No newline at end of file diff --git a/repository/Seaside-Core.package/WAComboResponse.class/properties.json b/repository/Seaside-Core.package/WAComboResponse.class/properties.json index 13d822eec..adbace981 100644 --- a/repository/Seaside-Core.package/WAComboResponse.class/properties.json +++ b/repository/Seaside-Core.package/WAComboResponse.class/properties.json @@ -1,16 +1,18 @@ { - "commentStamp" : "pmm 8/25/2019 11:14", - "super" : "WAResponse", "category" : "Seaside-Core-HTTP", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "ar 8/4/2010 20:31", "instvars" : [ - "bufferedStream", - "externalStream", + "codec", "committed", - "closed" - ], + "externalStream", + "closed", + "bufferedStream" ], "name" : "WAComboResponse", - "type" : "normal" -} \ No newline at end of file + "pools" : [ + ], + "super" : "WAResponse", + "type" : "normal" } diff --git a/repository/Seaside-Tests-Core.package/WAComboResponseTest.class/instance/testWithBinaryStream.st b/repository/Seaside-Tests-Core.package/WAComboResponseTest.class/instance/testWithBinaryStream.st new file mode 100644 index 000000000..b0f4ac47c --- /dev/null +++ b/repository/Seaside-Tests-Core.package/WAComboResponseTest.class/instance/testWithBinaryStream.st @@ -0,0 +1,14 @@ +tests +testWithBinaryStream + (FileSystem memory / 'socket') binaryWriteStreamDo: [ :binaryStream | + response := WAComboResponse + onStream: binaryStream + bufferSize: 4096 + codec: GRPharoUtf8Codec new. + + response + nextPut: Character space; + flush; + close ] + + \ No newline at end of file diff --git a/repository/Zinc-Seaside.package/ZnZincStreamingServerAdaptor.class/instance/responseFor..st b/repository/Zinc-Seaside.package/ZnZincStreamingServerAdaptor.class/instance/responseFor..st index 324ad6379..9df0db915 100644 --- a/repository/Zinc-Seaside.package/ZnZincStreamingServerAdaptor.class/instance/responseFor..st +++ b/repository/Zinc-Seaside.package/ZnZincStreamingServerAdaptor.class/instance/responseFor..st @@ -1,8 +1,6 @@ converting responseFor: aZnRequest - | bufferedStream codecStream | - bufferedStream := GRPlatform current writeCharacterStreamOn: (self codec encodedStringClass new: 4096). - codecStream := self codec encoderFor: bufferedStream. ^ WAComboResponse - onBuffered: (GRCountingStream on: codecStream) - external: aZnRequest stream \ No newline at end of file + onStream: aZnRequest stream + bufferSize: 4096 + codec: self codec \ No newline at end of file