[pisa-src] r1182 - in trunk: include/log.h libpisa/conmgr.c pisasd/sdregister.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 15 Oct 2009 17:18:16 +0200

Author: tjansen
Date: Thu Oct 15 17:18:16 2009
New Revision: 1182

Log:
Fix build with --enable-logging.

- added #ifdef protection to log.h
- fixed a renamed variable in conmgr.c
- added missing include in sdregister.c

Modified:
   trunk/include/log.h
   trunk/libpisa/conmgr.c
   trunk/pisasd/sdregister.c

Modified: trunk/include/log.h
==============================================================================
--- trunk/include/log.h Thu Oct 15 17:15:33 2009        (r1181)
+++ trunk/include/log.h Thu Oct 15 17:18:16 2009        (r1182)
@@ -13,6 +13,10 @@
 #ifndef PISA_LOG_H
 #define PISA_LOG_H
 
+/* Only offer logging functionality, if we were configured with the
+ * corresponding option */
+#ifdef CONFIG_PISA_LOGGING
+
 #include <stdio.h>
 #include <time.h>
 
@@ -36,4 +40,5 @@
 void log_nat_mapping_end(const char *hit);
 void print_to_log(const char* fmt,...);
 
+#endif /* CONFIG_PISA_LOGGING */
 #endif /* PISA_LOG_H */

Modified: trunk/libpisa/conmgr.c
==============================================================================
--- trunk/libpisa/conmgr.c      Thu Oct 15 17:15:33 2009        (r1181)
+++ trunk/libpisa/conmgr.c      Thu Oct 15 17:18:16 2009        (r1182)
@@ -187,7 +187,7 @@
 #ifdef CONFIG_PISA_LOGGING
        char hit[INET6_ADDRSTRLEN];
        /* log end of connection */
-       inet_ntop(AF_INET6, &entry->address_control->sin6_addr, hit, 
INET6_ADDRSTRLEN);
+       inet_ntop(AF_INET6, &entry->hit, hit, INET6_ADDRSTRLEN);
        log_stop_connection(hit, entry->transferred_bytes, entry->start_time);
 #endif
 

Modified: trunk/pisasd/sdregister.c
==============================================================================
--- trunk/pisasd/sdregister.c   Thu Oct 15 17:15:33 2009        (r1181)
+++ trunk/pisasd/sdregister.c   Thu Oct 15 17:18:16 2009        (r1182)
@@ -14,6 +14,7 @@
 #include "sdctx.h"
 #include "sdconf.h"
 #include "sdclients.h"
+#include "log.h"
 
 /**
  * send an RegisterAck to a client.

Other related posts:

  • » [pisa-src] r1182 - in trunk: include/log.h libpisa/conmgr.c pisasd/sdregister.c - Thomas Jansen