[cups.development] notifiers and subscriptions

Michael Sweet mike at easysw.com
Wed Jun 21 16:06:16 PDT 2006


Jerome Alet wrote:
> On Wed, Jun 21, 2006 at 04:36:31PM -0400, Michael Sweet wrote:
>>> Any solution, besides rewriting parts of my own parser to have it
>>> read and parse at the same time ?
>> Have your parser stop when it sees the IPP end tag...
> 
> Of course, but detecting this tag is not possible without parsing
> the datas, and this is why I encounter the problem I exposed
> earlier.

So parse until you get the end tag or EOF, and then stop - you have
a complete message.

> My parser can parse a block of binary datas representing an IPP 
> request, but it can't currently read a file and parse it at the same 
> time : first it reads the entirety of the file's contents (or 
> stdin), and then it parses the entire block (simply because that's
> the way I wrote it) until the IPP end tag (of course).

So change that - read N bytes at a time (1 byte to grab the tag,
and then N bytes as needed for the name and value...)

> But ippReadFile() does it the other way around : it can read and
> parse a file at the same time, but can't parse a block of binary
> datas (because that's the way you wrote it).

Actually, it can, via ippReadIO().

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com




More information about the cups-devel mailing list