aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Transfers
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-12-17 18:03:43 -0600
committerGitHub <noreply@github.com>2024-12-17 18:03:43 -0600
commit13179b8b6206ae25d79f2cd09d1b635807fb44fd (patch)
treea6f894ece0df5bfd81e484b1e71cf0e051f6cd1f /src/slskd/Transfers
parent3b68fa204b541997e6b6d7ab602ecd9478a0c6a9 (diff)
parent10393094e835755d3dacf5255b3598b5868bbc49 (diff)
downloadslskd-13179b8b6206ae25d79f2cd09d1b635807fb44fd.tar.gz
Merge branch 'master' into multipart
Diffstat (limited to 'src/slskd/Transfers')
-rw-r--r--src/slskd/Transfers/Uploads/UploadService.cs19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/slskd/Transfers/Uploads/UploadService.cs b/src/slskd/Transfers/Uploads/UploadService.cs
index fa9a3359..dff1252b 100644
--- a/src/slskd/Transfers/Uploads/UploadService.cs
+++ b/src/slskd/Transfers/Uploads/UploadService.cs
@@ -232,15 +232,22 @@ namespace slskd.Transfers.Uploads
}
else
{
- var (exists, length) = await Relay.GetFileInfoAsync(agentName: host, filename);
-
- if (!exists || length <= 0)
+ if (OptionsMonitor.CurrentValue.Flags.OptimisticRelayFileInfo)
{
- // todo: force a remote scan
- throw new NotFoundException($"The file '{localFilename}' could not be located on Agent {host}. A share scan should be performed.");
+ localFileLength = resolvedFileLength;
}
+ else
+ {
+ var (exists, length) = await Relay.GetFileInfoAsync(agentName: host, filename);
- localFileLength = length;
+ if (!exists || length <= 0)
+ {
+ // todo: force a remote scan
+ throw new NotFoundException($"The file '{localFilename}' could not be located on Agent {host}. A share scan should be performed.");
+ }
+
+ localFileLength = length;
+ }
}
}
catch (NotFoundException)