propagate regex flag in queries in preparation for regex search

auto-update
Zlatin Balevsky 2022-01-10 11:29:35 +00:00
parent 548a981b16
commit bd3555dce9
No known key found for this signature in database
GPG Key ID: A72832072D525E41
2 changed files with 9 additions and 1 deletions

View File

@ -157,6 +157,7 @@ abstract class Connection implements Closeable {
query.compressedResults = e.searchEvent.compressedResults
query.collections = e.searchEvent.collections
query.searchPaths = e.searchEvent.searchPaths
query.regex = e.searchEvent.regex
if (e.searchEvent.searchHash != null)
query.infohash = Base64.encode(e.searchEvent.searchHash)
query.replyTo = e.replyTo.toBase64()
@ -286,6 +287,9 @@ abstract class Connection implements Closeable {
boolean searchPaths = false
if (search.searchPaths != null)
searchPaths = search.searchPaths
boolean regex = false
if (search.regex != null)
regex = search.regex
byte[] sig = null
if (search.sig != null) {
@ -342,6 +346,7 @@ abstract class Connection implements Closeable {
compressedResults : compressedResults,
collections : collections,
searchPaths: searchPaths,
regex: regex,
persona : originator)
QueryEvent event = new QueryEvent ( searchEvent : searchEvent,
replyTo : replyTo,

View File

@ -15,11 +15,14 @@ class SearchEvent extends Event {
Persona persona
boolean collections
boolean searchPaths
boolean regex
String toString() {
def infoHash = null
if (searchHash != null)
infoHash = new InfoHash(searchHash)
"searchTerms: $searchTerms searchHash:$infoHash, uuid:$uuid oobInfohash:$oobInfohash searchComments:$searchComments compressedResults:$compressedResults"
"searchTerms: $searchTerms searchHash:$infoHash, uuid:$uuid " +
"oobInfohash:$oobInfohash searchComments:$searchComments " +
"compressedResults:$compressedResults regex:$regex"
}
}