Commit cfeecfb2 authored by Lev Walkin's avatar Lev Walkin

forward compatibility

parent 6f09f69f
...@@ -34,7 +34,7 @@ check(int type, char *tagname, char *xmlbuf, char *verify) { ...@@ -34,7 +34,7 @@ check(int type, char *tagname, char *xmlbuf, char *verify) {
rc = decoder(0, td, (void **)&st, tagname, xmlbuf, xmllen); rc = decoder(0, td, (void **)&st, tagname, xmlbuf, xmllen);
printf("[%s] => [%s]:%d vs [%s]:%d, code %d\n", printf("[%s] => [%s]:%d vs [%s]:%d, code %d\n",
xmlbuf, xmlbuf,
st ? st->buf : "", st ? st->size : 0, st ? (const char *)st->buf : "", st ? st->size : 0,
verify ? verify : "", verlen, rc.code); verify ? verify : "", verlen, rc.code);
if(verify) { if(verify) {
...@@ -68,6 +68,8 @@ main() { ...@@ -68,6 +68,8 @@ main() {
check(HEX, "z", "<z><!-- <some <sometag>-->40</z>", "@"); check(HEX, "z", "<z><!-- <some <sometag>-->40</z>", "@");
check(HEX, "z", "<z><!-- <some <sometag-->>40</z>", 0); check(HEX, "z", "<z><!-- <some <sometag-->>40</z>", 0);
check(HEX, "z", "ignored<z>40</z>stuff", "@");
check(HEX, "tag", "<tag>4</tag>", "@"); check(HEX, "tag", "<tag>4</tag>", "@");
check(BINARY, "tag", "<tag/>", ""); check(BINARY, "tag", "<tag/>", "");
......
...@@ -220,11 +220,15 @@ xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, ...@@ -220,11 +220,15 @@ xer_decode_general(asn_codec_ctx_t *opt_codec_ctx,
continue; continue;
case PXER_TEXT: case PXER_TEXT:
if(ctx->phase == 0) { if(ctx->phase == 0) {
/* Unexpected data */ /*
/* TODO: ignore whitespace? */ * We have to ignore whitespace here,
RETURN(RC_FAIL); * but in order to be forward compatible
* with EXTENDED-XER (EMBED-VALUES, #25)
* any text is just ignored here.
*/
} else {
XER_GOT_BODY(buf_ptr, ch_size);
} }
XER_GOT_BODY(buf_ptr, ch_size);
ADVANCE(ch_size); ADVANCE(ch_size);
continue; continue;
case PXER_TAG: case PXER_TAG:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment