Description of new -h option.
[pazpar2-moved-to-github.git] / pazpar2.c
index 13b9b6c..4105ba2 100644 (file)
--- a/pazpar2.c
+++ b/pazpar2.c
@@ -1,4 +1,4 @@
-/* $Id: pazpar2.c,v 1.15 2006-12-18 14:37:21 sondberg Exp $ */;
+/* $Id: pazpar2.c,v 1.17 2006-12-19 04:49:34 quinn Exp $ */;
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -713,6 +713,12 @@ static void handler(IOCHAN i, int event)
 
     if (cl)
         se = cl->session;
+    else
+    {
+        yaz_log(YLOG_WARN, "Destroying orphan connection (fix me?)");
+        connection_destroy(co);
+        return;
+    }
 
     if (co->state == Conn_Connecting && event & EVENT_OUTPUT)
     {
@@ -1330,7 +1336,7 @@ int main(int argc, char **argv)
     if (signal(SIGPIPE, SIG_IGN) < 0)
         yaz_log(YLOG_WARN|YLOG_ERRNO, "signal");
 
-    yaz_log_init(YLOG_DEFAULT_LEVEL|YLOG_DEBUG, "pazpar2", 0);
+    yaz_log_init(YLOG_DEFAULT_LEVEL, "pazpar2", 0);
 
     while ((ret = options("c:h:p:C:s:", argv, argc, &arg)) != -2)
     {
@@ -1340,7 +1346,7 @@ int main(int argc, char **argv)
                 setport++;
                break;
             case 'h':
-                http_init(atoi(arg));
+                http_init(arg);
                 setport++;
                 break;
             case 'C':
@@ -1354,7 +1360,7 @@ int main(int argc, char **argv)
                 break;
            default:
                fprintf(stderr, "Usage: pazpar2\n"
-                        "    -h httpport             (REST)\n"
+                        "    -h [host:]port          (REST protocol listener)\n"
                         "    -c cmdport              (telnet-style)\n"
                         "    -C cclconfig\n"
                         "    -s simpletargetfile\n"