Merge branch 'master' into sru_2_0
[yaz-moved-to-github.git] / src / zoom-sru.c
index 12f226f..b3c34cb 100644 (file)
@@ -329,14 +329,10 @@ static zoom_ret handle_srw_response(ZOOM_connection c,
             npr->u.databaseRecord->indirect_reference = 0;
             npr->u.databaseRecord->which = Z_External_octet;
 
-            npr->u.databaseRecord->u.octet_aligned = (Odr_oct *)
-                odr_malloc(c->odr_in, sizeof(Odr_oct));
-            npr->u.databaseRecord->u.octet_aligned->buf = (unsigned char*)
-                sru_rec->recordData_buf;
-            npr->u.databaseRecord->u.octet_aligned->len =
-                npr->u.databaseRecord->u.octet_aligned->size =
-                sru_rec->recordData_len;
-
+            npr->u.databaseRecord->u.octet_aligned =
+                odr_create_Odr_oct(c->odr_in,
+                                   sru_rec->recordData_buf,
+                                   sru_rec->recordData_len);
             if (sru_rec->recordSchema
                 && !strcmp(sru_rec->recordSchema,
                            "info:srw/schema/1/diagnostics-v1.1"))
@@ -420,7 +416,7 @@ int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres,
         ODR o = c->odr_in;
         Z_SOAP_Handler soap_handlers[3] = {
             {YAZ_XMLNS_SRU_v1_response, 0, (Z_SOAP_fun) yaz_srw_codec},
-            {YAZ_XMLNS_SRU_v2_response, 0, (Z_SOAP_fun) yaz_srw_codec},
+            {YAZ_XMLNS_SRU_v2_mask, 0, (Z_SOAP_fun) yaz_srw_codec},
             {0, 0, 0}
         };
         ret = z_soap_codec(o, &soap_package,