Remove redundant client_incref, client_destroy
[pazpar2-moved-to-github.git] / src / client.c
index 18d7c6b..26d5fae 100644 (file)
@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #if HAVE_CONFIG_H
 #include <config.h>
 #endif
-
+#include <pthread.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -58,6 +58,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include <yaz/timing.h>
 #endif
 
+#include "ppmutex.h"
 #include "session.h"
 #include "parameters.h"
 #include "client.h"
@@ -477,15 +478,18 @@ void client_record_response(struct client *cl)
                 if (cl->session == 0)
                     ;
                 else if (ZOOM_record_error(rec, &msg, &addinfo, 0))
+                {
                     yaz_log(YLOG_WARN, "Record error %s (%s): %s (rec #%d)",
-                            error, addinfo, client_get_url(cl),
+                            msg, addinfo, client_get_url(cl),
                             cl->record_offset);
+                }
                 else
                 {
                     struct session_database *sdb = client_get_database(cl);
                     NMEM nmem = nmem_create();
                     const char *xmlrec;
                     char type[80];
+
                     if (nativesyntax_to_type(sdb, type, rec))
                         yaz_log(YLOG_WARN, "Failed to determine record type");
                     xmlrec = ZOOM_record_get(rec, type, NULL);
@@ -603,7 +607,8 @@ struct client *client_create(void)
     r->resultset = 0;
     r->next = 0;
     r->mutex = 0;
-    yaz_mutex_create(&r->mutex);
+    pazpar2_mutex_create(&r->mutex, "client");
+
     r->ref_count = 1;
     
     return r;