X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_dsi.c;h=44d5b0e601d3b1ba7c0d9ea3df6ac6b35100ea33;hb=40c614d84ae5bf7c1808a30a2ccac8db12228519;hp=681c9c2c68b78fb634c1cf03b62c46b4aed46d24;hpb=1a0e659df8e92fce1a34cc1f9eecbf936fb09694;p=netatalk.git diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index 681c9c2c..44d5b0e6 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "switch.h" #include "auth.h" @@ -143,8 +144,6 @@ static void afp_dsi_die(int sig) /* SIGQUIT handler */ static void ipc_reconnect_handler(int sig _U_) { - DSI *dsi = (DSI *)AFPobj->dsi; - if (reconnect_ipc(AFPobj) != 0) { LOG(log_error, logtype_afpd, "ipc_reconnect_handler: failed IPC reconnect"); afp_dsi_close(AFPobj); @@ -381,9 +380,6 @@ static void pending_request(DSI *dsi) void afp_over_dsi_sighandlers(AFPObj *obj) { DSI *dsi = (DSI *) obj->dsi; - int rc_idx; - uint32_t err, cmd; - uint8_t function; struct sigaction action; memset(&action, 0, sizeof(action)); @@ -457,8 +453,8 @@ void afp_over_dsi(AFPObj *obj) { DSI *dsi = (DSI *) obj->dsi; int rc_idx; - u_int32_t err, cmd; - u_int8_t function; + uint32_t err, cmd; + uint8_t function; AFPobj = obj; obj->exit = afp_dsi_die; @@ -495,6 +491,10 @@ void afp_over_dsi(AFPObj *obj) int flag = 1; setsockopt(dsi->socket, SOL_TCP, TCP_NODELAY, &flag, sizeof(flag)); + /* Initialize Spotlight */ + if (obj->options.flags & OPTION_SPOTLIGHT) + sl_mod_load(_PATH_AFPDUAMPATH "slmod_sparql.so"); + /* get stuck here until the end */ while (1) { if (sigsetjmp(recon_jmp, 1) != 0) @@ -552,7 +552,7 @@ void afp_over_dsi(AFPObj *obj) if (reload_request) { reload_request = 0; - load_volumes(AFPobj, closevol); + load_volumes(AFPobj); } /* The first SIGINT enables debugging, the next restores the config */ @@ -629,7 +629,7 @@ void afp_over_dsi(AFPObj *obj) LOG(log_debug, logtype_afpd, "<== Start AFP command: %s", AfpNum2name(function)); err = (*afp_switch[function])(obj, - (char *)&dsi->commands, dsi->cmdlen, + (char *)dsi->commands, dsi->cmdlen, (char *)&dsi->data, &dsi->datalen); LOG(log_debug, logtype_afpd, "==> Finished AFP command: %s -> %s", @@ -670,7 +670,7 @@ void afp_over_dsi(AFPObj *obj) LOG(log_debug, logtype_afpd, "<== Start AFP command: %s", AfpNum2name(function)); err = (*afp_switch[function])(obj, - (char *)&dsi->commands, dsi->cmdlen, + (char *)dsi->commands, dsi->cmdlen, (char *)&dsi->data, &dsi->datalen); LOG(log_debug, logtype_afpd, "==> Finished AFP command: %s -> %s",