Ensure that connection is only used by one client
[pazpar2-moved-to-github.git] / src / eventl.c
index 3b57d64..48c1abd 100644 (file)
@@ -70,7 +70,8 @@ iochan_man_t iochan_man_create(int no_threads)
     man->sel_thread = 0; /* can't create sel_thread yet because we may fork */
     man->sel_fd = -1;
     man->no_threads = no_threads;
-    man->log_level = YLOG_DEBUG;
+    man->log_level = yaz_log_module_level("iochan");
+
     return man;
 }
 
@@ -150,7 +151,7 @@ static void run_fun(iochan_man_t man, IOCHAN p)
     {
         if (man->sel_thread)
         {
-            yaz_log(man->log_level, "eventl: add fun chan=%p name=%s event=%d",
+            yaz_log(man->log_level, "eventl: work add chan=%p name=%s event=%d",
                     p, p->name ? p->name : "", p->this_event);
             p->thread_users++;
             sel_thread_add(man->sel_thread, p);
@@ -235,6 +236,13 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans)
                 }
             }
         }
+        if (man->log_level)
+        {
+            int no = 0;
+            for (p = *iochans; p; p = p->next)
+                no++;
+            yaz_log(man->log_level, "%d channels", no);
+        }
         for (p = *iochans; p; p = p->next)
         {
             int force_event = p->force_event;
@@ -264,13 +272,11 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans)
                 if (FD_ISSET(p->fd, &in) || force_event == EVENT_INPUT)
                 {
                     p->last_event = now;
-                    yaz_log(YLOG_DEBUG, "Eventl input event");
                     p->this_event |= EVENT_INPUT;
                 }
                 if (FD_ISSET(p->fd, &out) || force_event == EVENT_OUTPUT)
                 {
                     p->last_event = now;
-                    yaz_log(YLOG_DEBUG, "Eventl output event");
                     p->this_event |= EVENT_OUTPUT;
                 }
                 if (FD_ISSET(p->fd, &except) || force_event == EVENT_EXCEPT)