Use OAI XML
[yaz-moved-to-github.git] / zutil / zoom-c.c
index b220b01..e94a9a9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: zoom-c.c,v 1.2 2002-09-24 08:05:42 adam Exp $
+ * $Id: zoom-c.c,v 1.4 2002-10-04 11:23:50 adam Exp $
  *
  * ZOOM layer for C, connections, result sets, queries.
  */
@@ -1143,7 +1143,7 @@ ZOOM_record_get (ZOOM_record rec, const char *type, int *len)
                                      r->u.octet_aligned->buf,
                                      rec->wrbuf_marc, 0,
                                      r->u.octet_aligned->len,
-                                     1) > 0)
+                                     2) > 0)
                 {
                     if (len) *len = wrbuf_len(rec->wrbuf_marc);
                     return wrbuf_buf(rec->wrbuf_marc);
@@ -2035,10 +2035,15 @@ static void handle_apdu (ZOOM_connection c, Z_APDU *apdu)
                 int sel;
                 
                 yaz_get_response_charneg(tmpmem, p, &charset, &lang, &sel);
-                yaz_log(LOG_DEBUG, "Target accepted: charset - %s,"
-                        "language - %s, select - %d",
-                        charset, lang, sel);
-                
+                yaz_log(LOG_DEBUG, "Target accepted: charset %s, "
+                        "language %s, select %d",
+                        charset ? charset : "none", lang ? lang : "none", sel);
+                if (charset)
+                    ZOOM_connection_option_set (c, "negotiation-charset",
+                                                charset);
+                if (lang)
+                    ZOOM_connection_option_set (c, "negotiation-lang",
+                                                lang);
                 nmem_destroy(tmpmem);
             }
        }