aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-08-14 10:28:05 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-08-14 10:28:05 -0500
commitc99b61a60004b34edf0e93bfdf83cba27f90b6eb (patch)
treeaad223da11247e97fc72f6cd45e590dbb5019e9e
parent48ebdcf79b966ca610c362c377c0170e355ac862 (diff)
downloadslskd-c99b61a60004b34edf0e93bfdf83cba27f90b6eb.tar.gz
drop incoming searches that only include excluded terms
-rw-r--r--src/slskd/Application.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index 29b6f656..63b29d84 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -881,6 +881,13 @@ namespace slskd
return null;
}
+ // sometimes clients send search queries consisting only of exclusions; drop them.
+ // no other clients send search results for these, even though it is technically possible.
+ if (!query.Terms.Any())
+ {
+ return null;
+ }
+
try
{
var results = await Shares.SearchAsync(query);