From: Ralph Boehme Date: Fri, 29 Aug 2014 08:58:51 +0000 (+0200) Subject: Spotlight: enhance behaviour for long running queries X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=2e2040f26fda19d0db3de3f914b55ee657741ca1 Spotlight: enhance behaviour for long running queries Status code 35 is taken from an AFP packet capture. Clients will now show a "progress wheel" while waiting for initial results. Signed-off-by: Ralph Boehme --- diff --git a/NEWS b/NEWS index a306a1e9..f98e319d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +Changes in 3.1.7 +================ +* UPD: Spotlight: enhance behaviour for long running queries, client + will now show "progress wheel" while waiting for first results. + Changes in 3.1.6 ================ * FIX: Spotlight: fix for long running queries diff --git a/etc/afpd/spotlight.c b/etc/afpd/spotlight.c index 8644d465..d2539b83 100644 --- a/etc/afpd/spotlight.c +++ b/etc/afpd/spotlight.c @@ -402,7 +402,7 @@ static bool create_result_handle(slq_t *slq) static bool add_results(sl_array_t *array, slq_t *slq) { sl_filemeta_t *fm; - uint64_t status = 0; + uint64_t status; /* FileMeta */ fm = talloc_zero(array, sl_filemeta_t); @@ -410,6 +410,19 @@ static bool add_results(sl_array_t *array, slq_t *slq) return false; } + switch (slq->slq_state) { + case SLQ_STATE_RUNNING: + /* + * Wtf, why 35? Taken from an AFP capture. + */ + status = 35; + break; + + default: + status = 0; + break; + } + dalloc_add_copy(array, &status, uint64_t); dalloc_add(array, slq->query_results->cnids, sl_cnids_t); if (slq->query_results->num_results > 0) {