Blame SOURCES/cups-1.6.3-page-count.patch

db5f83
--- cups-1.6.3.rsac.old/backend/snmp-supplies.c	2013-06-06 18:12:52.000000000 -0700
db5f83
+++ cups-1.6.3.rsac.new/backend/snmp-supplies.c	2017-02-20 15:57:28.420977310 -0800
db5f83
@@ -90,6 +90,8 @@ static backend_supplies_t supplies[CUPS_
db5f83
 					/* Supply information */
db5f83
 static int		supply_state = -1;
db5f83
 					/* Supply state info */
db5f83
+static int              use_snmp_pages = 1;
db5f83
+                                        /* Report pages used or not */
db5f83
 
db5f83
 static const int	hrDeviceDescr[] =
db5f83
 			{ CUPS_OID_hrDeviceDescr, 1, -1 };
db5f83
@@ -410,16 +412,21 @@ backendSNMPSupplies(
db5f83
 
db5f83
     if (page_count)
db5f83
     {
db5f83
-      if (!_cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1,
db5f83
-			 _cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
db5f83
-			 prtMarkerLifeCount))
db5f83
-	return (-1);
db5f83
-
db5f83
-      if (!_cupsSNMPRead(snmp_fd, &packet, CUPS_SUPPLY_TIMEOUT) ||
db5f83
-	  packet.object_type != CUPS_ASN1_COUNTER)
db5f83
-	return (-1);
db5f83
-
db5f83
-      *page_count = packet.object_value.counter;
db5f83
+      if (use_snmp_pages)
db5f83
+      {
db5f83
+        if (!_cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1,
db5f83
+                            _cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
db5f83
+                            prtMarkerLifeCount))
db5f83
+          return (-1);
db5f83
+
db5f83
+        if (!_cupsSNMPRead(snmp_fd, &packet, CUPS_SUPPLY_TIMEOUT) ||
db5f83
+            packet.object_type != CUPS_ASN1_COUNTER)
db5f83
+          return (-1);
db5f83
+        
db5f83
+        *page_count = packet.object_value.counter;
db5f83
+      }
db5f83
+      else
db5f83
+        *page_count = 0;
db5f83
     }
db5f83
 
db5f83
     return (0);
db5f83
@@ -521,6 +528,12 @@ backend_init_supplies(
db5f83
       quirks |= CUPS_SNMP_CAPACITY;
db5f83
   }
db5f83
 
db5f83
+  if ((ppdattr = ppdFindAttr(ppd, "cupsSNMPPages", NULL)) != NULL )
db5f83
+  {
db5f83
+    if (_cups_strcasecmp(ppdattr->value, "true"))
db5f83
+      use_snmp_pages = 0;
db5f83
+  }
db5f83
+
db5f83
   ppdClose(ppd);
db5f83
 
db5f83
  /*