Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
fetch: re-work transport::done signal call
Fintan Halpenny committed 2 years ago
commit b1435629f9b2e5d592971350d15162cc1e9b427d
parent c02ff1e47ef67929ab7f6526ba454e5547d3f180
2 files changed +15 -7
modified radicle-fetch/src/lib.rs
@@ -9,18 +9,19 @@ mod refs;
mod stage;
mod state;

+
use std::io;
+
use std::time::Instant;
+

use gix_protocol::handshake;
+

pub use handle::Handle;
pub use policy::{Allowed, BlockList, Scope};
-
use radicle::storage::ReadRepository as _;
pub use state::{FetchLimit, FetchResult};
pub use transport::Transport;

-
use std::io;
-
use std::time::Instant;
-

use radicle::crypto::PublicKey;
use radicle::storage::refs::RefsAt;
+
use radicle::storage::ReadRepository as _;
use state::FetchState;
use thiserror::Error;

modified radicle-fetch/src/state.rs
@@ -441,6 +441,16 @@ impl FetchState {
            start.elapsed().as_millis()
        );

+
        // N.b. signal to exit the upload-pack sequence
+
        // We're finished fetching on this side, and all that's left
+
        // is validation.
+
        match handle.transport.done() {
+
            Ok(()) => log::debug!(target: "fetch", "Sent done signal to remote {remote}"),
+
            Err(err) => {
+
                log::warn!(target: "fetch", "Attempted to send done to remote {remote}: {err}")
+
            }
+
        }
+

        // Run validation of signed refs, pruning any offending
        // remotes from the tips, thus not updating the production Git
        // repository.
@@ -543,9 +553,6 @@ impl FetchState {
                }
            }
        }
-
        // N.b. signal to exit the upload-pack sequence
-
        handle.transport.done()?;
-

        log::debug!(
            target: "fetch",
            "Validated {} remotes ({}ms)",