Skip to content

Commit

Permalink
fix(streamable): Append read stream buffer to ongoing response for lo…
Browse files Browse the repository at this point in the history
…ng items (#372)

Process output is streamed into a buffer. By default this buffer fits 4k characters, which is too short for image data.
With this change, if this block does not contain a stream separator, the complete block is appended to the in-progress content stored so far.
Fixes #371.
  • Loading branch information
peanball authored Apr 14, 2023
1 parent 569146d commit 269a410
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SwiftBar/Plugin/StreamablePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class StreamablePlugin: Plugin {
self?.content = nil
return
}
guard str.contains("\n") else {
guard str.contains("\n") || !str.contains(streamSeparator) else {
self?.streamInProgressContent.append(contentsOf: str)
return
}
Expand Down

0 comments on commit 269a410

Please sign in to comment.