- cargo fmt across the workspace (the CI gate the last push tripped). - varde-daemon: drop the now-unused bytes dependency. - varde-ctl(1): document push; gc reflects the continuous-sweep reality; subscribe mentions push events. - config.toml example: gc_interval_secs, and an honest note that max_download_bytes_per_sec is currently unenforced. - LICENSE-MIT + LICENSE-APACHE at the root (the declared license now ships as files), bundled into release tarballs and installed by the PKGBUILD. - PKGBUILD: real maintainer, AUR pre-flight note (updpkgsums), license installation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
c52c3b1238
commit
5d29bdc4bd
@@ -382,7 +382,12 @@ impl Daemon {
|
||||
.present_trusted_peers()
|
||||
.into_iter()
|
||||
.filter(|p| p.connected)
|
||||
.filter_map(|p| p.node_id.parse::<iroh::EndpointId>().ok().map(iroh::EndpointAddr::from))
|
||||
.filter_map(|p| {
|
||||
p.node_id
|
||||
.parse::<iroh::EndpointId>()
|
||||
.ok()
|
||||
.map(iroh::EndpointAddr::from)
|
||||
})
|
||||
.collect();
|
||||
if !present.is_empty() {
|
||||
self.transfer.spawn_fetch(
|
||||
@@ -568,7 +573,6 @@ impl Daemon {
|
||||
Request::Subscribe {} => Ok(ResponseData::Done {}),
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fn blob_format(format: StoredFormat) -> BlobFormat {
|
||||
|
||||
@@ -160,9 +160,8 @@ pub fn provider_events(gate: Gate) -> EventSender {
|
||||
conns.remove(&m.inner.connection_id);
|
||||
}
|
||||
ProviderMessage::GetRequestReceived(m) => {
|
||||
let allowed = allow(&gate, &conns, m.inner.connection_id, [
|
||||
m.inner.request.hash,
|
||||
]);
|
||||
let allowed =
|
||||
allow(&gate, &conns, m.inner.connection_id, [m.inner.request.hash]);
|
||||
let verdict = if allowed {
|
||||
Ok(())
|
||||
} else {
|
||||
@@ -200,9 +199,7 @@ pub fn provider_events(gate: Gate) -> EventSender {
|
||||
.map(|i| i.trusted)
|
||||
.unwrap_or(false);
|
||||
let allowed = trusted
|
||||
|| allow(&gate, &conns, m.inner.connection_id, [
|
||||
m.inner.request.hash,
|
||||
]);
|
||||
|| allow(&gate, &conns, m.inner.connection_id, [m.inner.request.hash]);
|
||||
let verdict = if allowed {
|
||||
Ok(())
|
||||
} else {
|
||||
|
||||
@@ -197,10 +197,7 @@ impl BlobStore {
|
||||
Ok((root, total, StoredFormat::HashSeq))
|
||||
}
|
||||
|
||||
async fn import_one(
|
||||
&self,
|
||||
path: PathBuf,
|
||||
) -> Result<(iroh_blobs::api::TempTag, u64), OpError> {
|
||||
async fn import_one(&self, path: PathBuf) -> Result<(iroh_blobs::api::TempTag, u64), OpError> {
|
||||
let tag = self
|
||||
.store
|
||||
.add_path_with_opts(AddPathOptions {
|
||||
@@ -211,7 +208,13 @@ impl BlobStore {
|
||||
.temp_tag()
|
||||
.await
|
||||
.map_err(internal)?;
|
||||
let size = match self.store.blobs().status(tag.hash()).await.map_err(internal)? {
|
||||
let size = match self
|
||||
.store
|
||||
.blobs()
|
||||
.status(tag.hash())
|
||||
.await
|
||||
.map_err(internal)?
|
||||
{
|
||||
BlobStatus::Complete { size } => size,
|
||||
_ => {
|
||||
return Err(OpError::Internal(anyhow::anyhow!(
|
||||
@@ -335,7 +338,11 @@ impl BlobStore {
|
||||
// report the bytes actually present and verified.
|
||||
let bitfield = self.store.blobs().observe(hash).await.map_err(internal)?;
|
||||
let total = bitfield.validated_size().or(size);
|
||||
Ok((bitfield.total_bytes().min(total.unwrap_or(u64::MAX)), total, false))
|
||||
Ok((
|
||||
bitfield.total_bytes().min(total.unwrap_or(u64::MAX)),
|
||||
total,
|
||||
false,
|
||||
))
|
||||
}
|
||||
BlobStatus::Complete { size } => Ok((size, Some(size), true)),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user