CompressionStream.st
changeset 3293 772bcf3f973c
parent 3292 904ccaf98691
child 3316 7d8e613eb9da
--- a/CompressionStream.st	Tue Jun 03 12:34:04 2014 +0200
+++ b/CompressionStream.st	Tue Jun 03 12:51:02 2014 +0200
@@ -332,11 +332,19 @@
         [(readLimit := self zinflate) == 0] whileTrue:[
             |n|
 
-            n := onStream nextBytes:(inputBytes size) into:inputBytes startingAt:1.
-            n == 0 ifTrue:[
-                hitEOF := true.
-                ^ false
-            ].
+            [
+                n := onStream nextAvailableBytes:(inputBytes size) into:inputBytes startingAt:1.
+                n == 0 ifTrue:[
+                    onStream atEnd ifTrue:[
+                        hitEOF := true.
+                        ^ false.
+                    ] ifFalse:[
+                        "must be a socket or pipe"
+                        onStream readWait.
+                    ].
+                ].
+                n == 0
+            ] whileTrue.
             self zset_avail_in:n.
         ].
         readLimit isNil ifTrue:[
@@ -697,11 +705,11 @@
 !CompressionStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/CompressionStream.st,v 1.34 2014-06-03 10:34:04 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/CompressionStream.st,v 1.35 2014-06-03 10:51:02 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/CompressionStream.st,v 1.34 2014-06-03 10:34:04 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/CompressionStream.st,v 1.35 2014-06-03 10:51:02 stefan Exp $'
 ! !