Don't truncate the portname if installing IPP printer
authorsherscher@apple.com <sherscher@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Wed, 30 Sep 2009 07:05:05 +0000 (07:05 +0000)
committersherscher@apple.com <sherscher@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Wed, 30 Sep 2009 07:05:05 +0000 (07:05 +0000)
git-svn-id: http://svn.macosforge.org/repository/mDNSResponder/trunk@6714 214c2c4a-bf3b-4dcf-9390-e4dd3010487d

Clients/PrinterSetupWizard/PrinterSetupWizardSheet.cpp
Clients/PrinterSetupWizard/ThirdPage.cpp

index a27785d..e216040 100644 (file)
@@ -300,8 +300,6 @@ CPrinterSetupWizardSheet::InstallPrinter(Printer * printer)
                }
                else if ( service->type == kIPPServiceType )
                {
-                       err = InstallPrinterPort( printer, service, PROTOCOL_RAWTCP_TYPE, log );
-                       require_noerr_with_log( log, "InstallPrinterPort()", err, exit );
                        err = InstallPrinterIPP( printer, service, log );
                        require_noerr_with_log( log, "InstallPrinterIPP()", err, exit );
                }
index 5a7acf8..069e559 100644 (file)
@@ -284,13 +284,16 @@ CThirdPage::CopyPrinterSettings( Printer * printer, Service * service, Manufactu
                service->protocol = L"IPP";
        }
 
-       // Truncate the portName so that it's valid
+       // If it's not an IPP printr, truncate the portName so that it's valid
 
-       portNameLen = printer->portName.GetLength() + 1;
-               
-       if ( portNameLen > MAX_PORTNAME_LEN )
+       if ( service->type != kIPPServiceType )
        {
-               printer->portName.Delete( MAX_PORTNAME_LEN - 1, ( portNameLen - MAX_PORTNAME_LEN ) );
+               portNameLen = printer->portName.GetLength() + 1;
+               
+               if ( portNameLen > MAX_PORTNAME_LEN )
+               {
+                       printer->portName.Delete( MAX_PORTNAME_LEN - 1, ( portNameLen - MAX_PORTNAME_LEN ) );
+               }
        }
 }