From: Sebastian Hammer Date: Wed, 18 Oct 1995 16:12:55 +0000 (+0000) Subject: Better diagnostics. Added special case in NULL to handle WAIS server. X-Git-Tag: YAZ.1.8~894 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=3d0077a6eb90bf1cf4d2ecc3acd1afaf7c829bd0 Better diagnostics. Added special case in NULL to handle WAIS server. --- diff --git a/odr/dumpber.c b/odr/dumpber.c index 7ae685d..b52cabd 100644 --- a/odr/dumpber.c +++ b/odr/dumpber.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: dumpber.c,v $ - * Revision 1.4 1995-09-29 17:12:21 quinn + * Revision 1.5 1995-10-18 16:12:55 quinn + * Better diagnostics. Added special case in NULL to handle WAIS server. + * + * Revision 1.4 1995/09/29 17:12:21 quinn * Smallish * * Revision 1.3 1995/09/27 15:02:57 quinn @@ -22,7 +25,7 @@ #include #include -static int do_dumpBER(FILE *f, char *buf, int len, int level) +static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset) { int res, ll, class, tag, cons; char *b = buf; @@ -38,7 +41,7 @@ static int do_dumpBER(FILE *f, char *buf, int len, int level) fprintf(stderr, "Unexpected end of buffer\n"); return 0; } - fprintf(stderr, "%*s", level * 4, ""); + fprintf(stderr, "%5d: %*s", offset, level * 4, ""); if (class == ODR_UNIVERSAL) { static char *nl[] = @@ -94,7 +97,7 @@ static int do_dumpBER(FILE *f, char *buf, int len, int level) { if (ll == -1 && *b == 0 && *(b + 1) == 0) break; - if (!(res = do_dumpBER(f, b, len, level + 1))) + if (!(res = do_dumpBER(f, b, len, level + 1, offset + (b - buf)))) { fprintf(stderr, "Dump of content element failed.\n"); return 0; @@ -116,5 +119,5 @@ static int do_dumpBER(FILE *f, char *buf, int len, int level) int odr_dumpBER(FILE *f, char *buf, int len) { - return do_dumpBER(f, buf, len, 0); + return do_dumpBER(f, buf, len, 0, 0); } diff --git a/odr/odr_null.c b/odr/odr_null.c index ac772b2..6525e27 100644 --- a/odr/odr_null.c +++ b/odr/odr_null.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_null.c,v $ - * Revision 1.8 1995-09-29 17:12:24 quinn + * Revision 1.9 1995-10-18 16:12:56 quinn + * Better diagnostics. Added special case in NULL to handle WAIS server. + * + * Revision 1.8 1995/09/29 17:12:24 quinn * Smallish * * Revision 1.7 1995/09/27 15:02:59 quinn @@ -58,8 +61,12 @@ int odr_null(ODR o, Odr_null **p, int opt) } if (cons) { +#ifdef ODR_STRICT_NULL o->error = OPROTO; return 0; +#else + fprintf(stderr, "odr: Warning: Bad NULL\n"); +#endif } if (o->direction == ODR_DECODE) *p = ODR_NULLVAL;