]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_avahi.c
Fix build
[netatalk.git] / etc / afpd / afp_avahi.c
index 89ff95fdca66bf01ee8bc2dfa360bd9fb643623c..ef7d529336b7dab60cbaa237b283f1a32ef99f2e 100644 (file)
@@ -44,7 +44,7 @@ static void publish_reply(AvahiEntryGroup *g,
  */
 static void register_stuff(void) {
     uint port;
-    const AFPConfig *config;
+    const AFPObj *obj;
     const struct vol *volume;
     DSI *dsi;
     char name[MAXINSTANCENAMELEN+1];
@@ -92,16 +92,12 @@ static void register_stuff(void) {
         }
 
         /* AFP server */
-        for (config = ctx->configs; config; config = config->next) {
-
-            dsi = (DSI *)config->obj.dsi;
+        for (dsi = obj->dsi; dsi; dsi = dsi->next) {
             port = getip_port((struct sockaddr *)&dsi->server);
 
-            if (convert_string(config->obj.options.unixcharset,
+            if (convert_string(obj->options.unixcharset,
                                CH_UTF8,
-                               config->obj.options.server ?
-                               config->obj.options.server :
-                               config->obj.options.hostname,
+                               obj->options.hostname,
                                -1,
                                name,
                                MAXINSTANCENAMELEN) <= 0) {
@@ -146,8 +142,8 @@ static void register_stuff(void) {
                 goto fail;
             }  /* if */
 
-            if (config->obj.options.mimicmodel) {
-                strlist2 = avahi_string_list_add_printf(strlist2, "model=%s", config->obj.options.mimicmodel);
+            if (obj->options.mimicmodel) {
+                strlist2 = avahi_string_list_add_printf(strlist2, "model=%s", obj->options.mimicmodel);
                 if (avahi_entry_group_add_service_strlst(ctx->group,
                                                          AVAHI_IF_UNSPEC,
                                                          AVAHI_PROTO_UNSPEC,
@@ -278,7 +274,7 @@ static void client_callback(AvahiClient *client,
  * Tries to setup the Zeroconf thread and any
  * neccessary config setting.
  */
-void av_zeroconf_register(const AFPConfig *configs) {
+void av_zeroconf_register(const AFPObj *obj) {
     int error;
 
     /* initialize the struct that holds our config settings. */
@@ -287,7 +283,7 @@ void av_zeroconf_register(const AFPConfig *configs) {
         avahi_entry_group_reset(ctx->group);
     } else {
         ctx = calloc(1, sizeof(struct context));
-        ctx->configs = configs;
+        ctx->obj = obj;
         assert(ctx);
     }