]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge changes from CUPS 1.4svn-r7864.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 26 Aug 2008 03:49:44 +0000 (03:49 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 26 Aug 2008 03:49:44 +0000 (03:49 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@921 a1ca3aef-8c08-0410-bb20-df032aa958be

16 files changed:
CHANGES-1.3.txt
Makefile
backend/snmp-supplies.c
cups/Makefile
cups/conflicts.c
cups/dest.c
cups/emit.c
cups/testppd.c
doc/help/api-cups.html
doc/help/api-filter.html
doc/help/api-httpipp.html
doc/help/api-ppd.html
filter/interpret.c
scheduler/cupsfilter.c
scheduler/main.c
scheduler/network.c

index c12c81ba0705d7f1e407f8f749ef3be96f3e12ea..ced5b20d7c2902be332ae9af5a22b03a802954e2 100644 (file)
@@ -3,6 +3,12 @@ CHANGES-1.3.txt
 
 CHANGES IN CUPS V1.3.9
 
+       - PJL panel messages were not reset correctly on older
+         printers (STR #2909)
+       - cupsfilter used the wrong default path (STR #2908)
+       - Fixed address matching for "BrowseAddress @IF(name)"
+         (STR #2910)
+       - Fixed compiles on AIX.
        - Firefox 3 did not work with the CUPS web interface in SSL
          mode (STR #2892)
        - Custom options with multiple parameters were not emitted
index 017378db38ebe07fcda3809e38c2d7146bf03a56..9354f05ca43a4982eead7a568b969d559b255dcf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -116,7 +116,7 @@ clang:
        fi
        $(MAKE) $(MFLAGS) CC="scan-build -o ../clang $(CC)" \
                CXX="scan-build -o ../clang $(CXX)" clean all
-       test `ls -1 clang | wc -l` != 0 || exit 1
+       test `ls -1 clang | wc -l` = 0
 
 
 #
index 366750928de7d87a3e18bf59f253800b0787bd63..1267d25021276992fe4101a2a1481eaa1f7461c5 100644 (file)
@@ -169,7 +169,10 @@ backendSNMPSupplies(
       if (i)
         *ptr++ = ',';
 
-      sprintf(ptr, "%d", 100 * supplies[i].level / supplies[i].max_capacity);
+      if (supplies[i].max_capacity > 0)
+        sprintf(ptr, "%d", 100 * supplies[i].level / supplies[i].max_capacity);
+      else
+        strcpy(ptr, "-1");
     }
 
     fprintf(stderr, "ATTR: marker-levels=%s\n", value);
index 735c89dd97c2a4d542894917f620e54befae388b..584276a16872babff7d60170559af1a19ff10df2 100644 (file)
@@ -73,6 +73,7 @@ OBJS  =       \
                $(LIB64OBJS) \
                testadmin.o \
                testarray.o \
+               testconflicts.o \
                testcups.o \
                testfile.o \
                testhttp.o \
@@ -127,6 +128,7 @@ LIBTARGETS =        \
 TARGETS        =       \
                $(LIBTARGETS) \
                testadmin \
+               testconflicts \
                testcups \
                testsnmp
 
@@ -401,6 +403,16 @@ testarray: testarray.o libcups.a
        ./testarray
 
 
+#
+# testconflicts (dependency on static CUPS library is intentional)
+#
+
+testconflicts: testconflicts.o libcups.a
+       echo Linking $@...
+       $(CC) $(LDFLAGS) -o $@ testconflicts.o libcups.a \
+               $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+
+
 #
 # testcups (dependency on static CUPS library is intentional)
 #
index f497f046f1049d02910bac3368f178de28329612..aab26d1e7ac7a5f8e966eff65ce31ba5afb7fd08 100644 (file)
  *
  * Contents:
  *
+ *   cupsResolveConflicts()   - Resolve conflicts in a marked PPD.
  *   ppdConflicts()           - Check to see if there are any conflicts among
  *                              the marked option choices.
  *   ppdInstallableConflict() - Test whether an option choice conflicts with an
  *                              installable option.
- *   cupsResolveConflicts()   - Resolve conflicts in a marked PPD.
  *   ppd_is_installable()     - Determine whether an option is in the
  *                              InstallableOptions group.
  *   ppd_load_constraints()   - Load constraints from a PPD file.
@@ -57,139 +57,47 @@ enum
 static int             ppd_is_installable(ppd_group_t *installable,
                                           const char *option);
 static void            ppd_load_constraints(ppd_file_t *ppd);
-static cups_array_t    *ppd_test_constraints(ppd_file_t *ppd, int num_options,
+static cups_array_t    *ppd_test_constraints(ppd_file_t *ppd,
+                                             const char *option,
+                                             const char *choice,
+                                             int num_options,
                                              cups_option_t *options,
                                              int which);
 
 
-/*
- * 'ppdConflicts()' - Check to see if there are any conflicts among the
- *                    marked option choices.
- *
- * The returned value is the same as returned by @link ppdMarkOption@.
- */
-
-int                                    /* O - Number of conflicts found */
-ppdConflicts(ppd_file_t *ppd)          /* I - PPD to check */
-{
-  int                  i,              /* Looping variable */
-                       conflicts;      /* Number of conflicts */
-  cups_array_t         *active;        /* Active conflicts */
-  _ppd_cups_uiconsts_t *c;             /* Current constraints */
-  _ppd_cups_uiconst_t  *cptr;          /* Current constraint */
-  ppd_option_t *o;                     /* Current option */
-
-
-  if (!ppd)
-    return (0);
-
- /*
-  * Clear all conflicts...
-  */
-
-  for (o = ppdFirstOption(ppd); o; o = ppdNextOption(ppd))
-    o->conflicted = 0;
-
- /*
-  * Test for conflicts...
-  */
-
-  active    = ppd_test_constraints(ppd, 0, NULL, _PPD_ALL_CONSTRAINTS);
-  conflicts = cupsArrayCount(active);
-
- /*
-  * Loop through all of the UI constraints and flag any options
-  * that conflict...
-  */
-
-  for (c = (_ppd_cups_uiconsts_t *)cupsArrayFirst(active);
-       c;
-       c = (_ppd_cups_uiconsts_t *)cupsArrayNext(active))
-  {
-    for (i = c->num_constraints, cptr = c->constraints;
-         i > 0;
-        i --, cptr ++)
-      cptr->option->conflicted = 1;
-  }
-
-  cupsArrayDelete(active);
-
- /*
-  * Return the number of conflicts found...
-  */
-
-  return (conflicts);
-}
-
-
-/*
- * 'ppdInstallableConflict()' - Test whether an option choice conflicts with
- *                              an installable option.
- *
- * This function tests whether a particular option choice is available based
- * on constraints against options in the "InstallableOptions" group.
- *
- * @since CUPS 1.4@
- */
-
-int                                    /* O - 1 if conflicting, 0 if not conflicting */
-ppdInstallableConflict(
-    ppd_file_t *ppd,                   /* I - PPD file */
-    const char *option,                        /* I - Option */
-    const char *choice)                        /* I - Choice */
-{
-  cups_array_t *active;                /* Active conflicts */
-  cups_option_t        test;                   /* Test against this option */
-
-
- /* 
-  * Range check input...
-  */
-
-  if (!ppd || !option || !choice)
-    return (0);
-
- /*
-  * Test constraints using the new option...
-  */
-
-  test.name  = (char *)option;
-  test.value = (char *)choice;
-  active     = ppd_test_constraints(ppd, 1, &test,
-                                    _PPD_INSTALLABLE_CONSTRAINTS);
-
-  cupsArrayDelete(active);
-
-  return (active != NULL);
-}
-
-
 /*
  * 'cupsResolveConflicts()' - Resolve conflicts in a marked PPD.
  *
  * This function attempts to resolve any conflicts in a marked PPD, returning
- * a list of option changes that are required to resolve any conflicts.  On
- * input, "num_options" and "options" contain any pending option changes that
- * have not yet been marked, while "option" and "choice" contain the most recent
+ * a list of option changes that are required to resolve them.  On input,
+ * "num_options" and "options" contain any pending option changes that have
+ * not yet been marked, while "option" and "choice" contain the most recent
  * selection which may or may not be in "num_options" or "options".
  *
  * On successful return, "num_options" and "options" are updated to contain
  * "option" and "choice" along with any changes required to resolve conflicts
- * specified in the PPD file.  If option conflicts cannot be resolved,
- * "num_options" and "options" are not changed.
+ * specified in the PPD file and 1 is returned.
+ *
+ * If option conflicts cannot be resolved, "num_options" and "options" are not
+ * changed and 0 is returned.
  *
- * @code ppdResolveConflicts@ uses one of two sources of option constraint
- * information.  The preferred constraint information is defined by
+ * When resolving conflicts, @code cupsResolveConflicts@ does not consider
+ * changes to the current page size (@code media@, @code PageSize@, and
+ * @code PageRegion@) or to the most recent option specified in "option".
+ * Thus, if the only way to resolve a conflict is to change the page size
+ * or the option the user most recently changed, @code cupsResolveConflicts@
+ * will return 0 to indicate it was unable to resolve the conflicts.
+ *
+ * The @code cupsResolveConflicts@ function uses one of two sources of option
+ * constraint information.  The preferred constraint information is defined by
  * @code cupsUIConstraints@ and @code cupsUIResolver@ attributes - in this
- * case, the PPD file provides constraint resolution actions.  In this case,
- * it should not be possible for @ppdResolveConflicts@ to fail, however it
- * will do so if a resolver loop is detected.
+ * case, the PPD file provides constraint resolution actions.
  *
- * The backup constraint infomration is defined by the
+ * The backup constraint information is defined by the
  * @code UIConstraints@ and @code NonUIConstraints@ attributes.  These
- * constraints are resolved algorithmically by selecting the default choice
- * for the conflicting option.  Unfortunately, this method is far more likely
- * to fail.
+ * constraints are resolved algorithmically by first selecting the default
+ * choice for the conflicting option, then iterating over all possible choices
+ * until a non-conflicting option choice is found.
  *
  * @since CUPS 1.4@
  */
@@ -203,8 +111,10 @@ cupsResolveConflicts(
     cups_option_t **options)           /* IO - Additional selected options */
 {
   int                  i,              /* Looping var */
-                       num_newopts;    /* Number of new options */
-  cups_option_t                *newopts;       /* New options */
+                       num_newopts,    /* Number of new options */
+                       num_resopts;    /* Number of resolver options */
+  cups_option_t                *newopts,       /* New options */
+                       *resopts;       /* Resolver options */
   cups_array_t         *active,        /* Active constraints */
                        *pass,          /* Resolvers for this pass */
                        *resolvers;     /* Resolvers we have used */
@@ -214,7 +124,6 @@ cupsResolveConflicts(
   const char           *value;         /* Selected option value */
   int                  changed;        /* Did we change anything? */
   ppd_choice_t         *marked;        /* Marked choice */
-  ppd_option_t         *ignored;       /* Ignored option */
 
 
  /*
@@ -246,7 +155,7 @@ cupsResolveConflicts(
   resolvers = NULL;
   pass      = cupsArrayNew((cups_array_func_t)strcasecmp, NULL);
 
-  while ((active = ppd_test_constraints(ppd, num_newopts, newopts,
+  while ((active = ppd_test_constraints(ppd, NULL, NULL, num_newopts, newopts,
                                         _PPD_ALL_CONSTRAINTS)) != NULL)
   {
     if (!resolvers)
@@ -298,18 +207,39 @@ cupsResolveConflicts(
         cupsArrayAdd(pass, consts->resolver);
        cupsArrayAdd(resolvers, consts->resolver);
 
+        if (option && choice)
+       {
+         resopts     = NULL;
+         num_resopts = _ppdParseOptions(resolver->value, 0, &resopts);
+
+          if ((value = cupsGetOption(option, num_newopts, newopts)) != NULL &&
+             !strcasecmp(value, choice))
+         {
+           DEBUG_printf(("cupsResolveConflicts: Resolver %s changes %s!\n",
+                         consts->resolver, option));
+           cupsFreeOptions(num_resopts, resopts);
+           goto error;
+          }
+
+         cupsFreeOptions(num_resopts, resopts);
+       }
+
         num_newopts = _ppdParseOptions(resolver->value, num_newopts, &newopts);
-       changed     = 1;
+        changed     = 1;
       }
       else
       {
        /*
         * Try resolving by choosing the default values for non-installable
-       * options...
+       * options, then by iterating through the possible choices...
        */
 
-        for (i = consts->num_constraints, constptr = consts->constraints,
-                ignored = NULL;
+        int            j;              /* Looping var */
+       ppd_choice_t    *cptr;          /* Current choice */
+        cups_array_t   *test;          /* Test array for conflicts */
+
+
+        for (i = consts->num_constraints, constptr = consts->constraints;
             i > 0;
             i --, constptr ++)
        {
@@ -319,10 +249,7 @@ cupsResolveConflicts(
            continue;
 
          if (option && !strcasecmp(constptr->option->keyword, option))
-         {
-           ignored = constptr->option;
            continue;
-         }
 
           if ((value = cupsGetOption(constptr->option->keyword, num_newopts,
                                     newopts)) == NULL)
@@ -331,35 +258,64 @@ cupsResolveConflicts(
            value  = marked ? marked->choice : "";
          }
 
-          if (strcasecmp(value, constptr->option->defchoice))
-         {
-           num_newopts = cupsAddOption(constptr->option->keyword,
-                                       constptr->option->defchoice,
-                                       num_newopts, &newopts);
-            changed     = 1;
-         }
-        }
-
-        if (ignored && !changed)
-       {
-        /*
-         * No choice, have to back out this selection...
+         /*
+         * Try the default choice...
          */
 
-          if ((value = cupsGetOption(ignored->keyword, num_newopts,
-                                    newopts)) == NULL)
-          {
-           marked = ppdFindMarkedChoice(ppd, ignored->keyword);
-           value  = marked ? marked->choice : "";
-         }
+          test = NULL;
 
-          if (strcasecmp(value, ignored->defchoice))
+          if (strcasecmp(value, constptr->option->defchoice) &&
+             (test = ppd_test_constraints(ppd, constptr->option->keyword,
+                                          constptr->option->defchoice,
+                                          num_newopts, newopts,
+                                          _PPD_ALL_CONSTRAINTS)) == NULL)
          {
-           num_newopts = cupsAddOption(ignored->keyword, ignored->defchoice,
+          /*
+           * That worked...
+           */
+
+           num_newopts = cupsAddOption(constptr->option->keyword,
+                                       constptr->option->defchoice,
                                        num_newopts, &newopts);
             changed     = 1;
          }
-       }
+         else
+         {
+          /*
+           * Try each choice instead...
+           */
+
+            cupsArrayDelete(test);
+
+            for (j = constptr->option->num_choices,
+                    cptr = constptr->option->choices;
+                j > 0;
+                j --, cptr ++)
+            {
+             test = NULL;
+
+             if (strcasecmp(value, cptr->choice) &&
+                 strcasecmp(constptr->option->defchoice, cptr->choice) &&
+                 (test = ppd_test_constraints(ppd, constptr->option->keyword,
+                                              cptr->choice, num_newopts,
+                                              newopts,
+                                              _PPD_ALL_CONSTRAINTS)) == NULL)
+             {
+              /*
+               * This choice works...
+               */
+
+               num_newopts = cupsAddOption(constptr->option->keyword,
+                                           cptr->choice, num_newopts,
+                                           &newopts);
+               changed     = 1;
+               break;
+             }
+
+              cupsArrayDelete(test);
+           }
+          }
+        }
       }
 
       if (!changed)
@@ -422,6 +378,106 @@ cupsResolveConflicts(
 }
 
 
+/*
+ * 'ppdConflicts()' - Check to see if there are any conflicts among the
+ *                    marked option choices.
+ *
+ * The returned value is the same as returned by @link ppdMarkOption@.
+ */
+
+int                                    /* O - Number of conflicts found */
+ppdConflicts(ppd_file_t *ppd)          /* I - PPD to check */
+{
+  int                  i,              /* Looping variable */
+                       conflicts;      /* Number of conflicts */
+  cups_array_t         *active;        /* Active conflicts */
+  _ppd_cups_uiconsts_t *c;             /* Current constraints */
+  _ppd_cups_uiconst_t  *cptr;          /* Current constraint */
+  ppd_option_t *o;                     /* Current option */
+
+
+  if (!ppd)
+    return (0);
+
+ /*
+  * Clear all conflicts...
+  */
+
+  for (o = ppdFirstOption(ppd); o; o = ppdNextOption(ppd))
+    o->conflicted = 0;
+
+ /*
+  * Test for conflicts...
+  */
+
+  active    = ppd_test_constraints(ppd, NULL, NULL, 0, NULL,
+                                   _PPD_ALL_CONSTRAINTS);
+  conflicts = cupsArrayCount(active);
+
+ /*
+  * Loop through all of the UI constraints and flag any options
+  * that conflict...
+  */
+
+  for (c = (_ppd_cups_uiconsts_t *)cupsArrayFirst(active);
+       c;
+       c = (_ppd_cups_uiconsts_t *)cupsArrayNext(active))
+  {
+    for (i = c->num_constraints, cptr = c->constraints;
+         i > 0;
+        i --, cptr ++)
+      cptr->option->conflicted = 1;
+  }
+
+  cupsArrayDelete(active);
+
+ /*
+  * Return the number of conflicts found...
+  */
+
+  return (conflicts);
+}
+
+
+/*
+ * 'ppdInstallableConflict()' - Test whether an option choice conflicts with
+ *                              an installable option.
+ *
+ * This function tests whether a particular option choice is available based
+ * on constraints against options in the "InstallableOptions" group.
+ *
+ * @since CUPS 1.4@
+ */
+
+int                                    /* O - 1 if conflicting, 0 if not conflicting */
+ppdInstallableConflict(
+    ppd_file_t *ppd,                   /* I - PPD file */
+    const char *option,                        /* I - Option */
+    const char *choice)                        /* I - Choice */
+{
+  cups_array_t *active;                /* Active conflicts */
+
+
+ /* 
+  * Range check input...
+  */
+
+  if (!ppd || !option || !choice)
+    return (0);
+
+ /*
+  * Test constraints using the new option...
+  */
+
+  active = ppd_test_constraints(ppd, option, choice, 0, NULL,
+                               _PPD_INSTALLABLE_CONSTRAINTS);
+
+  cupsArrayDelete(active);
+
+  return (active != NULL);
+}
+
+
 /*
  * 'ppd_is_installable()' - Determine whether an option is in the
  *                          InstallableOptions group.
@@ -700,7 +756,6 @@ ppd_load_constraints(ppd_file_t *ppd)       /* I - PPD file */
 }
 
 
-
 /*
  * 'ppd_test_constraints()' - See if any constraints are active.
  */
@@ -708,6 +763,8 @@ ppd_load_constraints(ppd_file_t *ppd)       /* I - PPD file */
 static cups_array_t *                  /* O - Array of active constraints */
 ppd_test_constraints(
     ppd_file_t    *ppd,                        /* I - PPD file */
+    const char    *option,             /* I - Current option */
+    const char    *choice,             /* I - Current choice */
     int           num_options,         /* I - Number of additional options */
     cups_option_t *options,            /* I - Additional options */
     int           which)               /* I - Which constraints to test */
@@ -719,24 +776,48 @@ ppd_test_constraints(
                        *marked;        /* Marked choice */
   cups_array_t         *active = NULL; /* Active constraints */
   const char           *value;         /* Current value */
+  int                  option_conflict;/* Conflict with current option? */
+
 
+  DEBUG_printf(("ppd_test_constraints(ppd=%p, num_options=%d, options=%p, "
+                "which=%d)\n", ppd, num_options, options, which));
 
   if (!ppd->cups_uiconstraints)
     ppd_load_constraints(ppd);
 
+  DEBUG_printf(("ppd_test_constraints: %d constraints!\n",
+               cupsArrayCount(ppd->cups_uiconstraints)));
+
   cupsArraySave(ppd->marked);
 
   for (consts = (_ppd_cups_uiconsts_t *)cupsArrayFirst(ppd->cups_uiconstraints);
        consts;
        consts = (_ppd_cups_uiconsts_t *)cupsArrayNext(ppd->cups_uiconstraints))
   {
+    DEBUG_printf(("ppd_test_constraints: installable=%d, resolver=\"%s\", "
+                  "num_constraints=%d option1=\"%s\", choice1=\"%s\", "
+                 "option2=\"%s\", choice2=\"%s\", ...\n",
+                 consts->installable, consts->resolver, consts->num_constraints,
+                 consts->constraints[0].option->keyword,
+                 consts->constraints[0].choice ?
+                     consts->constraints[0].choice->choice : "",
+                 consts->constraints[1].option->keyword,
+                 consts->constraints[1].choice ?
+                     consts->constraints[1].choice->choice : ""));
+
     if (which != _PPD_ALL_CONSTRAINTS && which != consts->installable)
       continue;
 
-    for (i = consts->num_constraints, constptr = consts->constraints;
+    DEBUG_puts("ppd_test_constraints: Testing...");
+
+    for (i = consts->num_constraints, constptr = consts->constraints,
+             option_conflict = 0;
          i > 0;
         i --, constptr ++)
     {
+      DEBUG_printf(("ppd_test_constraints: %s=%s?\n", constptr->option->keyword,
+                   constptr->choice ? constptr->choice->choice : ""));
+
       if (constptr->choice &&
           (!strcasecmp(constptr->option->keyword, "PageSize") ||
            !strcasecmp(constptr->option->keyword, "PageRegion")))
@@ -747,7 +828,17 @@ ppd_test_constraints(
        * of an individual option...
        */
 
-        if ((value = cupsGetOption("PageSize", num_options, options)) == NULL)
+        if (option && choice &&
+           (!strcasecmp(option, "PageSize") ||
+            !strcasecmp(option, "PageRegion")))
+       {
+         value = choice;
+
+         if (!strcasecmp(value, constptr->choice->choice))
+           option_conflict = 1;
+        }
+       else if ((value = cupsGetOption("PageSize", num_options,
+                                       options)) == NULL)
          if ((value = cupsGetOption("PageRegion", num_options,
                                     options)) == NULL)
            if ((value = cupsGetOption("media", num_options, options)) == NULL)
@@ -759,25 +850,53 @@ ppd_test_constraints(
            }
 
         if (!value || strcasecmp(value, constptr->choice->choice))
+       {
+         DEBUG_puts("ppd_test_constraints: NO");
          break;
+       }
       }
       else if (constptr->choice)
       {
-        if ((value = cupsGetOption(constptr->option->keyword, num_options,
-                                  options)) != NULL)
+        if (option && choice && !strcasecmp(option, constptr->option->keyword))
+       {
+         if (strcasecmp(choice, constptr->choice->choice))
+           break;
+
+         option_conflict = 1;
+       }
+        else if ((value = cupsGetOption(constptr->option->keyword, num_options,
+                                       options)) != NULL)
         {
          if (strcasecmp(value, constptr->choice->choice))
+         {
+           DEBUG_puts("ppd_test_constraints: NO");
            break;
+         }
        }
         else if (!constptr->choice->marked)
+       {
+         DEBUG_puts("ppd_test_constraints: NO");
+         break;
+       }
+      }
+      else if (option && choice &&
+               !strcasecmp(option, constptr->option->keyword))
+      {
+       if (!strcasecmp(choice, "None") || !strcasecmp(choice, "Off") ||
+           !strcasecmp(choice, "False"))
           break;
+
+       option_conflict = 1;
       }
       else if ((value = cupsGetOption(constptr->option->keyword, num_options,
                                      options)) != NULL)
       {
        if (!strcasecmp(value, "None") || !strcasecmp(value, "Off") ||
            !strcasecmp(value, "False"))
-          break;
+       {
+         DEBUG_puts("ppd_test_constraints: NO");
+         break;
+       }
       }
       else
       {
@@ -788,21 +907,28 @@ ppd_test_constraints(
            (!strcasecmp(marked->choice, "None") ||
             !strcasecmp(marked->choice, "Off") ||
             !strcasecmp(marked->choice, "False")))
+       {
+         DEBUG_puts("ppd_test_constraints: NO");
          break;
+       }
       }
     }
 
-    if (i <= 0)
+    if (i <= 0 && (!option || option_conflict))
     {
       if (!active)
         active = cupsArrayNew(NULL, NULL);
 
       cupsArrayAdd(active, consts);
+      DEBUG_puts("ppd_test_constraints: Added...");
     }
   }
 
   cupsArrayRestore(ppd->marked);
 
+  DEBUG_printf(("ppd_test_constraints: Found %d active constraints!\n",
+                cupsArrayCount(active)));
+
   return (active);
 }
 
index cc8f6a35aa3ed682ae3e9e807d0b535f9882b29e..7c09535760cd7c187c2bcd392fcf04dcaf15aeab 100644 (file)
@@ -31,9 +31,9 @@
  *                           server.
  *   cupsSetDests2()       - Save the list of destinations for the specified
  *                           server.
+ *   appleCopyLocations()  - Get the location history array.
  *   appleCopyNetwork()    - Get the network ID for the current location.
  *   appleGetDefault()     - Get the default printer for this location.
- *   appleGetLocations()   - Get the location history array.
  *   appleGetPrinter()     - Get a printer from the history array.
  *   appleSetDefault()     - Set the default printer for this location.
  *   appleUseLastPrinter() - Get the default printer preference value.
@@ -73,9 +73,9 @@
  */
 
 #ifdef __APPLE__
+static CFArrayRef appleCopyLocations(void);
 static CFStringRef appleCopyNetwork(void);
 static char    *appleGetDefault(char *name, int namesize);
-static CFArrayRef appleGetLocations(void);
 static CFStringRef appleGetPrinter(CFArrayRef locations, CFStringRef network,
                                   CFIndex *locindex);
 static void    appleSetDefault(const char *name);
@@ -935,6 +935,34 @@ cupsSetDests2(http_t      *http,   /* I - Connection to server or @code CUPS_HTTP_
 
 
 #ifdef __APPLE__
+/*
+ * 'appleCopyLocations()' - Copy the location history array.
+ */
+
+static CFArrayRef                      /* O - Location array or NULL */
+appleCopyLocations(void)
+{
+  CFArrayRef   locations;              /* Location array */
+
+
+ /*
+  * Look up the location array in the preferences...
+  */
+
+  if ((locations = CFPreferencesCopyAppValue(kLocationHistoryArrayKey,
+                                             kPMPrintingPreferences)) == NULL)
+    return (NULL);
+
+  if (CFGetTypeID(locations) != CFArrayGetTypeID())
+  {
+    CFRelease(locations);
+    return (NULL);
+  }
+
+  return (locations);
+}
+
+
 /*
  * 'appleCopyNetwork()' - Get the network ID for the current location.
  */
@@ -1016,7 +1044,7 @@ appleGetDefault(char *name,               /* I - Name buffer */
   * Lookup the network in the preferences...
   */
 
-  if ((locations = appleGetLocations()) == NULL)
+  if ((locations = appleCopyLocations()) == NULL)
   {
    /*
     * Missing or bad location array, so no location-based default...
@@ -1038,6 +1066,7 @@ appleGetDefault(char *name,               /* I - Name buffer */
     name[0] = '\0';
 
   CFRelease(network);
+  CFRelease(locations);
 
   DEBUG_printf(("appleGetDefault: Returning \"%s\"...\n", name));
 
@@ -1045,34 +1074,6 @@ appleGetDefault(char *name,              /* I - Name buffer */
 }
 
 
-/*
- * 'appleGetLocations()' - Get the location history array.
- */
-
-static CFArrayRef                      /* O - Location array or NULL */
-appleGetLocations(void)
-{
-  CFArrayRef   locations;              /* Location array */
-
-
- /*
-  * Look up the location array in the preferences...
-  */
-
-  if ((locations = CFPreferencesCopyAppValue(kLocationHistoryArrayKey,
-                                             kPMPrintingPreferences)) == NULL)
-    return (NULL);
-
-  if (CFGetTypeID(locations) != CFArrayGetTypeID())
-  {
-    CFRelease(locations);
-    return (NULL);
-  }
-
-  return (locations);
-}
-
-
 /*
  * 'appleGetPrinter()' - Get a printer from the history array.
  */
@@ -1149,7 +1150,7 @@ appleSetDefault(const char *name) /* I - Default printer/class name */
   * Lookup the network in the preferences...
   */
 
-  if ((locations = appleGetLocations()) != NULL)
+  if ((locations = appleCopyLocations()) != NULL)
     locprinter = appleGetPrinter(locations, network, &locindex);
   else
   {
@@ -1212,6 +1213,9 @@ appleSetDefault(const char *name) /* I - Default printer/class name */
       CFRelease(newlocation);
   }
 
+  if (locations)
+    CFRelease(locations);
+
   CFRelease(network);
   CFRelease(newprinter);
 }
index f36a48d983d4810d089a95f7b8090912747fbee5..c7635559321c70f69cd461fa367d9d62dca37d39 100644 (file)
@@ -549,7 +549,7 @@ ppdEmitJCLEnd(ppd_file_t *ppd,              /* I - PPD file record */
     */
 
     fputs("\033%-12345X@PJL\n", fp);
-    fputs("@PJL RDYMSG DISPLAY = \"READY\"\n", fp);
+    fputs("@PJL RDYMSG DISPLAY = \"\"\n", fp);
     fputs(ppd->jcl_end + 9, fp);
   }
   else
index c52309e3927558cf2793798cdaa5aae7bb85c79f..5318c4d240ee5766e282b4b746653f0ef705423c 100644 (file)
@@ -222,14 +222,26 @@ main(int  argc,                           /* I - Number of command-line arguments */
       status ++;
     }
 
-    fputs("cupsResolveConflicts(): ", stdout);
+    fputs("cupsResolveConflicts(InputSlot=Envelope): ", stdout);
     num_options = 0;
     options     = NULL;
     if (cupsResolveConflicts(ppd, "InputSlot", "Envelope", &num_options,
-                             &options) &&
-        num_options == 1 && !strcasecmp(options->name, "InputSlot") &&
-       !strcasecmp(options->value, "Tray"))
-      puts("PASS");
+                             &options))
+    {
+      puts("FAIL (Resolved but shouldn't be able to!)");
+      status ++;
+    }
+    else
+      puts("PASS (Unable to resolve)");
+    cupsFreeOptions(num_options, options);
+
+    fputs("cupsResolveConflicts(No option/choice): ", stdout);
+    num_options = 0;
+    options     = NULL;
+    if (cupsResolveConflicts(ppd, NULL, NULL, &num_options, &options) &&
+        num_options == 1 && !strcasecmp(options[0].name, "InputSlot") &&
+       !strcasecmp(options[0].value, "Manual"))
+      puts("PASS (Resolved)");
     else if (num_options > 0)
     {
       printf("FAIL (%d options:", num_options);
@@ -240,7 +252,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
     }
     else
     {
-      puts("FAIL (Unable to resolve!)");
+      puts("FAIL (Unable to resolve)");
       status ++;
     }
     cupsFreeOptions(num_options, options);
@@ -452,11 +464,26 @@ main(int  argc,                           /* I - Number of command-line arguments */
       status ++;
     }
 
-    fputs("cupsResolveConflicts(): ", stdout);
+    fputs("cupsResolveConflicts(Quality=Photo): ", stdout);
     num_options = 0;
     options     = NULL;
     if (cupsResolveConflicts(ppd, "Quality", "Photo", &num_options,
-                            &options) &&
+                             &options))
+    {
+      printf("FAIL (%d options:", num_options);
+      for (i = 0; i < num_options; i ++)
+        printf(" %s=%s", options[i].name, options[i].value);
+      puts(")");
+      status ++;
+    }
+    else
+      puts("PASS (Unable to resolve)");
+    cupsFreeOptions(num_options, options);
+
+    fputs("cupsResolveConflicts(No option/choice): ", stdout);
+    num_options = 0;
+    options     = NULL;
+    if (cupsResolveConflicts(ppd, NULL, NULL, &num_options, &options) &&
         num_options == 1 && !strcasecmp(options->name, "Quality") &&
        !strcasecmp(options->value, "Normal"))
       puts("PASS");
@@ -480,8 +507,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
     ppdMarkOption(ppd, "Quality", "Photo");
     num_options = 0;
     options     = NULL;
-    if (!cupsResolveConflicts(ppd, "Quality", "Photo", &num_options,
-                             &options))
+    if (!cupsResolveConflicts(ppd, NULL, NULL, &num_options, &options))
       puts("PASS");
     else if (num_options > 0)
     {
index b6eb2ab816760fbb4848228eb24ec4cf62a85b25..ec943f04114f17aa4403de3459c4fbbd8839c156 100644 (file)
@@ -1955,7 +1955,7 @@ typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
 <h3 class="typedef"><span class="info">&nbsp;CUPS 1.4&nbsp;</span><a name="cups_device_cb_t">cups_device_cb_t</a></h3>
 <p class="description">Device callback </p>
 <p class="code">
-typedef void (*cups_device_cb_t)(const char *device_class, const char *device_id, const char *device_info, const char *device_make_and_model, const char *device_uri, void *user_data);
+typedef void (*cups_device_cb_t)(const char *device_class, const char *device_id, const char *device_info, const char *device_make_and_model, const char *device_uri, const char *device_location, void *user_data);
 </p>
 <h3 class="typedef"><a name="cups_job_t">cups_job_t</a></h3>
 <p class="description">Job</p>
index affeeb4e32c78763102af5ce37742a5bdc4f98c9..582871ec623108f5b75e7f445eeaa38e41950721 100644 (file)
@@ -310,6 +310,7 @@ div.contents ul.subcontents li {
 <li><a href="#cupsBackChannelRead" title="Read data from the backchannel.">cupsBackChannelRead</a></li>
 <li><a href="#cupsBackChannelWrite" title="Write data to the backchannel.">cupsBackChannelWrite</a></li>
 <li><a href="#cupsBackendDeviceURI" title="Get the device URI for a backend.">cupsBackendDeviceURI</a></li>
+<li><a href="#cupsBackendReport" title="Write a device line from a backend.">cupsBackendReport</a></li>
 <li><a href="#cupsSideChannelDoRequest" title="Send a side-channel command to a backend and wait for a response.">cupsSideChannelDoRequest</a></li>
 <li><a href="#cupsSideChannelRead" title="Read a side-channel message.">cupsSideChannelRead</a></li>
 <li><a href="#cupsSideChannelSNMPGet" title="Query a SNMP OID's value.">cupsSideChannelSNMPGet</a></li>
@@ -956,6 +957,36 @@ const char *cupsBackendDeviceURI (<br>
 function returns the device URI passed in the DEVICE_URI environment
 variable or the device URI passed in argv[0], whichever is found
 first.</p>
+<h3 class="function"><a name="cupsBackendReport">cupsBackendReport</a></h3>
+<p class="description">Write a device line from a backend.</p>
+<p class="code">
+void cupsBackendReport (<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *device_scheme,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *device_uri,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *device_make_and_model,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *device_info,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *device_id,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *device_location<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>device_scheme</dt>
+<dd class="description">device-scheme string</dd>
+<dt>device_uri</dt>
+<dd class="description">device-uri string</dd>
+<dt>device_make_and_model</dt>
+<dd class="description">device-make-and-model string or <code>NULL</code></dd>
+<dt>device_info</dt>
+<dd class="description">device-info string or <code>NULL</code></dd>
+<dt>device_id</dt>
+<dd class="description">device-id string or <code>NULL</code></dd>
+<dt>device_location</dt>
+<dd class="description">device-location string or <code>NULL</code></dd>
+</dl>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">This function writes a single device line to stdout for a backend.
+It handles quoting of special characters in the device-make-and-model,
+device-info, device-id, and device-location strings.</p>
 <h3 class="function"><span class="info">&nbsp;CUPS 1.3&nbsp;</span><a name="cupsSideChannelDoRequest">cupsSideChannelDoRequest</a></h3>
 <p class="description">Send a side-channel command to a backend and wait for a response.</p>
 <p class="code">
index ab5fcc7e3f259968f163cc79d1736d4bcb26d498..74aaaf9ddcea880cf716c6b3818f0d9813840346 100644 (file)
@@ -423,6 +423,8 @@ in seconds.">ippDateToTime</a></li>
 <li><a href="#ippReadFile" title="Read data for an IPP message from a file.">ippReadFile</a></li>
 <li><a href="#ippReadIO" title="Read data for an IPP message.">ippReadIO</a></li>
 <li><a href="#ippSetPort" title="Set the default port number.">ippSetPort</a></li>
+<li><a href="#ippTagString" title="Return the tag name corresponding to a tag value.">ippTagString</a></li>
+<li><a href="#ippTagValue" title="Return the tag value corresponding to a tag name.">ippTagValue</a></li>
 <li><a href="#ippTimeToDate" title="Convert from UNIX time to RFC 1903 format.">ippTimeToDate</a></li>
 <li><a href="#ippWrite" title="Write data for an IPP message to a HTTP connection.">ippWrite</a></li>
 <li><a href="#ippWriteFile" title="Write data for an IPP message to a file.">ippWriteFile</a></li>
@@ -1447,7 +1449,7 @@ void httpClose (<br>
 <dt>http</dt>
 <dd class="description">Connection to server</dd>
 </dl>
-<h3 class="function"><a name="httpConnect">httpConnect</a></h3>
+<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpConnect">httpConnect</a></h3>
 <p class="description">Connect to a HTTP server.</p>
 <p class="code">
 <a href="#http_t">http_t</a> *httpConnect (<br>
@@ -1463,6 +1465,10 @@ void httpClose (<br>
 </dl>
 <h4 class="returnvalue">Return Value</h4>
 <p class="description">New HTTP connection</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">This function is deprecated - use <a href="#httpConnectEncrypt"><code>httpConnectEncrypt</code></a> instead.
+
+</p>
 <h3 class="function"><a name="httpConnectEncrypt">httpConnectEncrypt</a></h3>
 <p class="description">Connect to a HTTP server using encryption.</p>
 <p class="code">
@@ -2332,7 +2338,10 @@ const char *httpStatus (<br>
 <dd class="description">HTTP status code</dd>
 </dl>
 <h4 class="returnvalue">Return Value</h4>
-<p class="description">String or NULL</p>
+<p class="description">Localized status string</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The returned string is localized to the current POSIX locale and is based
+on the status strings defined in RFC 2616.</p>
 <h3 class="function"><a name="httpTrace">httpTrace</a></h3>
 <p class="description">Send an TRACE request to the server.</p>
 <p class="code">
@@ -3040,6 +3049,40 @@ void ippSetPort (<br>
 <dt>p</dt>
 <dd class="description">Port number to use</dd>
 </dl>
+<h3 class="function"><span class="info">&nbsp;CUPS 1.4&nbsp;</span><a name="ippTagString">ippTagString</a></h3>
+<p class="description">Return the tag name corresponding to a tag value.</p>
+<p class="code">
+const char *ippTagString (<br>
+&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> tag<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>tag</dt>
+<dd class="description">Tag value</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Tag name</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The returned names are defined in RFC 2911 and 3382.
+
+</p>
+<h3 class="function"><span class="info">&nbsp;CUPS 1.4&nbsp;</span><a name="ippTagValue">ippTagValue</a></h3>
+<p class="description">Return the tag value corresponding to a tag name.</p>
+<p class="code">
+<a href="#ipp_tag_t">ipp_tag_t</a> ippTagValue (<br>
+&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
+);</p>
+<h4 class="parameters">Parameters</h4>
+<dl>
+<dt>name</dt>
+<dd class="description">Tag name</dd>
+</dl>
+<h4 class="returnvalue">Return Value</h4>
+<p class="description">Tag value</p>
+<h4 class="discussion">Discussion</h4>
+<p class="discussion">The tag names are defined in RFC 2911 and 3382.
+
+</p>
 <h3 class="function"><a name="ippTimeToDate">ippTimeToDate</a></h3>
 <p class="description">Convert from UNIX time to RFC 1903 format.</p>
 <p class="code">
index 2bb61a07d22a721ba9a70ec605352657aa43a283..20e51fc4e04e0c197081371138f98197a77a0b70 100644 (file)
@@ -664,28 +664,35 @@ int cupsResolveConflicts (<br>
 <p class="description">1 on success, 0 on failure</p>
 <h4 class="discussion">Discussion</h4>
 <p class="discussion">This function attempts to resolve any conflicts in a marked PPD, returning
-a list of option changes that are required to resolve any conflicts.  On
-input, &quot;num_options&quot; and &quot;options&quot; contain any pending option changes that
-have not yet been marked, while &quot;option&quot; and &quot;choice&quot; contain the most recent
+a list of option changes that are required to resolve them.  On input,
+&quot;num_options&quot; and &quot;options&quot; contain any pending option changes that have
+not yet been marked, while &quot;option&quot; and &quot;choice&quot; contain the most recent
 selection which may or may not be in &quot;num_options&quot; or &quot;options&quot;.<br>
 <br>
 On successful return, &quot;num_options&quot; and &quot;options&quot; are updated to contain
 &quot;option&quot; and &quot;choice&quot; along with any changes required to resolve conflicts
-specified in the PPD file.  If option conflicts cannot be resolved,
-&quot;num_options&quot; and &quot;options&quot; are not changed.
-
-<code>ppdResolveConflicts</code> uses one of two sources of option constraint
-information.  The preferred constraint information is defined by
+specified in the PPD file and 1 is returned.<br>
+<br>
+If option conflicts cannot be resolved, &quot;num_options&quot; and &quot;options&quot; are not
+changed and 0 is returned.<br>
+<br>
+When resolving conflicts, <code>cupsResolveConflicts</code> does not consider
+changes to the current page size (<code>media</code>, <code>PageSize</code>, and
+<code>PageRegion</code>) or to the most recent option specified in &quot;option&quot;.
+Thus, if the only way to resolve a conflict is to change the page size
+or the option the user most recently changed, <code>cupsResolveConflicts</code>
+will return 0 to indicate it was unable to resolve the conflicts.<br>
+<br>
+The <code>cupsResolveConflicts</code> function uses one of two sources of option
+constraint information.  The preferred constraint information is defined by
 <code>cupsUIConstraints</code> and <code>cupsUIResolver</code> attributes - in this
-case, the PPD file provides constraint resolution actions.  In this case,
-it should not be possible for @ppdResolveConflicts@ to fail, however it
-will do so if a resolver loop is detected.<br>
+case, the PPD file provides constraint resolution actions.<br>
 <br>
-The backup constraint infomration is defined by the
+The backup constraint information is defined by the
 <code>UIConstraints</code> and <code>NonUIConstraints</code> attributes.  These
-constraints are resolved algorithmically by selecting the default choice
-for the conflicting option.  Unfortunately, this method is far more likely
-to fail.
+constraints are resolved algorithmically by first selecting the default
+choice for the conflicting option, then iterating over all possible choices
+until a non-conflicting option choice is found.
 
 </p>
 <h3 class="function"><a name="ppdClose">ppdClose</a></h3>
index 72579b22cd5b061e2e703d8510175b34c903dce2..1aaade812818ba236c28a0f29bcc9a5f6df11983 100644 (file)
@@ -258,7 +258,7 @@ cupsRasterInterpretPPD(
   {
     float sc = atof(val);
 
-    if (sc >= 0.5 && sc <= 2.0)
+    if (sc >= 0.1 && sc <= 2.0)
       h->cupsBorderlessScalingFactor = sc;
   }
 
@@ -328,7 +328,7 @@ cupsRasterInterpretPPD(
       (h->cupsBitsPerColor != 1 && h->cupsBitsPerColor != 2 &&
        h->cupsBitsPerColor != 4 && h->cupsBitsPerColor != 8 &&
        h->cupsBitsPerColor != 16) ||
-      h->cupsBorderlessScalingFactor < 0.5 ||
+      h->cupsBorderlessScalingFactor < 0.1 ||
       h->cupsBorderlessScalingFactor > 2.0)
   {
     _cupsRasterAddError("Page header uses unsupported values.\n");
index f60c284fa87d9957423544e2f8420a8d01cfb442..d387ecf7c68bc9c428bcfacb3fd0acc028447cf3 100644 (file)
@@ -1053,7 +1053,7 @@ read_cupsd_conf(const char *filename)     /* I - File to read */
   }
 
   snprintf(line, sizeof(line),
-           "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR ":/bin/usr/bin",
+           "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR ":/bin:/usr/bin",
           ServerBin);
   set_string(&Path, line);
 
index 571b3a7fcb64822a03af0801867dcbf07fe79ff8..417d98ef50e13764f1fa451c4abd086a4a556c67 100644 (file)
@@ -1390,9 +1390,9 @@ cupsdSetStringf(char       **s,           /* O - New string */
 static void
 launchd_checkin(void)
 {
-  int                  i,              /* Looping var */
-                       count,          /* Numebr of listeners */
-                       portnum;        /* Port number */
+  size_t               i,              /* Looping var */
+                       count;          /* Numebr of listeners */
+  int                  portnum;        /* Port number */
   launch_data_t                ld_msg,         /* Launch data message */
                        ld_resp,        /* Launch data response */
                        ld_array,       /* Launch data array */
index a68297d330c92adf45f4f428e4cc577e7e0c3752..f93330b55908fee983acad0500fc84070203e4ab 100644 (file)
@@ -245,24 +245,29 @@ cupsdNetIFUpdate(void)
       else if (addr->ifa_addr->sa_family == AF_INET &&
                lis->address.addr.sa_family == AF_INET &&
                (lis->address.ipv4.sin_addr.s_addr &
-                  temp->mask.ipv4.sin_addr.s_addr) ==
-                      temp->address.ipv4.sin_addr.s_addr)
+               temp->mask.ipv4.sin_addr.s_addr) ==
+                  (temp->address.ipv4.sin_addr.s_addr &
+                   temp->mask.ipv4.sin_addr.s_addr))
         match = 1;
 #ifdef AF_INET6
       else if (addr->ifa_addr->sa_family == AF_INET6 &&
                lis->address.addr.sa_family == AF_INET6 &&
                (lis->address.ipv6.sin6_addr.s6_addr[0] &
-                  temp->mask.ipv6.sin6_addr.s6_addr[0]) ==
-                      temp->address.ipv6.sin6_addr.s6_addr[0] &&
+               temp->mask.ipv6.sin6_addr.s6_addr[0]) ==
+                  (temp->address.ipv6.sin6_addr.s6_addr[0] &
+                   temp->mask.ipv6.sin6_addr.s6_addr[0]) &&
                (lis->address.ipv6.sin6_addr.s6_addr[1] &
-                  temp->mask.ipv6.sin6_addr.s6_addr[1]) ==
-                      temp->address.ipv6.sin6_addr.s6_addr[1] &&
+               temp->mask.ipv6.sin6_addr.s6_addr[1]) ==
+                  (temp->address.ipv6.sin6_addr.s6_addr[1] &
+                   temp->mask.ipv6.sin6_addr.s6_addr[1]) &&
                (lis->address.ipv6.sin6_addr.s6_addr[2] &
-                  temp->mask.ipv6.sin6_addr.s6_addr[2]) ==
-                      temp->address.ipv6.sin6_addr.s6_addr[2] &&
+               temp->mask.ipv6.sin6_addr.s6_addr[2]) ==
+                  (temp->address.ipv6.sin6_addr.s6_addr[2] &
+                   temp->mask.ipv6.sin6_addr.s6_addr[2]) &&
                (lis->address.ipv6.sin6_addr.s6_addr[3] &
-                  temp->mask.ipv6.sin6_addr.s6_addr[3]) ==
-                      temp->address.ipv6.sin6_addr.s6_addr[3])
+               temp->mask.ipv6.sin6_addr.s6_addr[3]) ==
+                  (temp->address.ipv6.sin6_addr.s6_addr[3] &
+                   temp->mask.ipv6.sin6_addr.s6_addr[3]))
         match = 1;
 #endif /* AF_INET6 */
 
@@ -284,8 +289,8 @@ cupsdNetIFUpdate(void)
 
     cupsArrayAdd(NetIFList, temp);
 
-    cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: \"%s\" = %s...",
-                    temp->name, temp->hostname);
+    cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdNetIFUpdate: \"%s\" = %s:%d",
+                    temp->name, temp->hostname, temp->port);
   }
 
   freeifaddrs(addrs);