[cups.development] notifiers and subscriptions

Jerome Alet alet at librelogiciel.com
Wed Jun 21 12:00:38 PDT 2006


On Wed, Jun 21, 2006 at 11:39:10AM -0400, Michael Sweet wrote:
> 
> It covers writing notifiers and the specifics of notification
> operations and attributes.  The only thing it doesn't include is
> sample code to create subscriptions, etc.

I think I've encountered a problem and I don't know if it is
a bug or something else.

Now I'm able to write a notifier on my own, and have it 
launched by CUPS.

By reading the source of the test and mailto notifiers, I can see 
that both read the IPP datas from stdin, by calling ippReadFile()

ippReadFile in turn, reads AND parses the input at the same
time.

I'd like to be able to use my own IPP parser (pkipplib, written in 
Python) which (currently) requires that the IPP datas are entirely 
read before beginning to parse them. 

It seems it's not possible to do this, because CUPS doesn't flush or 
doesn't close the pipe when the entire content of the notification 
has been sent, and my own notifier basically waits until the end of 
the input arrives (doing a simple sys.stdin.read() blocking call), 
which never happens. 

Any solution, besides rewriting parts of my own parser to have it
read and parse at the same time ?

TIA

Jerome Alet





More information about the cups mailing list