chiark / gitweb /
longer log messages
[innduct.git] / backends / innduct.c
index eb8d63aa281a3493418415c0ab4a48868703a63c..af192db149f7952e768315f6d9d35e9de400935e 100644 (file)
@@ -1,3 +1,33 @@
+/*
+ *  innduct
+ *  tailing reliable realtime streaming feeder for inn
+ *
+ *  Copyright (C) 2010 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ * 
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ * 
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ * 
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *  (I believe that when you compile and link this as part of the inn2
+ *  build, with the Makefile runes I have provided, all the libraries
+ *  and files which end up included in innduct are licence-compatible
+ *  with GPLv3.  If not then please let me know.  -Ian Jackson.)
+ */
+
+/*
+ * todo
+ *  specify perms of /tmp/innduct.control
+ */
+
 /*
  * debugging rune:
  *  build-lfs/backends/innduct --connection-timeout=30 --no-daemon -C ../inn.conf -f `pwd`/fee sit localhost
@@ -534,7 +564,7 @@ static void logv(int sysloglevel, const char *pfx, int errnoval,
                 const char *fmt, va_list al) PRINTF(5,0);
 static void logv(int sysloglevel, const char *pfx, int errnoval,
                 const char *fmt, va_list al) {
-  char msgbuf[256]; /* NB do not call xvasprintf here or you'll recurse */
+  char msgbuf[1024]; /* NB do not call xvasprintf here or you'll recurse */
   vsnprintf(msgbuf,sizeof(msgbuf), fmt,al);
   msgbuf[sizeof(msgbuf)-1]= 0;
 
@@ -3305,6 +3335,7 @@ static void dump_input_file(FILE *f, const ControlCommand *c,
     DUMPV("%d", ipf->,readcount_ok);
     DUMPV("%d", ipf->,readcount_blank);
     DUMPV("%d", ipf->,readcount_err);
+    DUMPV("%d", ipf->,count_nooffer_missing);
   }
   fprintf(f,"\n");
   if (ipf) {
@@ -3732,6 +3763,10 @@ int main(int argc, char **argv) {
 
   notice("starting");
 
+  int val= 1;
+  r= SMsetup(SM_PREOPEN, &val); if (!r) warn("SMsetup SM_PREOPEN failed");
+  r= SMinit(); if (!r) die("storage manager initialisation (SMinit) failed");
+
   if (!become_daemon)
     control_stdio();