Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Aug 2014 20:28:07 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Phil Shafer <phil@juniper.net>
Cc:        arch@freebsd.org, John-Mark Gurney <jmg@funkthat.com>, marcel@freebsd.org, "Simon J. Gerraty" <sjg@juniper.net>
Subject:   Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML
Message-ID:  <63132.1406924887@critter.freebsd.dk>
In-Reply-To: <201408011550.s71FoiQo003612@idle.juniper.net>
References:  <201408011550.s71FoiQo003612@idle.juniper.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
In message <201408011550.s71FoiQo003612@idle.juniper.net>, Phil Shafer writes:
>"Simon J. Gerraty" writes:
>>Of course I wouldn't be surprised if the lib already handles all that ;-)
>
>No, I can't manufacture memory on the fly ;^)
>
>Hmmm... I could have an emergency mode where I stop trying to buffer
>and churn out a series of small write() calls to send close tags.
>Or perhaps just punting and refusing to write more once ENOMEM is
>seen is the right thing.

First of, this is not just ENOMEM, this is also invalid UTF-8 strings,
NULL pointers and much more bogosity.

>Seeing broken output is better than limping
>along with output that looks right but isn't.

The output should preferably be explicitly broken, so that nobody 
downstream mistakenly takes it and runs with it.


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?63132.1406924887>