Testing the backchannel with the socket backend

John A. Murdie john at cs.york.ac.uk
Thu Aug 17 09:37:25 PDT 2006


I thought I'd see what the backchannel data coming from our PostScript printers looked like with our Solaris 8 CUPS 1.2.2 installation. So, I took a PostScript program which writes the contents of the system dictionary etc to the printer's standard output:

------------------------------------------------------------------------
%!
/nl {
        (\n) print
} bind def
/bprint {
{
        (true ) print} {(false ) print} ifelse
} bind def
/ifknown {
        3 1 roll print currentdict exch known exch {(not known) print} ifelse
} bind def
/xdictprint {
        % dict depth
        exch
        % depth dict
        {
                % depth key value
                1 1 5 -1 roll dup
                % key value 1 1 depth depth
                6 1 roll
                % depth key value 1 1 depth
                { pop (    ) print } for
                % depth key value
                exch 100 string cvs print ( ) print dup
                % depth value value
                type cvlit /dicttype eq {
                        % depth value
                        (\n) print
                        exch dup
                        % value depth depth
                        3 1 roll 1 add
                        % depth subdict depth+1
                        xdictprint
                } {
                        % depth value
                        ==
                } ifelse
                % depth
        } forall
        pop
} def
/dictprint { 1 xdictprint } def

%statusdict - Level 1 compatibility.
statusdict begin
/product (product ) {product 40 string cvs print} ifknown nl
/revision (revision ) {revision 40 string cvs print} ifknown nl
systemdict begin /serialnumber (serialnumber ) {serialnumber 40 string cvs print} ifknown nl
(resolution ) print 72 72 dtransform pop 40 string cvs print nl
/version (PostScript version ) {version print} ifknown nl end
/pagecount (pagecount ) {pagecount 40 string cvs print} ifknown nl
/checkpassword (password )
        {0 checkpassword
                {(default ) print} {(undetermined ) print} ifelse} ifknown nl
/doautocontinue (doautocontinue ) {doautocontinue 10 string cvs print} ifknown nl
/jobtimeout (jobtimeout ) {jobtimeout 40 string cvs print} ifknown nl
/manualfeed (manualfeed ) {manualfeed bprint} ifknown nl
/manualfeedtimeout (manualfeedtimeout ) {manualfeedtimeout 40 string cvs print} ifknown nl
/prefeed (prefeed ) {prefeed bprint} ifknown nl
nl
/pagestackorder (pagestackorder ) {pagestackorder bprint} ifknown nl
end

%userdict
userdict begin
/smooth4 (smooth4 ) {(known) print} ifknown nl
/stretch (stretch ) {(known) print} ifknown nl
end

%systemdict
systemdict begin
/languagelevel (languagelevel ) {languagelevel 40 string cvs print} ifknown nl
end

% currentpagedevice - Level 2 only.
systemdict begin /currentpagedevice (currentpagedevice) {
        nl
        currentpagedevice dictprint
} ifknown end
------------------------------------------------------------------------

and ran the socket backend manually with this as input expecting to see the backchannel data on file descriptor 3:

# PRINTER=pp23
# DEVICE_URI=socket://pp23
# export PRINTER DEVICE_URI
# ./socket 100 john telltale2.ps 1 opt telltale2.ps 3>&1 2>&1
INFO: Attempting to connect to host pp23 on port 9100
STATE: +connecting-to-device
STATE: -connecting-to-device
PAGE: 1 1
DEBUG: backendRunLoop(print_fd=4, device_fd=6, use_bc=1)
DEBUG: Read 2099 bytes of print data...
DEBUG: Wrote 2099 bytes of print data...
INFO: Sent print file, 2099 bytes...
INFO: Print file sent, waiting for printer to finish...
INFO: Ready to print.
#

I can print more typical PostScript files this way, btw.

I don't see any backchannel data - though the backchannel data reporting service of our old non-CUPS print system mails me oodles of output for the same program.

Am I missing something, or am I suffering from the effects of STR #1724? I see that there is a patch to fix CUPS 1.2.0 for that - is that patch required also for 1.2.2?

John A. Murdie




More information about the cups mailing list