Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STR 1795 broke remote IPP printing #1881

Closed
michaelrsweet opened this issue Aug 3, 2006 · 17 comments
Closed

STR 1795 broke remote IPP printing #1881

michaelrsweet opened this issue Aug 3, 2006 · 17 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.2.2
CUPS.org User: twaugh.redhat

Original bug report:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=201167

Manually creating an ipp://... queue for a remote CUPS printer no longer works. More detail:

Set up machine 'A' as CUPS server, with (say) HP printer attached. Create queue 'printer' and mark it shared. Uncomment application/octet stream lines in /etc/cups/mime.types and /etc/cups/mime.convs.

On machine 'B', also running CUPS, manually add a queue with an ipp://... URI to point to machine 'A's 'printer' queue. Print a test page to this queue.

Result: printer prints garbage

Attached is a patch that fixes this behaviour -- however, since it is just the patch from STR #1795 reversed, it will likely break that again.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Try the attached patch and let me know if you still have problems...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

Reporter should be able to test this on Friday.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

There is apparently no change in behaviour with that patch applied.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

It turns out that remote_job gets set to 0 here:

2609 remote_job = printer->raw && job->num_files > 1 &&
2610 !strncmp(printer->device_uri, "ipp://", 6);

At this point, printer->raw==0, job->num_files==1 -- the only condition that's true is the ipp:// prefix.

I think the real problem is that STR #1795 was fixed wrongly. The FINAL_CONTENT_TYPE should be using the dst (not the src) of the last filter in the chain, as before, but if that ends up being "printer/*" then it should be replaced by "application/octet-stream" IMHO.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Log files please (both client and server) with LogLevel set to "debug" on each...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

Attached. I'm also about to test a patch to replace printer/* with application/octet-stream in the appropriate place.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

cups-final-content-type.patch fixes the problem for me.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

No, that patch isn't correct either...

I'm attaching a wider-reaching patch against both the IPP backend and scheduler which tracks whether a queue points to a remote printer/class and handles things accordingly. The mapping of printer/* to application/vnd.cups-raw is handled in the IPP backend, and it only falls back on application/octet-stream if the remote end doesn't handle application/vnd.cups-raw...

Let me know how this works for you...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

It doesn't work. The problem is back now.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

In particular, for the configuration at issue (manually set-up IPP queue with PPD selected locally) the FINAL_CONTENT_TYPE given to the ipp backend is 'application/vnd.cups-postscript' (see job output from log, below). As you can see, ghostscript is run locally so there is no denying that this is now raw data -- but the ipp backend is told 'postscript'.

I [22/Aug/2006:18:06:28 +0100] Job 25 queued on "raw" by "root".
D [22/Aug/2006:18:06:28 +0100] Job 25 hold_until = 0
d [22/Aug/2006:18:06:28 +0100] cupsdCheckJobs: Job 25: state_value=3, loaded=yesD [22/Aug/2006:18:06:28 +0100] [Job 25] argv[0]="raw"
D [22/Aug/2006:18:06:28 +0100] [Job 25] argv[1]="25"
D [22/Aug/2006:18:06:28 +0100] [Job 25] argv[2]="root"
D [22/Aug/2006:18:06:28 +0100] [Job 25] argv[3]="Test Page"
D [22/Aug/2006:18:06:28 +0100] [Job 25] argv[4]="1"
D [22/Aug/2006:18:06:28 +0100] [Job 25] argv[5]="job-uuid=urn:uuid:0972f0e5-3f0c-3244-4cdd-6aac78c3e129"
D [22/Aug/2006:18:06:28 +0100] [Job 25] argv[6]="/var/spool/cups/d00025-001"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[2]="CUPS_DOCROOT=/usr/share/doc/cups-1.2.2"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[7]="CUPS_STATEDIR=/var/run/cups"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[8]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[9]="SERVER_ADMIN=root@hoopoe.elk"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[10]="SOFTWARE=CUPS/1.2.2"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[11]="TMPDIR=/var/spool/cups/tmp"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[12]="USER=root"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[13]="CUPS_SERVER=/var/run/cups/cups.sock"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[14]="CUPS_ENCRYPTION=IfRequested"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[15]="IPP_PORT=631"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[16]="CHARSET=utf-8"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[17]="LANG=en_US"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[18]="PPD=/etc/cups/ppd/raw.ppd"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[19]="RIP_MAX_CACHE=8m"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[20]="CONTENT_TYPE=application/postscript"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[21]="DEVICE_URI=ipp://cyberelk/printers/stylus"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[22]="PRINTER=raw"
D [22/Aug/2006:18:06:28 +0100] [Job 25] envp[23]="FINAL_CONTENT_TYPE=application/vnd.cups-postscript"
D [22/Aug/2006:18:06:28 +0100] [Job 25] Page = 595x842; 9,9 to 586,842
D [22/Aug/2006:18:06:28 +0100] [Job 25] slow_collate=0, slow_duplex=0, slow_order=0
D [22/Aug/2006:18:06:28 +0100] [Job 25] Before copy_comments - %!PS-Adobe-3.0
D [22/Aug/2006:18:06:28 +0100] [Job 25] %!PS-Adobe-3.0
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%BoundingBox: 0 0 612 792
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%Pages: 1
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%LanguageLevel: 1
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%DocumentData: Clean7Bit
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%DocumentSuppliedResources: procset testprint/1.2
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%Creator: Michael Sweet, Easy Software Products
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%CreationDate: D:20060114093000+0500
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%Title: Test Page
D [22/Aug/2006:18:06:28 +0100] [Job 25] %%EndComments
D [22/Aug/2006:18:06:28 +0100] [Job 25] Before copy_prolog - %%BeginProlog
D [22/Aug/2006:18:06:28 +0100] [Job 25] Before copy_setup - %%Page: 1 1
D [22/Aug/2006:18:06:28 +0100] [Job 25] Before page loop - %%Page: 1 1
D [22/Aug/2006:18:06:28 +0100] [Job 25] Copying page 1...
D [22/Aug/2006:18:06:28 +0100] [Job 25] pagew = 577.0, pagel = 833.0
D [22/Aug/2006:18:06:28 +0100] [Job 25] bboxw = 595, bboxl = 842
D [22/Aug/2006:18:06:28 +0100] [Job 25] PageLeft = 9.0, PageRight = 586.0
D [22/Aug/2006:18:06:28 +0100] [Job 25] PageTop = 842.0, PageBottom = 9.0
D [22/Aug/2006:18:06:28 +0100] [Job 25] PageWidth = 595.0, PageLength = 842.0
D [22/Aug/2006:18:06:28 +0100] [Job 25] Wrote 1 pages...
D [22/Aug/2006:18:06:29 +0100] [Job 25] foomatic-rip version $Revision: 3.43.2.15 $ running...
D [22/Aug/2006:18:06:29 +0100] [Job 25] Parsing PPD file ...
D [22/Aug/2006:18:06:29 +0100] [Job 25] *cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option ColorSpace
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option PageSize
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option PageRegion
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option Model
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option PrintoutMode
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option ImageableArea
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option PaperDimension
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option MediaType
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option InkType
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option stpGamma
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option Density
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option stpBrightness
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option stpSaturation
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option Contrast
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option Cyan
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option Magenta
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option Yellow
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option GSResolution
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option Quality
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option OutputType
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option ImageType
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option Dither
D [22/Aug/2006:18:06:29 +0100] [Job 25] Added option Font
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] Parameter Summary
D [22/Aug/2006:18:06:29 +0100] [Job 25] -----------------
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] Spooler: cups
D [22/Aug/2006:18:06:29 +0100] [Job 25] Printer: raw
D [22/Aug/2006:18:06:29 +0100] [Job 25] PPD file: /etc/cups/ppd/raw.ppd
D [22/Aug/2006:18:06:29 +0100] [Job 25] Printer model: Epson Stylus Color 760 Foomatic/gimp-print-ijs (recommended)
D [22/Aug/2006:18:06:29 +0100] [Job 25] Job title: Test Page
D [22/Aug/2006:18:06:29 +0100] [Job 25] File(s) to be printed:
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] GhostScript extra search path ('GS_LIB'): /usr/share/cups/fonts
D [22/Aug/2006:18:06:29 +0100] [Job 25] Pondering option 'job-uuid=urn:uuid:0972f0e5-3f0c-3244-4cdd-6aac78c3e129'
D [22/Aug/2006:18:06:29 +0100] [Job 25] Unknown option job-uuid=urn:uuid:0972f0e5-3f0c-3244-4cdd-6aac78c3e129.
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] ================================================
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] File:
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] ================================================
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] Reading PostScript input ...
D [22/Aug/2006:18:06:29 +0100] [Job 25] --> This document is DSC-conforming!
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] -----------
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginProlog
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%EndProlog
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] -----------
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginSetup
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *PrintoutMode Normal
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: PrintoutMode=Normal --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: PrintoutMode=Normal
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: PrintoutMode=Normal --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *Quality FromPrintoutMode
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Quality=FromPrintoutMode --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: Quality=@PrintoutMode
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Quality=FromPrintoutMode --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *PageSize A4
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: PageSize=A4 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: PageSize=A4
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: PageSize=A4 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *InkType CMYK
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: InkType=CMYK --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: InkType=CMYK
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: InkType=CMYK --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *MediaType Plain
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: MediaType=Plain --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: MediaType=Plain
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: MediaType=Plain --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *GSResolution FromPrintoutMode
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: GSResolution=FromPrintoutMode --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: GSResolution=@PrintoutMode
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: GSResolution=FromPrintoutMode --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *OutputType BlackAndWhite
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: OutputType=BlackAndWhite --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: OutputType=BlackAndWhite
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: OutputType=BlackAndWhite --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *Dither FromPrintoutMode
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Dither=FromPrintoutMode --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: Dither=@PrintoutMode
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Dither=FromPrintoutMode --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *ImageType FromPrintoutMode
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: ImageType=FromPrintoutMode --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: ImageType=@PrintoutMode
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: ImageType=FromPrintoutMode --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *Density 2.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Density=2.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: Density=2.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Density=2.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *stpBrightness 2.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: stpBrightness=2.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: stpBrightness=2.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: stpBrightness=2.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *stpGamma 4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: stpGamma=4.00 --> Setting optionD [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: stpGamma=4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: stpGamma=4.00 --> Setting optionD [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *Contrast 4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Contrast=4.00 --> Setting optionD [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: Contrast=4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Contrast=4.00 --> Setting optionD [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *stpSaturation 9.0
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: stpSaturation=9.0 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: stpSaturation=9.0
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: stpSaturation=9.0 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *Cyan 4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Cyan=4.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: Cyan=4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Cyan=4.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *Magenta 4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Magenta=4.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: Magenta=4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Magenta=4.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginFeature: *Yellow 4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Yellow=4.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %% FoomaticRIPOptionSetting: Yellow=4.00
D [22/Aug/2006:18:06:29 +0100] [Job 25] Option: Yellow=4.00 --> Setting option
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%EndSetup
D [22/Aug/2006:18:06:29 +0100] [Job 25] Inserting PostScript code for CUPS' page accounting
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] -----------
D [22/Aug/2006:18:06:29 +0100] [Job 25] New page: 1 1
D [22/Aug/2006:18:06:29 +0100] [Job 25] Inserting option code into "PageSetup" section.
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%BeginPageSetup
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found: %%EndPageSetup
D [22/Aug/2006:18:06:29 +0100] [Job 25] End of page header
D [22/Aug/2006:18:06:29 +0100] [Job 25] Stopping search for page header options
D [22/Aug/2006:18:06:29 +0100] [Job 25] Found:
D [22/Aug/2006:18:06:29 +0100] [Job 25] wheelSize -0.4 mul 0 rlineto % Left side...
D [22/Aug/2006:18:06:29 +0100] [Job 25] --> Output goes directly to the renderer now.
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] Starting renderer
D [22/Aug/2006:18:06:29 +0100] [Job 25] JCL:
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] renderer PID kid4=6687
D [22/Aug/2006:18:06:29 +0100] [Job 25] renderer command: gs -q -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=ijs -sIjsServer=ijsgimpprint -dIjsUseOutputFD -sDeviceManufacturer=EPSON -sDeviceModel=escp2-760 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -r360x360 -sProcessColorModel=DeviceGray -dBitsPerSample=1 -sIjsParams="Quality=360swuni,InkType=CMYK,MediaType=Plain,Dither=Adaptive,ImageType=2,Density=2.000000,Brightness=2.000000,Gamma=4.000000,Contrast=4.000000,Saturation=9.000000,Cyan=4.000000,Magenta=4.000000,Yellow=4.000000" -sOutputFile=- -
D [22/Aug/2006:18:06:29 +0100] [Job 25]
D [22/Aug/2006:18:06:29 +0100] [Job 25] Closing renderer
D [22/Aug/2006:18:06:29 +0100] [Job 25] foomatic-gswrapper: gs '-dPARANOIDSAFER' '-dNOPAUSE' '-dBATCH' '-sDEVICE=ijs' '-sIjsServer=ijsgimpprint' '-dIjsUseOutputFD' '-sDeviceManufacturer=EPSON' '-sDeviceModel=escp2-760' '-dDEVICEWIDTHPOINTS=595' '-dDEVICEHEIGHTPOINTS=842' '-r360x360' '-sProcessColorModel=DeviceGray' '-dBitsPerSample=1' '-sIjsParams=Quality=360swuni,InkType=CMYK,MediaType=Plain,Dither=Adaptive,ImageType=2,Density=2.000000,Brightness=2.000000,Gamma=4.000000,Contrast=4.000000,Saturation=9.000000,Cyan=4.000000,Magenta=4.000000,Yellow=4.000000' '-sOutputFile=/dev/fd/3' '/dev/fd/0' 3>&1 1>&2
D [22/Aug/2006:18:06:29 +0100] [Job 25] ESP Ghostscript 815.02 (2006-04-19)
D [22/Aug/2006:18:06:29 +0100] [Job 25] Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved.
D [22/Aug/2006:18:06:29 +0100] [Job 25] This software comes with NO WARRANTY: see the file PUBLIC for details.
D [22/Aug/2006:18:06:29 +0100] [Job 25] Loading NimbusSanL-Bold font from /usr/share/fonts/default/Type1/n019004l.pfb... 2643800 1052757 1597156 296465 1 done.
D [22/Aug/2006:18:06:29 +0100] [Job 25] Using NimbusSansL-Bold font for NimbusSanL-Bold.
D [22/Aug/2006:18:06:29 +0100] [Job 25] Loading NimbusSanL-Regu font from /usr/share/fonts/default/Type1/n019003l.pfb... 2660464 1160444 1597156 297472 1 done.
D [22/Aug/2006:18:06:29 +0100] [Job 25] Using NimbusSansL-Regu font for NimbusSanL-Regu.
D [22/Aug/2006:18:06:29 +0100] [Job 25] Loading NimbusRomNo9L-Regu font from /usr/share/fonts/default/Type1/n021003l.pfb... 2677128 1310507 1597156 298195 1 done.
D [22/Aug/2006:18:06:29 +0100] [Job 25] Using NimbusRomanNo9L-Regu font for NimbusRomNo9L-Regu.
D [22/Aug/2006:18:06:30 +0100] [Job 25] Loading NimbusSanL-ReguCondItal font from /usr/share/fonts/default/Type1/n019063l.pfb... 2733984 1417305 1617252 313423 1 done.
d [22/Aug/2006:18:06:30 +0100] [Job 25] PAGE: 1 1
D [22/Aug/2006:18:06:30 +0100] [Job 25] tail process done writing data to STDOUTD [22/Aug/2006:18:06:30 +0100] [Job 25] KID4 finished
D [22/Aug/2006:18:06:30 +0100] [Job 25] KID3 exited with status 0
D [22/Aug/2006:18:06:30 +0100] [Job 25] KID4 exited with status 0
D [22/Aug/2006:18:06:30 +0100] [Job 25] Renderer exit stat: 0
D [22/Aug/2006:18:06:30 +0100] [Job 25] KID3 finished
D [22/Aug/2006:18:06:30 +0100] [Job 25] Renderer process finished
D [22/Aug/2006:18:06:30 +0100] [Job 25]
D [22/Aug/2006:18:06:30 +0100] [Job 25] Closing foomatic-rip.
D [22/Aug/2006:18:06:30 +0100] [Job 25] 1 files to send in job...
d [22/Aug/2006:18:06:30 +0100] [Job 25] STATE: +connecting-to-device
I [22/Aug/2006:18:06:30 +0100] [Job 25] Connecting to cyberelk on port 631...
d [22/Aug/2006:18:06:30 +0100] [Job 25] STATE: -connecting-to-device
I [22/Aug/2006:18:06:30 +0100] [Job 25] Connected to cyberelk...
D [22/Aug/2006:18:06:30 +0100] [Job 25] Getting supported attributes...
D [22/Aug/2006:18:06:30 +0100] [Job 25] document-format-supported (26 values)
d [22/Aug/2006:18:06:30 +0100] [Job 25] STATE: none
D [22/Aug/2006:18:06:30 +0100] [Job 25] printer-uri = "ipp://cyberelk:631/printers/stylus"
D [22/Aug/2006:18:06:30 +0100] [Job 25] requesting-user-name = "root"
D [22/Aug/2006:18:06:30 +0100] [Job 25] job-name = "Test Page"
N [22/Aug/2006:18:06:30 +0100] [Job 25] Print file accepted - job ID 566.
I [22/Aug/2006:18:06:30 +0100] [Job 25] Waiting for job to complete...
d [22/Aug/2006:18:06:30 +0100] [Job 25] STATE: none
d [22/Aug/2006:18:06:31 +0100] cupsdCheckJobs: Job 25: state_value=5, loaded=yesd [22/Aug/2006:18:06:40 +0100] [Job 25] PAGE: total 0
d [22/Aug/2006:18:06:41 +0100] [Job 25] STATE: none
d [22/Aug/2006:18:06:41 +0100] cupsdCheckJobs: Job 25: state_value=5, loaded=yesD [22/Aug/2006:18:06:41 +0100] [Job 25] File 0 is complete.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

OK, third time's the charm; basically, this latest patch reverts the FINAL_CONTENT_TYPE change we made before (it is now set the the MIME type that the last filter produces, which can be printer/foo...), but now the IPP backend checks for printer/foo and reassigns it to application/vnd.cups-raw.

If the server doesn't report support for application/vnd.cups-raw, then the IPP backend will fall back on application/octet-stream which is the right type to use with printers.

I've tested this with both raw (hardwired client queue) and PCL (laserjet.ppd) drivers pointing to a PostScript LaserJet queue on another system and it seems to work properly with both configurations now.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: twaugh.redhat

Yes, works fine here too. Thanks!

@michaelrsweet
Copy link
Collaborator Author

"cups-test.patch":

--- cups-1.2.2/scheduler/job.c.test 2006-08-03 15:17:05.000000000 +0100
+++ cups-1.2.2/scheduler/job.c 2006-08-03 15:17:34.000000000 +0100
@@ -3022,7 +3022,7 @@
{
snprintf(final_content_type, sizeof(final_content_type),
"FINAL_CONTENT_TYPE=%s/%s",

  •    filter->src->super, filter->src->type);
    
  •    filter->dst->super, filter->dst->type);
    
    envp[envc ++] = final_content_type;
    }

@michaelrsweet
Copy link
Collaborator Author

"str1881.patch":

Index: job.c

--- job.c (revision 5801)
+++ job.c (working copy)
@@ -3007,7 +3007,8 @@
envp[envc ++] = device_uri;
envp[envc ++] = printer_name;

  • if ((filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL)
  • if (!remote_job &&
  •  (filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL)
    
    {
    snprintf(final_content_type, sizeof(final_content_type),
    "FINAL_CONTENT_TYPE=%s/%s",

@michaelrsweet
Copy link
Collaborator Author

"cups-final-content-type.patch":

--- cups-1.2.2/scheduler/job.c 2006-08-06 11:56:29.000000000 +0100
+++ cups-1.2.2/scheduler/job.c 2006-08-10 17:34:27.000000000 +0100
@@ -3018,11 +3018,17 @@
envp[envc ++] = device_uri;
envp[envc ++] = printer_name;

  • if ((filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL)
  • if (!remote_job &&
  •  (filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL)
    
    {
  • snprintf(final_content_type, sizeof(final_content_type),
  •         "FINAL_CONTENT_TYPE=%s/%s",
    
  •    filter->src->super, filter->src->type);
    
  • if (!strcmp (filter->dst->super, "printer"))
  •  snprintf(final_content_type, sizeof(final_content_type),
    
  •      "FINAL_CONTENT_TYPE=application/octet-stream");
    
  • else
  •  snprintf(final_content_type, sizeof(final_content_type),
    
  •      "FINAL_CONTENT_TYPE=%s/%s",
    
  •      filter->dst->super, filter->dst->type);
    
    envp[envc ++] = final_content_type;
    }

@michaelrsweet
Copy link
Collaborator Author

"str1881v2.patch":

Index: backend/ipp.c

--- backend/ipp.c (revision 5823)
+++ backend/ipp.c (working copy)
@@ -214,6 +214,9 @@
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
content_type = "application/octet-stream";

  • if (!strncmp(content_type, "printer/", 8))
  • content_type = "application/vnd.cups-raw";

/*

  • Extract the hostname and printer name from the URI...
    */
    Index: scheduler/printers.c

    --- scheduler/printers.c (revision 5823)
    +++ scheduler/printers.c (working copy)
    @@ -1488,7 +1488,8 @@
    else
    snprintf(resource, sizeof(resource), "/printers/%s", p->name);

  • if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL)

  • if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL ||

  •    auth->type == AUTH_NONE)
    

    auth = cupsdFindPolicyOp(p->op_policy_ptr, IPP_PRINT_JOB);

    if (auth)
    @@ -1568,7 +1569,8 @@

    printer_type = p->type;

  • p->raw = 0;

  • p->raw = 0;

  • p->remote = 0;

if (p->type & CUPS_PRINTER_REMOTE)
{
@@ -1586,7 +1588,8 @@
ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL,
p->uri);

  • p->raw = 1;
  • p->raw = 1;
  • p->remote = 1;
    }
    else
    {
    @@ -2026,7 +2029,8 @@
  • Print all files directly...
    */
  • p->raw = 1;
    
  • p->raw    = 1;
    
  • p->remote = 1;
    

    }
    else
    {
    Index: scheduler/job.c

    --- scheduler/job.c (revision 5823)
    +++ scheduler/job.c (working copy)
    @@ -2414,7 +2414,6 @@
    /* PRINTER env variable /
    rip_max_cache[255];
    /
    RIP_MAX_CACHE env variable */
  • int remote_job; /* Remote print job? /
    static char *options = NULL;/
    Full list of options /
    static int optlength = 0; /
    Length of option buffer */

@@ -2556,17 +2555,10 @@
FilterLevel += job->cost;

/*

  • * Determine if we are printing to a remote printer...

- */

  • remote_job = printer->raw && job->num_files > 1 &&

- !strncmp(printer->device_uri, "ipp://", 6);

  • /*
    • Add decompression filters, if any...
      */
  • if (!remote_job && job->compressions[job->current_file])
  • if (!printer->raw && job->compressions[job->current_file])
    {
    /*
  • Add gziptoany filter to the front of the list...
    @@ -2900,7 +2892,7 @@
    • For remote jobs, we send all of the files in the argument list.
      */
  • if (remote_job)
  • if (printer->remote && job->num_files > 1)
    argv = calloc(7 + job->num_files, sizeof(char *));
    else
    argv = calloc(8, sizeof(char *));
    @@ -2914,7 +2906,7 @@
    argv[4] = copies;
    argv[5] = options;
  • if (remote_job)
  • if (printer->remote && job->num_files > 1)
    {
    for (i = 0; i < job->num_files; i ++)
    {
    @@ -3007,7 +2999,7 @@
    envp[envc ++] = device_uri;
    envp[envc ++] = printer_name;
  • if (!remote_job &&
  • if (!printer->remote &&
    (filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL)
    {
    snprintf(final_content_type, sizeof(final_content_type),
    @@ -3049,7 +3041,7 @@
    cupsdLogMessage(CUPSD_LOG_DEBUG, "[Job %d] envp[%d]="DEVICE_URI=%s"",
    job->id, i, sani_uri);
  • if (remote_job)
  • if (printer->remote)
    job->current_file = job->num_files;
    else
    job->current_file ++;
    @@ -3345,7 +3337,7 @@
    slot, filterfds[slot][0], filterfds[slot][1]);
    cupsdClosePipe(filterfds[slot]);
  • if (remote_job)
  • if (printer->remote && job->num_files > 1)
    {
    for (i = 0; i < job->num_files; i ++)
    free(argv[i + 6]);
    @@ -3389,7 +3381,7 @@

cupsArrayDelete(filters);

  • if (remote_job)
  • if (printer->remote && job->num_files > 1)
    {
    for (i = 0; i < job->num_files; i ++)
    free(argv[i + 6]);
    Index: scheduler/printers.h
    ===================================================================
    --- scheduler/printers.h (revision 5823)
    +++ scheduler/printers.h (working copy)
    @@ -66,6 +66,7 @@
    char device_uri; / Device URI /
    char *port_monitor; /
    Port monitor /
    int raw; /
    Raw queue? */
  • int remote; /* Remote queue? /
    mime_type_t *filetype; /
    Pseudo-filetype for printer /
    cups_array_t *filetypes; /
    Supported file types /
    void *job; /
    Current job in queue */

@michaelrsweet
Copy link
Collaborator Author

"str1881v3.patch":

Index: job.c

--- job.c (revision 5872)
+++ job.c (working copy)
@@ -3004,7 +3004,7 @@
{
snprintf(final_content_type, sizeof(final_content_type),
"FINAL_CONTENT_TYPE=%s/%s",

  •    filter->src->super, filter->src->type);
    
  •    filter->dst->super, filter->dst->type);
    
    envp[envc ++] = final_content_type;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant