connect-max per IP MP-632
[metaproxy-moved-to-github.git] / src / filter_log.cpp
index 2035b09..27ebadb 100644 (file)
@@ -326,7 +326,6 @@ static void log_1line_Z_APDU(Z_APDU *z_req, Z_APDU *z_res, WRBUF w)
                     res->records->u.multipleNonSurDiagnostics->diagRecs);
             }
             wrbuf_puts(w, " ");
-            assert(req->preferredRecordSyntax);
             log_syntax(w, req->preferredRecordSyntax);
 
             wrbuf_printf(w, " %s " ODR_INT_PRINTF "+" ODR_INT_PRINTF " ",
@@ -682,7 +681,11 @@ void yf::Log::Impl::process(mp::Package &package)
             {
                 mp::odr odr(ODR_PRINT);
                 odr_set_stream(odr, m_file->fhandle, stream_write, 0);
+                if (!m_file->fhandle)
+                    yaz_log_lock();
                 z_GDU(odr, &gdu_req, 0, 0);
+                if (!m_file->fhandle)
+                    yaz_log_unlock();
             }
         }
     }
@@ -777,7 +780,11 @@ void yf::Log::Impl::process(mp::Package &package)
             {
                 mp::odr odr(ODR_PRINT);
                 odr_set_stream(odr, m_file->fhandle, stream_write, 0);
+                if (!m_file->fhandle)
+                    yaz_log_lock();
                 z_GDU(odr, &gdu_res, 0, 0);
+                if (!m_file->fhandle)
+                    yaz_log_unlock();
             }
         }
     }