X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zutil%2Fzgdu.c;h=dbd921e14ea8f08bb5b1fb372a8332f295e4110f;hb=b0555501e434d0f71f97ea17f282db2e795ff950;hp=b26b060cfcd10e36be96ddba8081421f9c35d22e;hpb=7d414d938ccbd98fc71383c356fec70ae269b2f5;p=yaz-moved-to-github.git diff --git a/zutil/zgdu.c b/zutil/zgdu.c index b26b060..dbd921e 100644 --- a/zutil/zgdu.c +++ b/zutil/zgdu.c @@ -2,10 +2,12 @@ * Copyright (c) 2002-2003, Index Data. * See the file LICENSE for details. * - * $Id: zgdu.c,v 1.7 2003-02-20 15:12:28 adam Exp $ + * $Id: zgdu.c,v 1.9 2003-03-11 11:09:17 adam Exp $ */ -#include +#include +#include +#include static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers, char **content_buf, int *content_len) @@ -277,6 +279,7 @@ int z_GDU (ODR o, Z_GDU **p, int opt, const char *name) } else /* ENCODE or PRINT */ { + int top0 = o->top; char sbuf[80]; Z_HTTP_Header *h; switch((*p)->which) @@ -310,7 +313,9 @@ int z_GDU (ODR o, Z_GDU **p, int opt, const char *name) (*p)->u.HTTP_Response->content_len); if (o->direction == ODR_PRINT) { - fprintf(o->print, "-- HTTP response:\n%.*s\n", o->top, o->buf); + fprintf(o->print, "-- HTTP response:\n%.*s\n", o->top - top0, + o->buf + top0); + fprintf(o->print, "-- \n"); } break; case Z_GDU_HTTP_Request: