Don't treat end-of-document-structure as an error.

This commit is contained in:
px4dev 2012-10-08 22:37:18 -07:00
parent a29e8e00fa
commit a2ab5e8691
1 changed files with 3 additions and 1 deletions

View File

@ -106,7 +106,9 @@ bson_decoder_next(bson_decoder_t decoder)
/* if the nesting level is now zero, the top-level document is done */
if (decoder->nesting == 0) {
CODER_KILL(decoder, "nesting is zero, document is done");
/* like kill but not an error */
debug("nesting is zero, document is done");
decoder->fd = -1;
/* return end-of-file to the caller */
return 0;