[cups.development] notifiers and subscriptions
Michael Sweet
mike at easysw.com
Thu Jun 22 05:55:09 PDT 2006
Jerome Alet wrote:
> On Wed, Jun 21, 2006 at 07:06:16PM -0400, Michael Sweet wrote:
>> 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.
>
> Sorry, maybe I didn't correctly expose the problem. I began talking
> about parsing the request, but this has nothing to do with parsing,
> only with reading it.
>
> I try another way :
>
> in subscriptions.c, sub->pipe seems to be closed only when a subscription
> is deleted or when CUPS stops all notifiers.
>
> is this normal ?
Yes, it is by design, otherwise events could be delivered out-of-order.
> does this mean that a particular notifier is launched a single time and
> will remain launched to process all the events until CUPS is stopped
> or the subscription is deleted ?
Yes, or if the notifier crashes or exits.
> at first glance I thought a notifier was launched each time a new
> event appeared, processed a single event and exited.
No, a notifier is normally active for the life of the subscription,
starting with the first event. The notifier may implement a timeout
which causes it to exit early, and cupsd will automatically restart
the notifier as needed.
--
______________________________________________________________________
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