Signed-off-by: Ralph Boehme <rb@sernet.de>
int flag = 1;
setsockopt(dsi->socket, SOL_TCP, TCP_NODELAY, &flag, sizeof(flag));
-#ifdef HAVE_TRACKER
- /* Initialize Spotlight */
- if (obj->options.flags & OPTION_SPOTLIGHT) {
- spotlight_init(obj);
- }
-#endif
-
ipc_child_state(obj, DSI_RUNNING);
/* get stuck here until the end */
int spotlight_init(AFPObj *obj)
{
+ static bool initialized = false;
const char *attributes;
struct sl_ctx *sl_ctx;
+ if (initialized) {
+ return 0;
+ }
+
LOG(log_info, logtype_sl, "Initializing Spotlight");
sl_ctx = talloc_zero(NULL, struct sl_ctx);
tracker_sparql_connection_get_async(sl_ctx->cancellable,
tracker_con_cb, sl_ctx);
+ initialized = true;
return 0;
}
return AFPERR_NOOP;
}
+ spotlight_init(obj);
+
/*
* Process finished glib events
*/