Changed include/yaz/diagbib1.h and added include/yaz/diagsrw.h with
[yaz-moved-to-github.git] / src / srwutil.c
index 18113c0..c476d11 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: srwutil.c,v 1.24 2005-01-16 21:56:24 adam Exp $
+ * $Id: srwutil.c,v 1.27 2005-02-01 14:43:50 adam Exp $
  */
 /**
  * \file srwutil.c
@@ -168,7 +168,9 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
     {
        const char *content_type = z_HTTP_header_lookup(hreq->headers,
                                                        "Content-Type");
-       if (content_type && !yaz_strcmp_del("text/xml", content_type, "; "))
+       if (content_type && 
+           (!yaz_strcmp_del("text/xml", content_type, "; ") ||
+            !yaz_strcmp_del("text/plain", content_type, "; ")))
        {
            char *db = "Default";
            const char *p0 = hreq->path, *p1;
@@ -253,6 +255,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
     {
         char *db = "Default";
         const char *p0 = hreq->path, *p1;
+#if HAVE_XML2
        const char *operation = 0;
        char *version = 0;
        char *query = 0;
@@ -269,6 +272,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
        char *maximumTerms = 0;
        char *responsePosition = 0;
        char *extraRequestData = 0;
+#endif
        char **uri_name;
        char **uri_val;