]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/cups-lpd.c
Import CUPS 1.4svn-r7226.
[thirdparty/cups.git] / scheduler / cups-lpd.c
index 01f385f02a3d1d201f81db6c1dac826a9e776285..7e810f4ca3e93720b9e03730e23f9423296100dd 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: cups-lpd.c 6723 2007-07-25 17:29:58Z mike $"
+ * "$Id: cups-lpd.c 6781 2007-08-08 21:09:31Z mike $"
  *
  *   Line Printer Daemon interface for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 2007 by Apple Inc.
+ *   Copyright 2007-2008 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -597,46 +597,48 @@ get_printer(http_t        *http,  /* I - HTTP connection */
 
     name = dest;
   }
+  else
+  {
+   /*
+    * Get values from the response...
+    */
 
- /*
-  * Get values from the response...
-  */
+    if (accepting)
+    {
+      if ((attr = ippFindAttribute(response, "printer-is-accepting-jobs",
+                                  IPP_TAG_BOOLEAN)) == NULL)
+       syslog(LOG_ERR, "No printer-is-accepting-jobs attribute found in "
+                       "response from server!");
+      else
+       *accepting = attr->values[0].boolean;
+    }
 
-  if (accepting)
-  {
-    if ((attr = ippFindAttribute(response, "printer-is-accepting-jobs",
-                                IPP_TAG_BOOLEAN)) == NULL)
-      syslog(LOG_ERR, "No printer-is-accepting-jobs attribute found in "
-                     "response from server!");
-    else
-      *accepting = attr->values[0].boolean;
-  }
+    if (shared)
+    {
+      if ((attr = ippFindAttribute(response, "printer-is-shared",
+                                  IPP_TAG_BOOLEAN)) == NULL)
+      {
+       syslog(LOG_ERR, "No printer-is-shared attribute found in "
+                       "response from server!");
+       *shared = 1;
+      }
+      else
+       *shared = attr->values[0].boolean;
+    }
 
-  if (shared)
-  {
-    if ((attr = ippFindAttribute(response, "printer-is-shared",
-                                IPP_TAG_BOOLEAN)) == NULL)
+    if (state)
     {
-      syslog(LOG_ERR, "No printer-is-shared attribute found in "
-                     "response from server!");
-      *shared = 1;
+      if ((attr = ippFindAttribute(response, "printer-state",
+                                  IPP_TAG_ENUM)) == NULL)
+       syslog(LOG_ERR, "No printer-state attribute found in "
+                       "response from server!");
+      else
+       *state = (ipp_pstate_t)attr->values[0].integer;
     }
-    else
-      *shared = attr->values[0].boolean;
-  }
 
-  if (state)
-  {
-    if ((attr = ippFindAttribute(response, "printer-state",
-                                IPP_TAG_ENUM)) == NULL)
-      syslog(LOG_ERR, "No printer-state attribute found in "
-                     "response from server!");
-    else
-      *state = (ipp_pstate_t)attr->values[0].integer;
+    ippDelete(response);
   }
 
-  ippDelete(response);
-
  /*
   * Override shared value for LPD using system-specific APIs...
   */
@@ -1272,9 +1274,9 @@ recv_print_job(
          if (status)
            break;
        }
-
-       fclose(fp);
       }
+
+      fclose(fp);
     }
   }
 
@@ -1700,5 +1702,5 @@ smart_gets(char *s,                       /* I - Pointer to line buffer */
 
 
 /*
- * End of "$Id: cups-lpd.c 6723 2007-07-25 17:29:58Z mike $".
+ * End of "$Id: cups-lpd.c 6781 2007-08-08 21:09:31Z mike $".
  */