Fix ODR pritn of HTTP requests
[yaz-moved-to-github.git] / src / zgdu.c
index b38233f..692ccf0 100644 (file)
@@ -2,11 +2,12 @@
  * Copyright (c) 2002-2003, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: zgdu.c,v 1.2 2003-12-21 11:33:29 adam Exp $
+ * $Id: zgdu.c,v 1.4 2003-12-30 15:18:53 adam Exp $
  */
 
 #include <yaz/odr.h>
 #include <yaz/yaz-version.h>
+#include <yaz/yaz-iconv.h>
 #include <yaz/zgdu.h>
 
 static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers,
@@ -352,7 +353,9 @@ int z_GDU (ODR o, Z_GDU **p, int opt, const char *name)
                           (*p)->u.HTTP_Request->content_len);
             if (o->direction == ODR_PRINT)
             {
-                fprintf(o->print, "-- HTTP request:\n%.*s\n", o->top, o->buf);
+                fprintf(o->print, "-- HTTP request:\n%.*s\n", o->top - top0,
+                        o->buf + top0);
+                fprintf(o->print, "-- \n");
             }
             break;
         case Z_GDU_Z3950: