From dc4949305da584176b447c01595a72d6edaaa3c0 Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Wed, 30 Jul 2014 16:27:50 -0700 Subject: [PATCH] ignore bad json lines Defect Number: Reviewed By: Testing Done: --- Makefile.in | 5 +++-- aclocal.m4 | 6 +++--- src/Makefile.in | 2 +- src/log_format.cc | 13 ++++++++----- test/Makefile.in | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Makefile.in b/Makefile.in index 42d0ecd6..c58ba3f9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -680,9 +680,10 @@ distcheck: dist && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ diff --git a/aclocal.m4 b/aclocal.m4 index 18cadc48..9fa0debb 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.14 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,7 +51,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff --git a/src/Makefile.in b/src/Makefile.in index a494aba5..0510a505 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. diff --git a/src/log_format.cc b/src/log_format.cc index 93468cd1..68b1c14f 100644 --- a/src/log_format.cc +++ b/src/log_format.cc @@ -927,12 +927,15 @@ void external_log_format::get_subline(const logline &ll, shared_buffer_ref &sbr) this->jlf_cached_offset = ll.get_offset(); } - off_t this_off, next_off; + off_t this_off = 0, next_off = 0; - this_off = this->jlf_line_offsets[ll.get_sub_offset()]; - if (this->jlf_cached_line[this_off] == '\n') - this_off += 1; - next_off = this->jlf_line_offsets[ll.get_sub_offset() + 1]; + if (!this->jlf_line_offsets.empty()) { + this_off = this->jlf_line_offsets[ll.get_sub_offset()]; + if (this->jlf_cached_line[this_off] == '\n') { + this_off += 1; + } + next_off = this->jlf_line_offsets[ll.get_sub_offset() + 1]; + } sbr.share(this->jlf_share_manager, (char *)this->jlf_cached_line.c_str() + this_off, diff --git a/test/Makefile.in b/test/Makefile.in index 7395a02d..b35a112a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc.