From: Sebastian Hammer Date: Wed, 15 Mar 1995 08:37:06 +0000 (+0000) Subject: Fixed protocol bugs. X-Git-Tag: YAZ.1.8~1133 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=adc5e45a46d9ce4f73370332f6e4c2f81c1d36fe Fixed protocol bugs. --- diff --git a/asn/proto.c b/asn/proto.c index 6b6995a..3b6cb0a 100644 --- a/asn/proto.c +++ b/asn/proto.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.c,v $ - * Revision 1.8 1995-03-14 16:59:24 quinn + * Revision 1.9 1995-03-15 08:37:06 quinn + * Fixed protocol bugs. + * + * Revision 1.8 1995/03/14 16:59:24 quinn * Fixed OPTIONAL flag in attributeelement * * Revision 1.7 1995/03/07 16:29:33 quinn @@ -525,10 +528,8 @@ int z_APDU(ODR o, Z_APDU **p, int opt) if (!odr_choice(o, arm, &(*p)->u, &(*p)->which)) { if (o->direction == ODR_DECODE) - { *p = 0; - return opt; - } + return opt; } return 1; } diff --git a/odr/ber_tag.c b/odr/ber_tag.c index 64c15e0..a0e39bb 100644 --- a/odr/ber_tag.c +++ b/odr/ber_tag.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_tag.c,v $ - * Revision 1.8 1995-03-10 11:44:40 quinn + * Revision 1.9 1995-03-15 08:37:18 quinn + * Fixed protocol bugs. + * + * Revision 1.8 1995/03/10 11:44:40 quinn * Fixed serious stack-bug in odr_cons_begin * * Revision 1.7 1995/03/08 12:12:13 quinn @@ -57,6 +60,8 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) { o->bp = o->buf; lclass = -1; + if (o->direction == ODR_ENCODE) + o->left = o->buflen; } switch (o->direction) { @@ -76,8 +81,8 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) o->bp += rd; o->left -= rd; #ifdef ODR_DEBUG - fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d]", class, tag, - *constructed, o->stackp); + fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d,left=%d]", class, tag, + *constructed, o->stackp, o->left); #endif return 1; case ODR_DECODE: