diff -r -u -w -N /root/Toinstall/squid.original/src/log/File.cc /root/Toinstall/squid.modtcp/src/log/File.cc --- /root/Toinstall/squid.original/src/log/File.cc 2010-04-12 20:43:50.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/File.cc 2010-04-12 20:55:37.000000000 +0530 @@ -39,6 +39,7 @@ #include "log/ModStdio.h" #include "log/ModSyslog.h" #include "log/ModUdp.h" +#include "log/ModTcp.h" CBDATA_TYPE(Logfile); @@ -61,6 +62,9 @@ } else if (strncmp(path, "daemon:", 7) == 0) { patharg = path + 7; ret = logfile_mod_daemon_open(lf, patharg, bufsz, fatal_flag); + } else if (strncmp(path, "tcp:", 4) == 0) { + patharg = path + 4; + ret = logfile_mod_tcp_open(lf, patharg, bufsz, fatal_flag); } else if (strncmp(path, "udp:", 4) == 0) { patharg = path + 4; ret = logfile_mod_udp_open(lf, patharg, bufsz, fatal_flag); diff -r -u -w -N /root/Toinstall/squid.original/src/log/Makefile /root/Toinstall/squid.modtcp/src/log/Makefile --- /root/Toinstall/squid.original/src/log/Makefile 1970-01-01 05:30:00.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/Makefile 2010-04-12 20:55:37.000000000 +0530 @@ -0,0 +1,644 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# src/log/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +pkgdatadir = $(datadir)/squid +pkglibdir = $(libdir)/squid +pkgincludedir = $(includedir)/squid +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = i686-pc-linux-gnu +host_triplet = i686-pc-linux-gnu +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/src/Common.am $(top_srcdir)/src/TestHeaders.am +check_PROGRAMS = +subdir = src/log +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/autoconf.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +liblog_la_LIBADD = +am_liblog_la_OBJECTS = access_log.lo Config.lo File.lo ModDaemon.lo \ + ModStdio.lo ModSyslog.lo ModUdp.lo ModTcp.lo +liblog_la_OBJECTS = $(am_liblog_la_OBJECTS) +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(liblog_la_SOURCES) +DIST_SOURCES = $(liblog_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /root/Toinstall/squid-3.HEAD-20100408/cfgaux/missing --run aclocal-1.10 +ADAPTATION_LIBS = +ALLOCA = +AMTAR = ${SHELL} /root/Toinstall/squid-3.HEAD-20100408/cfgaux/missing --run tar +AR = /usr/bin/ar +AR_R = /usr/bin/ar r +AUTH_LIBS_TO_BUILD = libntlm.la libbasic.la libdigest.la libnegotiate.la +AUTH_MODULES = ntlm basic digest negotiate +AUTOCONF = ${SHELL} /root/Toinstall/squid-3.HEAD-20100408/cfgaux/missing --run autoconf +AUTOHEADER = ${SHELL} /root/Toinstall/squid-3.HEAD-20100408/cfgaux/missing --run autoheader +AUTOMAKE = ${SHELL} /root/Toinstall/squid-3.HEAD-20100408/cfgaux/missing --run automake-1.10 +AWK = gawk +BASIC_AUTH_HELPERS = +CACHE_EFFECTIVE_USER = nobody +CACHE_HTTP_PORT = 3128 +CACHE_ICP_PORT = 3130 +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -Wall -g -O2 -pipe +CGIEXT = .cgi +CHMOD = /bin/chmod +CPP = gcc -E +CPPFLAGS = +CPPUNITCONFIG = false +CRYPTLIB = -lcrypt +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 -pipe +CYGPATH_W = echo +DEFAULT_LOG_DIR = ${prefix}/var/logs +DEFAULT_PIDFILE = ${prefix}/var/run/squid.pid +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DIGEST_AUTH_HELPERS = +DISK_LIBS = libAIO.a libBlocking.a libDiskDaemon.a libDiskThreads.a +DISK_LINKOBJS = DiskIO/AIO/AIODiskIOModule.o DiskIO/Blocking/BlockingDiskIOModule.o DiskIO/DiskDaemon/DiskDaemonDiskIOModule.o DiskIO/DiskThreads/DiskThreadsDiskIOModule.o +DISK_MODULES = AIO Blocking DiskDaemon DiskThreads +DISK_OS_LIBS = -lrt -lpthread +DISK_PROGRAMS = DiskIO/DiskDaemon/diskd +DSYMUTIL = +ECAPLIB = +ECAP_LIBS = +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EPOLL_LIBS = +EXEEXT = +EXPATLIB = +EXTERNAL_ACL_HELPERS = +F77 = gfortran +FALSE = /bin/false +FFLAGS = -g -O2 +GREP = /bin/grep +ICAP_LIBS = +INCLTDL = -I${top_srcdir}/libltdl +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +KRB5INCS = +KRB5LIBS = -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lkrb5 -lk5crypto -lcom_err +LBERLIB = -llber +LDAPLIB = -lldap +LDFLAGS = -g +LIBADD_DL = -ldl +LIBLTDL = ${top_builddir}/libltdl/libltdlc.la +LIBOBJS = ${LIBOBJDIR}eui64_aton$U.o +LIBS = +LIBSASL = +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIB_DB = -ldb +LN = /bin/ln +LN_S = ln -s +LOG_DAEMON_HELPERS = +LTLIBOBJS = ${LIBOBJDIR}eui64_aton$U.lo +MAINT = # +MAKEINFO = ${SHELL} /root/Toinstall/squid-3.HEAD-20100408/cfgaux/missing --run makeinfo +MINGW_LIBS = +MKDIR = /bin/mkdir +MKDIR_P = /bin/mkdir -p +MV = /bin/mv +NEGOTIATE_AUTH_HELPERS = kerberos +NMEDIT = +NTLM_AUTH_HELPERS = +OBJEXT = o +OPT_DEFAULT_HOSTS = /etc/hosts +PACKAGE = squid +PACKAGE_BUGREPORT = http://www.squid-cache.org/bugs/ +PACKAGE_NAME = Squid Web Proxy +PACKAGE_STRING = Squid Web Proxy 3.HEAD-20100408 +PACKAGE_TARNAME = squid +PACKAGE_VERSION = 3.HEAD-20100408 +PATH_SEPARATOR = : +PERL = /usr/bin/perl +PO2HTML = +RANLIB = ranlib +REGEXLIB = +REPL_LIBS = liblru.a +REPL_OBJS = repl/liblru.a +REPL_POLICIES = lru +RM = /bin/rm -f +SED = /bin/sed +SET_IPV6_SETTINGS = +SET_MAKE = +SH = /bin/sh +SHELL = /bin/sh +SNMPLIB = ../snmplib/libsnmp.a +SQUID_CFLAGS = -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -D_REENTRANT +SQUID_CPPUNIT_INC = +SQUID_CPPUNIT_LA = +SQUID_CPPUNIT_LIBS = +SQUID_CXXFLAGS = -Wall -Wpointer-arith -Wwrite-strings -Wcomments -Werror -D_REENTRANT +SSLLIB = +STORE_LIBS_TO_ADD = fs/libufs.la +STORE_LIBS_TO_BUILD = libufs.la +STORE_TESTS = tests/testUfs +STRIP = strip +TRUE = /bin/true +URL_REWRITE_HELPERS = +VERSION = 3.HEAD-20100408 +WIN32_PSAPI = +XMLLIB = +XTRA_LIBS = -lm -lnsl +XTRA_OBJS = +abs_builddir = /root/Toinstall/squid-3.HEAD-20100408/src/log +abs_srcdir = /root/Toinstall/squid-3.HEAD-20100408/src/log +abs_top_builddir = /root/Toinstall/squid-3.HEAD-20100408 +abs_top_srcdir = /root/Toinstall/squid-3.HEAD-20100408 +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_F77 = gfortran +ac_krb5_config = yes +am__include = include +am__leading_dot = . +am__quote = +am__tar = tar --format=ustar -chf - "$$tardir" +am__untar = tar -xf - +bindir = ${exec_prefix}/bin +build = i686-pc-linux-gnu +build_alias = +build_cpu = i686 +build_os = linux-gnu +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-linux-gnu +host_alias = +host_cpu = i686 +host_os = linux-gnu +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = $(SHELL) /root/Toinstall/squid-3.HEAD-20100408/cfgaux/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +makesnmplib = snmplib +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local/squid +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +subdirs = lib/libTrie libltdl +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../../ +top_builddir = ../.. +top_srcdir = ../.. +AM_CFLAGS = $(SQUID_CFLAGS) +AM_CXXFLAGS = $(SQUID_CXXFLAGS) +CLEANFILES = testHeaders +TESTS = testHeaders +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/src \ + -I$(top_builddir)/include $(SQUID_CPPUNIT_INC) $(KRB5INCS) +COMPAT_LIB = \ + -L$(top_builddir)/lib -lmiscutil \ + $(top_builddir)/compat/libcompat.la + +noinst_LTLIBRARIES = liblog.la +liblog_la_SOURCES = \ + access_log.cc \ + Config.cc \ + Config.h \ + File.cc \ + File.h \ + ModDaemon.cc \ + ModDaemon.h \ + ModStdio.cc \ + ModStdio.h \ + ModSyslog.cc \ + ModSyslog.h \ + ModUdp.cc \ + ModUdp.h \ + ModTcp.cc \ + ModTcp.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(top_srcdir)/src/Common.am $(top_srcdir)/src/TestHeaders.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/log/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/log/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: # $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): # $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +liblog.la: $(liblog_la_OBJECTS) $(liblog_la_DEPENDENCIES) + $(CXXLINK) $(liblog_la_OBJECTS) $(liblog_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/Config.Plo +include ./$(DEPDIR)/File.Plo +include ./$(DEPDIR)/ModDaemon.Plo +include ./$(DEPDIR)/ModStdio.Plo +include ./$(DEPDIR)/ModSyslog.Plo +include ./$(DEPDIR)/ModUdp.Plo +include ./$(DEPDIR)/ModTcp.Plo +include ./$(DEPDIR)/access_log.Plo + +.cc.o: + $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: + $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: + $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +$(OBJS): $(top_srcdir)/include/version.h $(top_builddir)/include/autoconf.h + +testHeaders: $(srcdir)/*.h + $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(srcdir)" || exit 1 + +.PHONY: testHeaders +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -r -u -w -N /root/Toinstall/squid.original/src/log/Makefile.am /root/Toinstall/squid.modtcp/src/log/Makefile.am --- /root/Toinstall/squid.original/src/log/Makefile.am 2010-04-12 20:43:50.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/Makefile.am 2010-04-12 20:55:37.000000000 +0530 @@ -16,4 +16,6 @@ ModSyslog.cc \ ModSyslog.h \ ModUdp.cc \ - ModUdp.h + ModUdp.h \ + ModTcp.cc \ + ModTcp.h diff -r -u -w -N /root/Toinstall/squid.original/src/log/Makefile.in /root/Toinstall/squid.modtcp/src/log/Makefile.in --- /root/Toinstall/squid.original/src/log/Makefile.in 2010-04-12 20:43:50.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/Makefile.in 2010-04-12 20:55:37.000000000 +0530 @@ -47,7 +47,7 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) liblog_la_LIBADD = am_liblog_la_OBJECTS = access_log.lo Config.lo File.lo ModDaemon.lo \ - ModStdio.lo ModSyslog.lo ModUdp.lo + ModStdio.lo ModSyslog.lo ModUdp.lo ModTcp.lo liblog_la_OBJECTS = $(am_liblog_la_OBJECTS) DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp @@ -282,7 +282,9 @@ ModSyslog.cc \ ModSyslog.h \ ModUdp.cc \ - ModUdp.h + ModUdp.h \ + ModTcp.cc \ + ModTcp.h all: all-am @@ -348,6 +350,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModStdio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModSyslog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModUdp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModTcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access_log.Plo@am__quote@ .cc.o: diff -r -u -w -N /root/Toinstall/squid.original/src/log/ModTcp.cc /root/Toinstall/squid.modtcp/src/log/ModTcp.cc --- /root/Toinstall/squid.original/src/log/ModTcp.cc 1970-01-01 05:30:00.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/ModTcp.cc 2010-04-12 21:13:41.000000000 +0530 @@ -0,0 +1,248 @@ +/* + * DEBUG: section 50 Log file handling + * AUTHOR: Dhaval Varia + * Developed based on ModUdp.* Author :Adrian Chadd + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#include "squid.h" +#include "comm.h" +#include "log/File.h" +#include "log/ModTcp.h" +#include "Parsing.h" + +/* + * This logfile TCP module is mostly inspired by a patch by Tim Starling + * from Wikimedia. + * + * It doesn't do any TCP buffering - it'd be quite a bit of work for + * something which the kernel could be doing for you! + */ + +typedef struct { + int fd; + char *buf; + size_t bufsz; + int offset; +} l_tcp_t; + +static void +logfile_mod_tcp_write(Logfile * lf, const char *buf, size_t len) +{ + l_tcp_t *ll = (l_tcp_t *) lf->data; + ssize_t s; + s = write(ll->fd, (char const *) buf, len); + debugs(5, 3, "Dhaval Write Function: buffer :"<fd, s, FD_WRITE); +#if 0 + if (s < 0) { + debugs(1, 1, "logfile (tcp): got errno (" << errno << "):" << xstrerror()); + } + if (s != len) { + debugs(1, 1, "logfile (tcp): len=" << len << ", wrote=" << s); + } +#endif + + /* We don't worry about network errors for now */ +} + +static void +logfile_mod_tcp_flush(Logfile * lf) +{ + l_tcp_t *ll = (l_tcp_t *) lf->data; + if (0 == ll->offset) + return; + logfile_mod_tcp_write(lf, ll->buf, (size_t) ll->offset); + ll->offset = 0; +} + +static void +logfile_mod_tcp_writeline(Logfile * lf, const char *buf, size_t len) +{ + l_tcp_t *ll = (l_tcp_t *) lf->data; + + if (0 == ll->bufsz) { + /* buffering disabled */ + logfile_mod_tcp_write(lf, buf, len); + return; + } + if (ll->offset > 0 && (ll->offset + len + 4) > ll->bufsz) + logfile_mod_tcp_flush(lf); + + if (len > ll->bufsz) { + /* too big to fit in buffer */ + logfile_mod_tcp_write(lf, buf, len); + return; + } + /* buffer it */ + xmemcpy(ll->buf + ll->offset, buf, len); + + ll->offset += len; + + assert(ll->offset >= 0); + + assert((size_t) ll->offset <= ll->bufsz); +} + +static void +logfile_mod_tcp_linestart(Logfile * lf) +{ +} + +static void +logfile_mod_tcp_lineend(Logfile * lf) +{ +} + +static void +logfile_mod_tcp_rotate(Logfile * lf) +{ + return; +} + +static void +logfile_mod_tcp_close(Logfile * lf) +{ + l_tcp_t *ll = (l_tcp_t *) lf->data; + lf->f_flush(lf); + + if (ll->fd >= 0) + file_close(ll->fd); + + if (ll->buf) + xfree(ll->buf); + + xfree(lf->data); + lf->data = NULL; +} + + + +/* + * This code expects the path to be //host:port + */ +int +logfile_mod_tcp_open(Logfile * lf, const char *path, size_t bufsz, int fatal_flag) +{ + //u_short default_port; + //IpAddress default_addr; + debugs(5, 3, "Dhaval from Tcp Open"); + debugs(5, 3, HERE << "Dhaval from Tcp Open"); + IpAddress addr; + + char *strAddr; + + lf->f_close = logfile_mod_tcp_close; + lf->f_linewrite = logfile_mod_tcp_writeline; + lf->f_linestart = logfile_mod_tcp_linestart; + lf->f_lineend = logfile_mod_tcp_lineend; + lf->f_flush = logfile_mod_tcp_flush; + lf->f_rotate = logfile_mod_tcp_rotate; + + l_tcp_t *ll = static_cast(xcalloc(1, sizeof(*ll))); + lf->data = ll; + + if (strncmp(path, "//", 2) == 0) { + path += 2; + } + strAddr = xstrdup(path); + + //addr = default_addr; + //addr.SetPort(default_port); + + if (!GetHostWithPort(strAddr, &addr)) { + if (lf->flags.fatal) { + fatalf("Invalid TCP logging address '%s'\n", lf->path); + } else { + debugs(50, DBG_IMPORTANT, "Invalid TCP logging address '" << lf->path << "'"); + safe_free(strAddr); + return FALSE; + } + } + +debugs(5, 3, HERE << "Dhaval from ModTcp.cc :StrAddr(After) " << strAddr); + + +safe_free(strAddr); + + IpAddress no_addr; + no_addr.SetAnyAddr(); +debugs(5, 3, HERE << "Dhaval from ModTcp.cc :no_addr" << no_addr); +#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 + + ll->fd = comm_open(SOCK_STREAM, IPPROTO_TCP, no_addr, COMM_NONBLOCKING, "TCP log socket"); + if (ll->fd < 0) { + if (lf->flags.fatal) { + fatalf("Unable to open TCP socket for logging\n"); + } else { + debugs(50, DBG_IMPORTANT, "Unable to open TCP socket for logging"); + return FALSE; + } + } else if (!comm_connect_addr(ll->fd, &addr)) { + if (lf->flags.fatal) { + fatalf("Unable to connect to %s for TCP log: %s\n", lf->path, xstrerror()); + } else { + debugs(50, DBG_IMPORTANT, "Unable to connect to " << lf->path << " for TCP log: " << xstrerror()); + return FALSE; + } + } + if (ll->fd == -1) { + if (ENOENT == errno && fatal_flag) { + fatalf("Cannot open '%s' because\n" + "\tthe parent directory does not exist.\n" + "\tPlease create the directory.\n", path); + } else if (EACCES == errno && fatal_flag) { + fatalf("Cannot open '%s' for writing.\n" + "\tThe parent directory must be writeable by the\n" + "\tuser '%s', which is the cache_effective_user\n" + "\tset in squid.conf.", path, Config.effectiveUser); + } else { + debugs(50, DBG_IMPORTANT, "logfileOpen (TCP): " << lf->path << ": " << xstrerror()); + return 0; + } + } + /* Force buffer size to something roughly fitting inside an MTU */ + /* + * XXX note the receive side needs to receive the whole packet at once; + * applications like netcat have a small default receive buffer and will + * truncate! + */ + bufsz = 1400; + if (bufsz > 0) { + ll->buf = static_cast(xmalloc(bufsz)); + ll->bufsz = bufsz; + } + + return 1; +} diff -r -u -w -N /root/Toinstall/squid.original/src/log/ModTcp.cc~ /root/Toinstall/squid.modtcp/src/log/ModTcp.cc~ --- /root/Toinstall/squid.original/src/log/ModTcp.cc~ 1970-01-01 05:30:00.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/ModTcp.cc~ 2010-04-12 20:55:37.000000000 +0530 @@ -0,0 +1,247 @@ +/* + * DEBUG: section 50 Log file handling + * AUTHOR: Adrian Chadd + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#include "squid.h" +#include "comm.h" +#include "log/File.h" +#include "log/ModTcp.h" +#include "Parsing.h" + +/* + * This logfile TCP module is mostly inspired by a patch by Tim Starling + * from Wikimedia. + * + * It doesn't do any TCP buffering - it'd be quite a bit of work for + * something which the kernel could be doing for you! + */ + +typedef struct { + int fd; + char *buf; + size_t bufsz; + int offset; +} l_tcp_t; + +static void +logfile_mod_tcp_write(Logfile * lf, const char *buf, size_t len) +{ + l_tcp_t *ll = (l_tcp_t *) lf->data; + ssize_t s; + s = write(ll->fd, (char const *) buf, len); + debugs(5, 3, "Dhaval Write Function: buffer :"<fd, s, FD_WRITE); +#if 0 + if (s < 0) { + debugs(1, 1, "logfile (tcp): got errno (" << errno << "):" << xstrerror()); + } + if (s != len) { + debugs(1, 1, "logfile (tcp): len=" << len << ", wrote=" << s); + } +#endif + + /* We don't worry about network errors for now */ +} + +static void +logfile_mod_tcp_flush(Logfile * lf) +{ + l_tcp_t *ll = (l_tcp_t *) lf->data; + if (0 == ll->offset) + return; + logfile_mod_tcp_write(lf, ll->buf, (size_t) ll->offset); + ll->offset = 0; +} + +static void +logfile_mod_tcp_writeline(Logfile * lf, const char *buf, size_t len) +{ + l_tcp_t *ll = (l_tcp_t *) lf->data; + + if (0 == ll->bufsz) { + /* buffering disabled */ + logfile_mod_tcp_write(lf, buf, len); + return; + } + if (ll->offset > 0 && (ll->offset + len + 4) > ll->bufsz) + logfile_mod_tcp_flush(lf); + + if (len > ll->bufsz) { + /* too big to fit in buffer */ + logfile_mod_tcp_write(lf, buf, len); + return; + } + /* buffer it */ + xmemcpy(ll->buf + ll->offset, buf, len); + + ll->offset += len; + + assert(ll->offset >= 0); + + assert((size_t) ll->offset <= ll->bufsz); +} + +static void +logfile_mod_tcp_linestart(Logfile * lf) +{ +} + +static void +logfile_mod_tcp_lineend(Logfile * lf) +{ +} + +static void +logfile_mod_tcp_rotate(Logfile * lf) +{ + return; +} + +static void +logfile_mod_tcp_close(Logfile * lf) +{ + l_tcp_t *ll = (l_tcp_t *) lf->data; + lf->f_flush(lf); + + if (ll->fd >= 0) + file_close(ll->fd); + + if (ll->buf) + xfree(ll->buf); + + xfree(lf->data); + lf->data = NULL; +} + + + +/* + * This code expects the path to be //host:port + */ +int +logfile_mod_tcp_open(Logfile * lf, const char *path, size_t bufsz, int fatal_flag) +{ + //u_short default_port; + //IpAddress default_addr; + debugs(5, 3, "Dhaval from Tcp Open"); + debugs(5, 3, HERE << "Dhaval from Tcp Open"); + IpAddress addr; + + char *strAddr; + + lf->f_close = logfile_mod_tcp_close; + lf->f_linewrite = logfile_mod_tcp_writeline; + lf->f_linestart = logfile_mod_tcp_linestart; + lf->f_lineend = logfile_mod_tcp_lineend; + lf->f_flush = logfile_mod_tcp_flush; + lf->f_rotate = logfile_mod_tcp_rotate; + + l_tcp_t *ll = static_cast(xcalloc(1, sizeof(*ll))); + lf->data = ll; + + if (strncmp(path, "//", 2) == 0) { + path += 2; + } + strAddr = xstrdup(path); + + //addr = default_addr; + //addr.SetPort(default_port); + + if (!GetHostWithPort(strAddr, &addr)) { + if (lf->flags.fatal) { + fatalf("Invalid TCP logging address '%s'\n", lf->path); + } else { + debugs(50, DBG_IMPORTANT, "Invalid TCP logging address '" << lf->path << "'"); + safe_free(strAddr); + return FALSE; + } + } + +debugs(5, 3, HERE << "Dhaval from ModTcp.cc :StrAddr(After) " << strAddr); + + +safe_free(strAddr); + + IpAddress no_addr; + no_addr.SetAnyAddr(); +debugs(5, 3, HERE << "Dhaval from ModTcp.cc :no_addr" << no_addr); +#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 + + ll->fd = comm_open(SOCK_STREAM, IPPROTO_TCP, no_addr, COMM_NONBLOCKING, "TCP log socket"); + if (ll->fd < 0) { + if (lf->flags.fatal) { + fatalf("Unable to open TCP socket for logging\n"); + } else { + debugs(50, DBG_IMPORTANT, "Unable to open TCP socket for logging"); + return FALSE; + } + } else if (!comm_connect_addr(ll->fd, &addr)) { + if (lf->flags.fatal) { + fatalf("Unable to connect to %s for TCP log: %s\n", lf->path, xstrerror()); + } else { + debugs(50, DBG_IMPORTANT, "Unable to connect to " << lf->path << " for TCP log: " << xstrerror()); + return FALSE; + } + } + if (ll->fd == -1) { + if (ENOENT == errno && fatal_flag) { + fatalf("Cannot open '%s' because\n" + "\tthe parent directory does not exist.\n" + "\tPlease create the directory.\n", path); + } else if (EACCES == errno && fatal_flag) { + fatalf("Cannot open '%s' for writing.\n" + "\tThe parent directory must be writeable by the\n" + "\tuser '%s', which is the cache_effective_user\n" + "\tset in squid.conf.", path, Config.effectiveUser); + } else { + debugs(50, DBG_IMPORTANT, "logfileOpen (TCP): " << lf->path << ": " << xstrerror()); + return 0; + } + } + /* Force buffer size to something roughly fitting inside an MTU */ + /* + * XXX note the receive side needs to receive the whole packet at once; + * applications like netcat have a small default receive buffer and will + * truncate! + */ + bufsz = 1400; + if (bufsz > 0) { + ll->buf = static_cast(xmalloc(bufsz)); + ll->bufsz = bufsz; + } + + return 1; +} diff -r -u -w -N /root/Toinstall/squid.original/src/log/ModTcp.h /root/Toinstall/squid.modtcp/src/log/ModTcp.h --- /root/Toinstall/squid.original/src/log/ModTcp.h 1970-01-01 05:30:00.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/ModTcp.h 2010-04-12 21:14:24.000000000 +0530 @@ -0,0 +1,43 @@ +/* + * $Id$ + * + * DEBUG: section 50 Log file handling + * AUTHOR: Dhaval Varia + * Developed based on ModUdp.* Author :Adrian Chadd + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ +#ifndef _SQUID_SRC_LOG_MODTCP_H +#define _SQUID_SRC_LOG_MODTCP_H + +#include "config.h" + +class Logfile; + +extern int logfile_mod_tcp_open(Logfile * lf, const char *path, size_t bufsz, int fatal_flag); + +#endif /* _SQUID_SRC_LOG_MODTCP_H */ diff -r -u -w -N /root/Toinstall/squid.original/src/log/ModTcp.h~ /root/Toinstall/squid.modtcp/src/log/ModTcp.h~ --- /root/Toinstall/squid.original/src/log/ModTcp.h~ 1970-01-01 05:30:00.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/ModTcp.h~ 2010-04-12 20:55:37.000000000 +0530 @@ -0,0 +1,43 @@ +/* + * $Id$ + * + * DEBUG: section 50 Log file handling + * AUTHOR: Adrian Chadd + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ +#ifndef _SQUID_SRC_LOG_MODTCP_H +#define _SQUID_SRC_LOG_MODTCP_H + +#include "config.h" + +class Logfile; + +extern int logfile_mod_tcp_open(Logfile * lf, const char *path, size_t bufsz, int fatal_flag); + +#endif /* _SQUID_SRC_LOG_MODTCP_H */ diff -r -u -w -N /root/Toinstall/squid.original/src/log/ModUdp.cc /root/Toinstall/squid.modtcp/src/log/ModUdp.cc --- /root/Toinstall/squid.original/src/log/ModUdp.cc 2010-04-12 20:53:18.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/ModUdp.cc 2010-04-12 21:15:07.000000000 +0530 @@ -148,6 +148,8 @@ int logfile_mod_udp_open(Logfile * lf, const char *path, size_t bufsz, int fatal_flag) { + + IpAddress addr; char *strAddr; @@ -174,6 +176,8 @@ return FALSE; } } + + safe_free(strAddr); IpAddress no_addr; @@ -193,7 +197,8 @@ debugs(50, DBG_IMPORTANT, "Unable to open UDP socket for logging"); return FALSE; } - } else if (comm_connect_addr(ll->fd, &addr)) { +//Changes Made By :Dhaval Varia + } else if (!comm_connect_addr(ll->fd, &addr)) { if (lf->flags.fatal) { fatalf("Unable to connect to %s for UDP log: %s\n", lf->path, xstrerror()); } else { diff -r -u -w -N /root/Toinstall/squid.original/src/log/ModUdp.cc~ /root/Toinstall/squid.modtcp/src/log/ModUdp.cc~ --- /root/Toinstall/squid.original/src/log/ModUdp.cc~ 2010-04-12 20:47:04.000000000 +0530 +++ /root/Toinstall/squid.modtcp/src/log/ModUdp.cc~ 2010-04-12 21:14:46.000000000 +0530 @@ -148,6 +148,8 @@ int logfile_mod_udp_open(Logfile * lf, const char *path, size_t bufsz, int fatal_flag) { + + IpAddress addr; char *strAddr; @@ -174,6 +176,8 @@ return FALSE; } } + + safe_free(strAddr); IpAddress no_addr;