Fixes for retrieval handling in SRU mode.. The "virtual" record syntax
[yaz-moved-to-github.git] / src / seshigh.c
index f6dedb5..3cc1b38 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: seshigh.c,v 1.79 2006-05-08 19:48:26 adam Exp $
+ * $Id: seshigh.c,v 1.80 2006-05-09 13:39:47 adam Exp $
  */
 /**
  * \file seshigh.c
@@ -582,6 +582,10 @@ static int retrieve_fetch(association *assoc, bend_fetch_rr *rr)
     const char *match_schema = 0;
     int *match_syntax = 0;
 
+    if (!assoc->server)
+    {
+        yaz_log(YLOG_LOG, "no assoc->server");
+    }
     if (assoc->server)
     {
         int r;
@@ -591,6 +595,8 @@ static int retrieve_fetch(association *assoc, bend_fetch_rr *rr)
         const char *backend_schema = 0;
         Odr_oid *backend_syntax = 0;
 
+        yaz_log(YLOG_LOG, "found assoc->server");
+
         r = yaz_retrieval_request(assoc->server->retrieval,
                                   input_schema,
                                   input_syntax_raw,
@@ -671,6 +677,7 @@ static int retrieve_fetch(association *assoc, bend_fetch_rr *rr)
         rr->output_format = oi ? oi->value : VAL_NONE;
         rr->output_format_raw = match_syntax;
     }
+    yaz_log(YLOG_LOG, "match_scheam=%s", match_schema);
     if (match_schema)
         rr->schema = odr_strdup(rr->stream, match_schema);
     return 0;
@@ -691,7 +698,7 @@ static int srw_bend_fetch(association *assoc, int pos,
     rr.referenceId = 0;
     rr.request_format = VAL_TEXT_XML;
     rr.request_format_raw = yaz_oidval_to_z3950oid(assoc->decode,
-                                                   CLASS_TRANSYN,
+                                                   CLASS_RECSYN,
                                                    VAL_TEXT_XML);
     rr.comp = (Z_RecordComposition *)
             odr_malloc(assoc->decode, sizeof(*rr.comp));
@@ -732,8 +739,6 @@ static int srw_bend_fetch(association *assoc, int pos,
     rr.len = 0;
     rr.record = 0;
     rr.last_in_set = 0;
-    rr.output_format = VAL_TEXT_XML;
-    rr.output_format_raw = 0;
     rr.errcode = 0;
     rr.errstring = 0;
     rr.surrogate_flag = 0;
@@ -2235,7 +2240,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
                 assoc->init->implementation_name,
                 odr_prepend(assoc->encode, "GFS", resp->implementationName));
 
-    version = odr_strdup(assoc->encode, "$Revision: 1.79 $");
+    version = odr_strdup(assoc->encode, "$Revision: 1.80 $");
     if (strlen(version) > 10)   /* check for unexpanded CVS strings */
         version[strlen(version)-2] = '\0';
     resp->implementationVersion = odr_prepend(assoc->encode,