[cups-devel] The difference of data sent on macOS and Linux

Michael Sweet msweet at apple.com
Mon Aug 15 11:30:03 PDT 2016


The device URI determines the backend that is used.

In the case of the dnssd backend, the Bonjour service instance name is resolved using the protocol in the URI (_printer = LPD, _pdl-datastream = AppSocket, _ipp or _ipps = IPP). When resolved to LPD, the backend MUST save the print data to a file so that it can tell the printer how large the print file is (there are non-standard extensions that allow for variable-length files, but effectively that turns LPD into AppSocket and requires manual specification using a lpd:// device URI with the "?mode=stream" option on the end.

In any you, you cannot assume bidirectional communications with a printer, nor can you know how much data will be buffered by the backend before it gets sent to the printer.  There is a "drain output" side-channel command that you can use which will return an error (CUPS_SC_STATUS_NOT_IMPLEMENTED) for the LPD backend (so you know that buffering tricks are futile...)


> On Aug 14, 2016, at 10:13 PM, DanTan at pek.destiny.com.cn wrote:
> 
>>> What Linux distribution?
>> Try it on Ubuntu 16.04 LTS.
>>> 
>>> What device URI(s) are you using on each system?
>> For Linux:	socket://
>> For macOS:  	dnssd://
>> 
>> I tried with socket:// on macOS, it’s same with dnssd://
> 
> Sorry for my failure, with socket:// on macOS, the result is same with Linux.
> So,  the issue is based on the URL?
> ===========================
> Unus pro omnibus, omnes pro uno
> -Dan✉
> 
>> On Aug 15, 2016, at 9:51 AM, dtcbdtcb0571 <DanTan at pek.destiny.com.cn> wrote:
>> 
>>> What Linux distribution?
>> Try it on Ubuntu 16.04 LTS.
>>> 
>>> What device URI(s) are you using on each system?
>> For Linux:	socket://
>> For macOS:  	dnssd://
>> 
>> I tried with socket:// on macOS, it’s same with dnssd://.
>> 
>> ===========================
>> Unus pro omnibus, omnes pro uno
>> -Dan✉
>> 
>>> On Aug 14, 2016, at 6:58 AM, Michael Sweet <msweet at apple.com> wrote:
>>> 
>>> What Linux distribution?
>>> 
>>> What device URI(s) are you using on each system?
>>> 
>>> 
>>>> On Aug 9, 2016, at 6:42 AM, DanTan at pek.destiny.com.cn wrote:
>>>> 
>>>> Dears,
>>>> 
>>>> I am developing a  raster driver (filter) with same code on both macOS and Linux.
>>>> In the code I flush stdout every time with a page end. I wish CUPS will send the page data to printer, so when the driver handing the next page, the printer can print the current page.
>>>> The design is good on  Linux, but on macOS, CUPS didn’t send the data, until filter exit(Check on macOS 10.10.5).
>>>> 
>>>> So, I wonder, if there is a way for filter to force CUPS to send the data to printer on macOS, or it just a different behavior on different OS.
>>>> 
>>>> 
>>>> ===========================
>>>> 
>>>> Unus pro omnibus, omnes pro uno
>>>> 
>>>> -Dan✉<mailto:DanTan at pek.destiny.com.cn>
>>>> 
>>>> 
>>>> ________________________________
>>>> 
>>>> The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
>>>> 
>>>> 本郵件(含所有附件)包含受法律保護以及機密之資訊,僅供本郵件指定的收件人使用。如果您並非指定的收件人,請立即以電子郵件通知寄件人,並將本郵件及所有複印本刪除。請注意,非經授權,嚴格禁止閱覽、散播、散佈或複製本郵件及其內容。
>>>> _______________________________________________
>>>> cups-devel mailing list
>>>> cups-devel at cups.org
>>>> https://www.cups.org/mailman/listinfo/cups-devel
>>> 
>>> _________________________________________________________
>>> Michael Sweet, Senior Printing System Engineer
>>> 
>>> _______________________________________________
>>> cups-devel mailing list
>>> cups-devel at cups.org
>>> https://www.cups.org/mailman/listinfo/cups-devel
>> 
> 
> _______________________________________________
> cups-devel mailing list
> cups-devel at cups.org
> https://www.cups.org/mailman/listinfo/cups-devel

_________________________________________________________
Michael Sweet, Senior Printing System Engineer




More information about the cups mailing list