]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/log/ModTcp.cc
Renamed squid.h to squid-old.h and config.h to squid.h
[thirdparty/squid.git] / src / log / ModTcp.cc
index 37cc8cbe790c07103f4fde22724f79e6b55baefb..49a820b257d1a0c766fd3d5a50ac5e7ac4bdcdac 100644 (file)
@@ -31,8 +31,9 @@
  *
  */
 
-#include "squid.h"
+#include "squid-old.h"
 #include "comm.h"
+#include "comm/Connection.h"
 #include "log/File.h"
 #include "log/ModTcp.h"
 #include "Parsing.h"
@@ -101,7 +102,7 @@ logfile_mod_tcp_writeline(Logfile * lf, const char *buf, size_t len)
         return;
     }
     /* buffer it */
-    xmemcpy(ll->buf + ll->offset, buf, len);
+    memcpy(ll->buf + ll->offset, buf, len);
 
     ll->offset += len;
 
@@ -118,6 +119,7 @@ logfile_mod_tcp_linestart(Logfile * lf)
 static void
 logfile_mod_tcp_lineend(Logfile * lf)
 {
+    logfile_mod_tcp_flush(lf);
 }
 
 static void
@@ -150,9 +152,9 @@ logfile_mod_tcp_close(Logfile * lf)
 int
 logfile_mod_tcp_open(Logfile * lf, const char *path, size_t bufsz, int fatal_flag)
 {
-    debugs(5, 3, "Tcp Open called");   
-    IpAddress addr;
-       
+    debugs(5, 3, "Tcp Open called");
+    Ip::Address addr;
+
     char *strAddr;
 
     lf->f_close = logfile_mod_tcp_close;
@@ -180,16 +182,14 @@ logfile_mod_tcp_open(Logfile * lf, const char *path, size_t bufsz, int fatal_fla
         }
     }
 
-safe_free(strAddr);
+    safe_free(strAddr);
 
-    IpAddress any_addr;
+    Ip::Address any_addr;
     any_addr.SetAnyAddr();
 
-#if USE_IPV6
     // require the sending TCP port to be of the right family for the destination address.
     if (addr.IsIPv4())
-        no_addr.SetIPv4();
-#endif
+        any_addr.SetIPv4();
 
     ll->fd = comm_open(SOCK_STREAM, IPPROTO_TCP, any_addr, COMM_NONBLOCKING, "TCP log socket");
     if (ll->fd < 0) {