Removing all write reference to innerHTML.
[pazpar2-moved-to-github.git] / src / pazpar2.c
index b5a0ee7..1fe17a8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pazpar2.c,v 1.22 2007-01-09 22:06:49 quinn Exp $ */;
+/* $Id: pazpar2.c,v 1.26 2007-01-10 11:56:10 adam Exp $ */
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -29,6 +29,8 @@
 #include <yaz/timing.h>
 #endif
 
+#include <netinet/in.h>
+
 #include "pazpar2.h"
 #include "eventl.h"
 #include "http.h"
@@ -480,7 +482,7 @@ static struct record *ingest_record(struct client *cl, Z_External *rec)
     res->next = 0;
     res->metadata = nmem_malloc(se->nmem,
             sizeof(struct record_metadata*) * service->num_metadata);
-    bzero(res->metadata, sizeof(struct record_metadata*) * service->num_metadata);
+    memset(res->metadata, 0, sizeof(struct record_metadata*) * service->num_metadata);
 
     mergekey_norm = nmem_strdup(se->nmem, (char*) mergekey);
     xmlFree(mergekey);
@@ -859,7 +861,8 @@ static struct connection *connection_create(struct client *cl)
 
     if (!(addr = cs_straddr(link, cl->database->host->ipport)))
     {
-        yaz_log(YLOG_WARN|YLOG_ERRNO, "Lookup of IP address failed?");
+        yaz_log(YLOG_WARN|YLOG_ERRNO, "Lookup of IP address %s failed?", 
+           cl->database->host->ipport);
         return 0;
     }
 
@@ -1015,7 +1018,7 @@ void load_simpletargets(const char *fn)
             }
             assert(addrinfo->ai_family == PF_INET);
             memcpy(addrbuf, &((struct sockaddr_in*)addrinfo->ai_addr)->sin_addr.s_addr, 4);
-            sprintf(ipport, "%hhd.%hhd.%hhd.%hhd:%s",
+            sprintf(ipport, "%u.%u.%u.%u:%s",
                     addrbuf[0], addrbuf[1], addrbuf[2], addrbuf[3], port);
             host->ipport = xstrdup(ipport);
             freeaddrinfo(addrinfo);
@@ -1359,7 +1362,7 @@ void statistics(struct session *se, struct statistics *stat)
     struct client *cl;
     int count = 0;
 
-    bzero(stat, sizeof(*stat));
+    memset(stat, 0, sizeof(*stat));
     for (cl = se->clients; cl; cl = cl->next)
     {
         if (!cl->connection)
@@ -1400,7 +1403,7 @@ int main(int argc, char **argv)
     char *arg;
     int setport = 0;
 
-    if (signal(SIGPIPE, SIG_IGN) < 0)
+    if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
         yaz_log(YLOG_WARN|YLOG_ERRNO, "signal");
 
     yaz_log_init(YLOG_DEFAULT_LEVEL, "pazpar2", 0);