Skip to content

Commit ec749a2

Browse files
authored
cli: fix port forward responses getting truncated (#206466)
There was a bug in the compression loop where the compressor could indicate that it processed all input, but was waiting for space in the output buffer in order to send the data We didn't handle this case so data would just get stuck in the buffer and dropped when the connection closed. A fix with more tweaks is found in #206464, but this change is sufficient to resolve the issue for me. Refs microsoft/vscode-remote-release#9594
1 parent 019f4d1 commit ec749a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cli/src/tunnels/socket_signal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ where
255255
Ok(flate2::Status::Ok | flate2::Status::BufError) => {
256256
let processed_len = in_offset + (self.flate.total_in() - in_before) as usize;
257257
let output_len = out_offset + (self.flate.total_out() - out_before) as usize;
258-
if processed_len < contents.len() {
258+
if processed_len < contents.len() || output_len == self.output.len() {
259259
// If we filled the output buffer but there's more data to compress,
260260
// extend the output buffer and keep compressing.
261261
out_offset = output_len;

0 commit comments

Comments
 (0)