]> arthur.barton.de Git - netatalk.git/commitdiff
Spotlight: enhance behaviour for long running queries
authorRalph Boehme <rb@sernet.de>
Fri, 29 Aug 2014 08:58:51 +0000 (10:58 +0200)
committerRalph Boehme <rb@sernet.de>
Fri, 29 Aug 2014 12:39:40 +0000 (14:39 +0200)
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 <rb@sernet.de>
NEWS
etc/afpd/spotlight.c

diff --git a/NEWS b/NEWS
index a306a1e9d5306866e0d695ff5d04582fc72254e2..f98e319d180ae1be166c3d3fa69923df435f9570 100644 (file)
--- 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
index 8644d465d24e629c1aa956141af6ba8ab9c607d0..d2539b8358e25684e3d4c568ee8cce9df55c73ea 100644 (file)
@@ -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) {