Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node/channels: Handle EOF
Lorenz Leutgeb committed 1 month ago
commit 77907636cc128c0b70f54108db4490f5349d5060
parent c2ce7bbd31d69c8df4be156020d5ff21506f15e9
2 files changed +1 -6
modified crates/radicle-node/src/worker/channels.rs
@@ -223,9 +223,8 @@ impl Read for ChannelReader<Vec<u8>> {
                self.buffer = io::Cursor::new(data);
                self.buffer.read(buf)
            }
-
            Ok(ChannelEvent::Eof) => Err(io::ErrorKind::UnexpectedEof.into()),
+
            Ok(ChannelEvent::Eof) => Ok(0),
            Ok(ChannelEvent::Close) => Err(io::ErrorKind::ConnectionReset.into()),
-

            Err(chan::RecvTimeoutError::Timeout) => Err(io::Error::new(
                io::ErrorKind::TimedOut,
                "error reading from stream: channel timed out",
modified crates/radicle-node/src/worker/upload_pack.rs
@@ -126,10 +126,6 @@ where
                            break;
                        }
                    }
-
                    Err(e) if e.kind() == io::ErrorKind::UnexpectedEof => {
-
                        log::debug!(target: "worker", "Exiting upload-pack reader thread for {}", header.repo);
-
                        break;
-
                    }
                    Err(e) => {
                        log::debug!(target: "worker", "Failure on upload-pack channel read for {}: {e}", header.repo);
                        emitter.emit(events::UploadPack::error(header.repo, remote, e).into());