File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,12 @@ Arguments
77
77
The initial buffer size (the default size is 16KiB). The buffer may be
78
78
extended whenever `codec` requests so.
79
79
- `stop_on_end`:
80
- The flag to stop transcoding on `:end` return code of `codec`. The
81
- transcoded data are readable even after the end of transcoding. Note that
82
- some extra data may be read from `stream` into a buffer and thus `sharedbuf`
83
- must be `true` to reuse `stream`.
80
+ The flag to stop transcoding on `:end` return code from `codec`. The
81
+ transcoded data are readable even after stopping transcoding process. With
82
+ this flag on, `stream` is not closed when the wrapper stream is closed with
83
+ `close`. Note that some extra data may be read from `stream` into an
84
+ internal buffer, and thus `stream` must be a `TranscodingStream` object and
85
+ `sharedbuf` must be `true` to reuse `stream`.
84
86
- `sharedbuf`:
85
87
The flag to share buffers between adjacent transcoding streams. The value
86
88
must be `false` if `stream` is not a `TranscodingStream` object.
@@ -160,10 +162,13 @@ function Base.isopen(stream::TranscodingStream)
160
162
end
161
163
162
164
function Base. close (stream:: TranscodingStream )
165
+ stopped = stream. state. mode == :stop
163
166
if stream. state. mode != :panic
164
167
changemode! (stream, :close )
165
168
end
166
- close (stream. stream)
169
+ if ! stopped
170
+ close (stream. stream)
171
+ end
167
172
return nothing
168
173
end
169
174
You can’t perform that action at this time.
0 commit comments