[libYAML] Error recovery?

Marc Peter <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
Hello,

I'm transmitting events in YAML format. This is done by sending events
as documents over a single connection.

The documents are received using yaml_parser_load(). However, I can't
ensure that all documents are always "well formed" (for example due to
transmission errors).

Once a parser error has occured, how can I get the parser back to a
working state, where it is ready to accept another document?

I thought about calling yaml_parser_scan() until a
YAML_DOCUMENT_END_TOKEN is received, but the documenation explicitly
forbids this:

> An application must not alternate the calls of yaml_parser_parse()
> with the calls of yaml_parser_scan() or yaml_parser_load(). Doing
> this will break the parser.

Now I'm wondering if this rule can be broken for error recovery, as I
don't want to work at the event-reception level.

best regards
Marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.