From 166a98c76bc9ac26ac6daa5701643b6cd77461f4 Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Sun, 17 Mar 2024 17:29:45 +0100 Subject: [PATCH] Fix streaming file upload in GemStone: GsFile>>nextPutAll: wrote 0 bytes on the file when invoked with a ZnStringBuffer as argument due to the optimized implementation. Fixed by writing the internal collection class instead. --- .../ZnRingBuffer.class/instance/writeAllOn..st | 4 ++++ .../parseMultiPartFieldWithoutLengthWithBoundary.writeOn..st | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 repository/Seaside-Zinc-Core.package/ZnRingBuffer.class/instance/writeAllOn..st diff --git a/repository/Seaside-Zinc-Core.package/ZnRingBuffer.class/instance/writeAllOn..st b/repository/Seaside-Zinc-Core.package/ZnRingBuffer.class/instance/writeAllOn..st new file mode 100644 index 000000000..0c015081c --- /dev/null +++ b/repository/Seaside-Zinc-Core.package/ZnRingBuffer.class/instance/writeAllOn..st @@ -0,0 +1,4 @@ +private +writeAllOn: aStream + + aStream nextPutAll: buffer \ No newline at end of file diff --git a/repository/Seaside-Zinc-Core.package/ZnStreamingMultiPartFormDataEntity.class/instance/parseMultiPartFieldWithoutLengthWithBoundary.writeOn..st b/repository/Seaside-Zinc-Core.package/ZnStreamingMultiPartFormDataEntity.class/instance/parseMultiPartFieldWithoutLengthWithBoundary.writeOn..st index 80d08959e..0747b2e3f 100644 --- a/repository/Seaside-Zinc-Core.package/ZnStreamingMultiPartFormDataEntity.class/instance/parseMultiPartFieldWithoutLengthWithBoundary.writeOn..st +++ b/repository/Seaside-Zinc-Core.package/ZnStreamingMultiPartFormDataEntity.class/instance/parseMultiPartFieldWithoutLengthWithBoundary.writeOn..st @@ -36,7 +36,7 @@ parseMultiPartFieldWithoutLengthWithBoundary: aBoundary writeOn: writer If not we have to check for the next boundary candidate as we might have loaded the next boundary partially." buffer = aBoundary ] ] ifNil: [ - writer nextPutAll: buffer. + buffer writeAllOn: writer. stream atEnd ifFalse: [ "#next:into: answers a copy of the buffer if not enough bytes could be read.