Hello community, here is the log from the commit of package goaccess for openSUSE:Factory checked in at 2020-12-04 21:29:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/goaccess (Old) and /work/SRC/openSUSE:Factory/.goaccess.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "goaccess" Fri Dec 4 21:29:15 2020 rev:8 rq:853059 version:1.4.3 Changes: -------- --- /work/SRC/openSUSE:Factory/goaccess/goaccess.changes 2020-11-17 21:25:15.589376284 +0100 +++ /work/SRC/openSUSE:Factory/.goaccess.new.5913/goaccess.changes 2020-12-04 21:29:16.910193180 +0100 @@ -1,0 +2,12 @@ +Fri Dec 4 08:53:27 UTC 2020 - Michael Vetter <[email protected]> + +- Update to 1.4.3: + * Added the ability to set how often goaccess will parse data and output to + the HTML report via '--html-refresh=<secs>'. + * Changed how TLS is parsed so the Cypher uses a separate specifier. + It now uses '%K' for the TLS version and '%k' for the Cypher. + * Fixed issue where real-time output would double count a rotated log. This + was due to the change of inode upon rotating the log. + * Updated man page to reflect proper way of 'tail -f' a remote access log. + +------------------------------------------------------------------- Old: ---- goaccess-1.4.2.tar.gz New: ---- goaccess-1.4.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ goaccess.spec ++++++ --- /var/tmp/diff_new_pack.wohc5j/_old 2020-12-04 21:29:17.506194035 +0100 +++ /var/tmp/diff_new_pack.wohc5j/_new 2020-12-04 21:29:17.510194041 +0100 @@ -19,7 +19,7 @@ Name: goaccess -Version: 1.4.2 +Version: 1.4.3 Release: 0 Summary: Apache Web Log Analyzer License: GPL-2.0-or-later ++++++ goaccess-1.4.2.tar.gz -> goaccess-1.4.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/ChangeLog new/goaccess-1.4.3/ChangeLog --- old/goaccess-1.4.2/ChangeLog 2020-11-16 00:27:36.000000000 +0100 +++ new/goaccess-1.4.3/ChangeLog 2020-12-04 02:57:02.000000000 +0100 @@ -1,12 +1,22 @@ +Changes to GoAccess 1.4.3 - Friday, December 04, 2020 + + - Added the ability to set how often goaccess will parse data and output to + the HTML report via '--html-refresh=<secs>'. + - Changed how TLS is parsed so the Cypher uses a separate specifier than the + TLS version. It now uses '%K' for the TLS version and '%k' for the Cypher. + - Fixed issue where real-time output would double count a rotated log. This + was due to the change of inode upon rotating the log. + - Updated man page to reflect proper way of 'tail -f' a remote access log. + Changes to GoAccess 1.4.2 - Monday, November 16, 2020 - - Added the ability to show 'Encryption Settings' such as ' TLSv1.2' and + - Added the ability to show 'Encryption Settings' such as 'TLSv1.2' and Cipher Suites on its own panel. - - Added the ability to show 'MIME Types' such as ' application/javascript' on + - Added the ability to show 'MIME Types' such as 'application/javascript' on its own panel. - Changed Debian build to use mmdb instead of libgeoip (legacy). - Ensure the HTML report defaults to widescreen if viewport is larger than - '2560'. + '2560px'. - Fixed inability to properly process multiple logs in real-time. - Fixed issue where named PIPEs were not properly seed upon generating filename. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/NEWS new/goaccess-1.4.3/NEWS --- old/goaccess-1.4.2/NEWS 2020-11-16 00:18:07.000000000 +0100 +++ new/goaccess-1.4.3/NEWS 2020-12-04 02:38:38.000000000 +0100 @@ -2,6 +2,8 @@ Gerardo Orellana <[email protected]> * Version history: + - 1.4.3 [Friday, December 04, 2020] + . GoAccess 1.4.3 Released. See ChangeLog for new features/bug-fixes. - 1.4.2 [Monday, November 16, 2020] . GoAccess 1.4.2 Released. See ChangeLog for new features/bug-fixes. - 1.4.1 [Monday, November 09, 2020] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/configure new/goaccess-1.4.3/configure --- old/goaccess-1.4.2/configure 2020-11-15 21:54:12.000000000 +0100 +++ new/goaccess-1.4.3/configure 2020-12-03 04:38:44.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for goaccess 1.4.2. +# Generated by GNU Autoconf 2.69 for goaccess 1.4.3. # # Report bugs to <[email protected]>. # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='goaccess' PACKAGE_TARNAME='goaccess' -PACKAGE_VERSION='1.4.2' -PACKAGE_STRING='goaccess 1.4.2' +PACKAGE_VERSION='1.4.3' +PACKAGE_STRING='goaccess 1.4.3' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='https://goaccess.io' @@ -1320,7 +1320,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures goaccess 1.4.2 to adapt to many kinds of systems. +\`configure' configures goaccess 1.4.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1390,7 +1390,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of goaccess 1.4.2:";; + short | recursive ) echo "Configuration of goaccess 1.4.3:";; esac cat <<\_ACEOF @@ -1500,7 +1500,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -goaccess configure 1.4.2 +goaccess configure 1.4.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2053,7 +2053,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by goaccess $as_me 1.4.2, which was +It was created by goaccess $as_me 1.4.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2920,7 +2920,7 @@ # Define the identity of the package. PACKAGE='goaccess' - VERSION='1.4.2' + VERSION='1.4.3' cat >>confdefs.h <<_ACEOF @@ -9551,7 +9551,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by goaccess $as_me 1.4.2, which was +This file was extended by goaccess $as_me 1.4.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9618,7 +9618,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -goaccess config.status 1.4.2 +goaccess config.status 1.4.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/configure.ac new/goaccess-1.4.3/configure.ac --- old/goaccess-1.4.2/configure.ac 2020-11-15 21:53:25.000000000 +0100 +++ new/goaccess-1.4.3/configure.ac 2020-12-03 04:07:00.000000000 +0100 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([goaccess],[1.4.2],[[email protected]],[],[https://goaccess.io]) +AC_INIT([goaccess],[1.4.3],[[email protected]],[],[https://goaccess.io]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/goaccess.c]) AC_CONFIG_HEADERS([src/config.h]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/goaccess.1 new/goaccess-1.4.3/goaccess.1 --- old/goaccess-1.4.2/goaccess.1 2020-11-16 00:16:07.000000000 +0100 +++ new/goaccess-1.4.3/goaccess.1 2020-12-04 02:35:54.000000000 +0100 @@ -311,6 +311,10 @@ \fB\-\-html-report-title=<title> Set HTML report page title and header. .TP +\fB\-\-html-refresh=<secs> +Refresh the HTML report every X seconds. The value has to be between 1 and 60 +seconds. The default is set to refresh the HTML report every 1 second. +.TP \fB\-\-html-prefs=<JSON> Set HTML report default preferences. Supply a valid JSON object containing the HTML preferences. It allows the ability to customize each panel plot. See @@ -831,7 +835,9 @@ .IP %u The user-agent HTTP request header. .IP %K -The TLS encryption settings chosen for the connection. (In Apache LogFormat: %{SSL_PROTOCOL}x %{SSL_CIPHER}x) +The TLS encryption settings chosen for the connection. (In Apache LogFormat: %{SSL_PROTOCOL}x) +.IP %k +The TLS encryption settings chosen for the connection. (In Apache LogFormat: %{SSL_CIPHER}x) .IP %M The MIME-type of the requested resource. (In Apache LogFormat: %{Content-Type}o) .IP %D @@ -1089,7 +1095,12 @@ and if you don't want to install it on your server, you can still run it from your local machine: .IP -# ssh root@server 'cat /var/log/apache2/access.log' | goaccess -a - +# ssh -n root@server 'tail -f /var/log/apache2/access.log' | goaccess - +.P +Note: SSH requires +.I -n +so GoAccess can read from stdin. Also, make sure to use SSH keys for +authentication as it won't work if a passphrase is required. .SS INCREMENTAL LOG PROCESSING .P diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/de.po new/goaccess-1.4.3/po/de.po --- old/goaccess-1.4.2/po/de.po 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/de.po 2020-12-04 03:00:38.000000000 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: 2019-05-05 16:03+0200\n" "Last-Translator: Axel Wehner <[email protected]>\n" "Language: de\n" @@ -759,7 +759,7 @@ #: src/labels.h:430 #, fuzzy msgid "308 - Permanent Redirect" -msgstr "402 - Zahlung erforderlich" +msgstr "402 - Dauerhafte Umleitung" #: src/labels.h:432 msgid "400 - Bad Request: The syntax of the request is invalid" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/es.po new/goaccess-1.4.3/po/es.po --- old/goaccess-1.4.2/po/es.po 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/es.po 2020-12-04 03:00:38.000000000 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Goaccess\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: 2017-08-04 13:00-0300\n" "Last-Translator: Enrique Becerra <[email protected]>\n" "Language-Team: \n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/fr.po new/goaccess-1.4.3/po/fr.po --- old/goaccess-1.4.2/po/fr.po 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/fr.po 2020-12-04 03:00:38.000000000 +0100 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: goaccess 1.4\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: 2020-07-10 11:44+0200\n" "Last-Translator: Coban L. <[email protected]>\n" "Language-Team: français\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/goaccess.pot new/goaccess-1.4.3/po/goaccess.pot --- old/goaccess-1.4.2/po/goaccess.pot 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/goaccess.pot 2020-12-04 03:00:38.000000000 +0100 @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: goaccess 1.4.2\n" +"Project-Id-Version: goaccess 1.4.3\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <[email protected]>\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/ja.po new/goaccess-1.4.3/po/ja.po --- old/goaccess-1.4.2/po/ja.po 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/ja.po 2020-12-04 03:00:38.000000000 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: goaccess 1.3\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: 2020-08-19 06:27+0900\n" "Last-Translator: Kamino <[email protected]>\n" "Language-Team: Japanese\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/pt_BR.po new/goaccess-1.4.3/po/pt_BR.po --- old/goaccess-1.4.2/po/pt_BR.po 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/pt_BR.po 2020-12-04 03:00:39.000000000 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Goaccess\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: 2019-04-25 20:34-0300\n" "Last-Translator: Alan Placidina Maria <[email protected]>\n" "Language-Team: \n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/ru.po new/goaccess-1.4.3/po/ru.po --- old/goaccess-1.4.2/po/ru.po 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/ru.po 2020-12-04 03:00:39.000000000 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: goaccess 1.4\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: 2020-06-25 17:14+0300\n" "Last-Translator: Artyom Karlov <[email protected]>\n" "Language-Team: \n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/sv.po new/goaccess-1.4.3/po/sv.po --- old/goaccess-1.4.2/po/sv.po 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/sv.po 2020-12-04 03:00:39.000000000 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: goaccess 1.3\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: 2018-12-13 22:48-0600\n" "Last-Translator: Anders Johansson <[email protected]>\n" "Language-Team: none\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/uk.po new/goaccess-1.4.3/po/uk.po --- old/goaccess-1.4.2/po/uk.po 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/uk.po 2020-12-04 03:00:39.000000000 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: goaccess 1.4\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: 2020-06-25 17:12+0300\n" "Last-Translator: Artyom Karlov <[email protected]>\n" "Language-Team: \n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/po/zh_CN.po new/goaccess-1.4.3/po/zh_CN.po --- old/goaccess-1.4.2/po/zh_CN.po 2020-11-16 00:29:17.000000000 +0100 +++ new/goaccess-1.4.3/po/zh_CN.po 2020-12-04 03:00:39.000000000 +0100 @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: goaccess 1.2\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2020-11-15 17:29-0600\n" +"POT-Creation-Date: 2020-12-03 20:00-0600\n" "PO-Revision-Date: 2017-04-03 09:43+0200\n" "Last-Translator: Ai<[email protected]>\n" "Language-Team: Ai\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/base64.c new/goaccess-1.4.3/src/base64.c --- old/goaccess-1.4.2/src/base64.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/base64.c 2020-12-04 02:19:31.000000000 +0100 @@ -32,6 +32,7 @@ #include <string.h> #include "base64.h" +#include "xmalloc.h" /* Encodes the given data with base64.. * @@ -41,7 +42,7 @@ static const char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - char *str = (char *) malloc ((size + 3) * 4 / 3 + 1); + char *str = (char *) xmalloc ((size + 3) * 4 / 3 + 1); char *p = str; const unsigned char *q = (const unsigned char *) buf; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/bin2c.c new/goaccess-1.4.3/src/bin2c.c --- old/goaccess-1.4.2/src/bin2c.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/bin2c.c 2020-12-04 02:19:31.000000000 +0100 @@ -22,7 +22,9 @@ main (int argc, char *argv[]) { char *buf; char *ident; - unsigned int i, file_size, need_comma; + int need_comma; + long file_size_orig; + size_t file_size, i; FILE *f_input, *f_output; #ifdef USE_BZ2 @@ -43,7 +45,13 @@ } // Get the file length fseek (f_input, 0, SEEK_END); - file_size = ftell (f_input); + file_size_orig = ftell (f_input); + if (file_size_orig < 0) { + fprintf (stderr, "%s: can't get size of file %s\n", argv[0], argv[1]); + fclose (f_input); + return -1; + } + file_size = (size_t) file_size_orig; fseek (f_input, 0, SEEK_SET); if ((buf = malloc (file_size)) == NULL) { @@ -52,7 +60,7 @@ return -1; } - if (fread (buf, file_size, 1, f_input) == 0) { + if (fread (buf, file_size, 1, f_input) != 1) { fprintf (stderr, "%s: can't read from %s\n", argv[0], argv[1]); free (buf); fclose (f_input); @@ -109,7 +117,7 @@ ident = argv[3]; need_comma = 0; - fprintf (f_output, "const char %s[%u] = {", ident, file_size); + fprintf (f_output, "const char %s[%lu] = {", ident, file_size); for (i = 0; i < file_size; ++i) { if (buf[i] == '\0') { fprintf (stderr, @@ -127,7 +135,7 @@ fprintf (f_output, "0x%.2x", buf[i] & 0xff); } fprintf (f_output, "\n};\n\n"); - fprintf (f_output, "const int %s_length = %u;\n", ident, file_size); + fprintf (f_output, "const int %s_length = %lu;\n", ident, file_size); #ifdef USE_BZ2 fprintf (f_output, "const int %s_length_uncompressed = %u;\n", ident, uncompressed_size); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/browsers.c new/goaccess-1.4.3/src/browsers.c --- old/goaccess-1.4.2/src/browsers.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/browsers.c 2020-12-04 02:19:31.000000000 +0100 @@ -508,7 +508,7 @@ match = char_replace (match, ' ', '/'); } /* all others */ - else if ((ptr = strpbrk (b, ";) ")) != NULL) { + else if ((ptr = strpbrk (b ? b : match, ";) ")) != NULL) { *ptr = '\0'; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/color.c new/goaccess-1.4.3/src/color.c --- old/goaccess-1.4.2/src/color.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/color.c 2020-12-04 02:19:31.000000000 +0100 @@ -705,7 +705,7 @@ } } -/* Parse a color definition line from the config file and store it on a signle +/* Parse a color definition line from the config file and store it on a single * linked-list. * * On error, it aborts. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/commons.h new/goaccess-1.4.3/src/commons.h --- old/goaccess-1.4.2/src/commons.h 2020-11-15 21:53:25.000000000 +0100 +++ new/goaccess-1.4.3/src/commons.h 2020-12-04 02:19:31.000000000 +0100 @@ -43,7 +43,7 @@ #define __attribute__(x) /**/ #endif #define GO_UNUSED __attribute__((unused)) -#define GO_VERSION "1.4.2" +#define GO_VERSION "1.4.3" #define GO_WEBSITE "https://goaccess.io/" extern struct tm now_tm; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/error.c new/goaccess-1.4.3/src/error.c --- old/goaccess-1.4.2/src/error.c 2020-11-15 21:53:25.000000000 +0100 +++ new/goaccess-1.4.3/src/error.c 2020-12-04 02:19:31.000000000 +0100 @@ -101,10 +101,8 @@ if (path == NULL) return 0; - if (access (path, F_OK) != -1) - access_log = fopen (path, "a"); - else - access_log = fopen (path, "w"); + access_log = fopen (path, "a"); + if (access_log == NULL) return 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/gdns.c new/goaccess-1.4.3/src/gdns.c --- old/goaccess-1.4.2/src/gdns.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/gdns.c 2020-12-04 02:19:31.000000000 +0100 @@ -107,12 +107,13 @@ * If the queue is full, -1 is returned. * If added to the queue, 0 is returned. */ int -gqueue_enqueue (GDnsQueue * q, char *item) { +gqueue_enqueue (GDnsQueue * q, const char *item) { if (gqueue_full (q)) return -1; q->tail = (q->tail + 1) % q->capacity; - strcpy (q->buffer[q->tail], item); + strncpy (q->buffer[q->tail], item, sizeof (q->buffer[q->tail])); + q->buffer[q->tail][sizeof (q->buffer[q->tail]) - 1] = '\0'; q->size++; return 0; } @@ -224,9 +225,9 @@ pthread_mutex_lock (&gdns_thread.mutex); if (!active_gdns) { - if (host) - free (host); - break; + pthread_mutex_unlock (&gdns_thread.mutex); + free (host); + return; } /* insert the corresponding IP -> hostname map */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/gdns.h new/goaccess-1.4.3/src/gdns.h --- old/goaccess-1.4.2/src/gdns.h 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/gdns.h 2020-12-04 02:19:31.000000000 +0100 @@ -53,7 +53,7 @@ char *gqueue_dequeue (GDnsQueue * q); char *reverse_ip (char *str); int gqueue_empty (GDnsQueue * q); -int gqueue_enqueue (GDnsQueue * q, char *item); +int gqueue_enqueue (GDnsQueue * q, const char *item); int gqueue_find (GDnsQueue * q, const char *item); int gqueue_full (GDnsQueue * q); int gqueue_size (GDnsQueue * q); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/geoip2.c new/goaccess-1.4.3/src/geoip2.c --- old/goaccess-1.4.2/src/geoip2.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/geoip2.c 2020-12-04 02:19:31.000000000 +0100 @@ -210,6 +210,8 @@ region = get_value (res, "subdivisions", "0", "names", "en", NULL); } geoip_set_city (city, region, location); + free (city); + free (region); } /* A wrapper to fetch the looked up result and set the country and code. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/gholder.c new/goaccess-1.4.3/src/gholder.c --- old/goaccess-1.4.2/src/gholder.c 2020-11-15 21:52:43.000000000 +0100 +++ new/goaccess-1.4.3/src/gholder.c 2020-12-04 02:19:31.000000000 +0100 @@ -191,14 +191,7 @@ free_holder_data (GHolderItem item) { if (item.sub_list != NULL) delete_sub_list (item.sub_list); - if (item.metrics->data != NULL) - free (item.metrics->data); - if (item.metrics->method != NULL) - free (item.metrics->method); - if (item.metrics->protocol != NULL) - free (item.metrics->protocol); - if (item.metrics != NULL) - free (item.metrics); + free_gmetrics (item.metrics); } /* Free all memory allocated in holder for a given module. */ @@ -305,8 +298,14 @@ add_sub_item_back (sub_list, h->module, arr[k].metrics); h->items[i].sub_list = sub_list; + sub_list = NULL; } + free (arr); + if (sub_list) { + delete_sub_list (sub_list); + sub_list = NULL; + } } } @@ -584,8 +583,7 @@ return; if (!(root = ht_get_root (h->module, item.nkey))) { - free (nmetrics->data); - free (nmetrics); + free_gmetrics (nmetrics); return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/gkhash.c new/goaccess-1.4.3/src/gkhash.c --- old/goaccess-1.4.2/src/gkhash.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/gkhash.c 2020-12-04 02:19:31.000000000 +0100 @@ -1081,8 +1081,10 @@ } k = kh_put (igsl, hash, key, &ret); - if (ret == -1) + if (ret == -1) { + list_remove_nodes (list); return -1; + } kh_val (hash, k) = list; @@ -1753,6 +1755,7 @@ char *path = NULL; uint32_t date, idx = 0; char fmt[] = "A(u)"; + int len; if (!(path = check_restore_path ("I32_DATES.db"))) return; @@ -1760,7 +1763,10 @@ tn = tpl_map (fmt, &date); tpl_load (tn, TPL_FILE, path); - persisted_dates_len = tpl_Alen (tn, 1); + len = tpl_Alen (tn, 1); + if (len < 0) + return; + persisted_dates_len = len; persisted_dates = xcalloc (persisted_dates_len, sizeof (uint32_t)); while (tpl_unpack (tn, 1) > 0) persisted_dates[idx++] = date; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/goaccess.c new/goaccess-1.4.3/src/goaccess.c --- old/goaccess-1.4.2/src/goaccess.c 2020-11-15 21:53:25.000000000 +0100 +++ new/goaccess-1.4.3/src/goaccess.c 2020-12-04 02:19:31.000000000 +0100 @@ -768,11 +768,29 @@ } } +static void +verify_inode (FILE * fp, GLog * glog) { + struct stat fdstat; + + if (stat (glog->filename, &fdstat) == -1) + FATAL ("Unable to stat the specified log file '%s'. %s", glog->filename, strerror (errno)); + + glog->size = fdstat.st_size; + /* Either the log got smaller, probably was truncated so start reading from 0 + * and reset snippet. + * If the log changed its inode, more likely the log was rotated, so we set + * the initial snippet for the new log for future iterations */ + if (fdstat.st_ino != glog->inode || glog->snippet[0] == '\0' || 0 == glog->size) { + glog->length = glog->bytes = 0; + set_initial_persisted_data (glog, fp, glog->filename); + } + glog->inode = fdstat.st_ino; +} + /* Process appended log data */ static void perform_tail_follow (GLog * glog) { FILE *fp = NULL; - struct stat fdstat; char buf[READ_BYTES + 1] = { 0 }; uint16_t len = 0; uint64_t length = 0; @@ -796,20 +814,15 @@ if (!(fp = fopen (glog->filename, "r"))) FATAL ("Unable to read the specified log file '%s'. %s", glog->filename, strerror (errno)); - /* insert the inode of the file parsed and the last line parsed */ - if (stat (glog->filename, &fdstat) == 0) { - glog->inode = fdstat.st_ino; - glog->size = fdstat.st_size; - } + verify_inode (fp, glog); len = MIN (glog->snippetlen, length); - /* This is not ideal, but maybe the only way reliable way to know if the + /* This is not ideal, but maybe the only reliable way to know if the * current log looks different than our first read/parse */ if ((fread (buf, len, 1, fp)) != 1 && ferror (fp)) FATAL ("Unable to fread the specified log file '%s'", glog->filename); - /* Either the log got smaller, probably was truncated so start reading from 0. - * For the case where the log got larger since the last iteration, we attempt + /* For the case where the log got larger since the last iteration, we attempt * to compare the first READ_BYTES against the READ_BYTES we had since the last * parse. If it's different, then it means the file may got truncated but grew * faster than the last iteration (odd, but possible), so we read from 0* */ @@ -825,24 +838,25 @@ /* insert the inode of the file parsed and the last line parsed */ if (glog->inode) { glog->lp.line = glog->read; - glog->lp.size = fdstat.st_size; + glog->lp.size = glog->size; ht_insert_last_parse (glog->inode, glog->lp); } out: - if (!conf.output_stdout) + if (!conf.output_stdout) { tail_term (); - else + usleep (200000); /* 0.2 seconds */ + } else { tail_html (); - - usleep (200000); /* 0.2 seconds */ + } } /* Entry point to start processing the HTML output */ static void process_html (const char *filename) { int i = 0; + uint64_t intval = conf.html_refresh ? conf.html_refresh : HTML_REFRESH; /* render report */ pthread_mutex_lock (&gdns_thread.mutex); @@ -870,7 +884,7 @@ for (i = 0; i < logs->size; ++i) perform_tail_follow (&logs->glog[i]); /* 0.2 secs */ - usleep (800000); /* 0.8 secs */ + usleep (intval); /* 0.8 secs */ } close (gwswriter->fd); } @@ -1362,8 +1376,9 @@ static char * generate_fifo_name (void) { char fname[RAND_FN]; - const char *tmp = NULL; - char *path = NULL; + const char *tmp; + char *path; + size_t len; if ((tmp = getenv ("TMPDIR")) == NULL) tmp = "/tmp"; @@ -1371,8 +1386,9 @@ memset (fname, 0, sizeof (fname)); genstr (fname, RAND_FN - 1); - path = xmalloc (snprintf (NULL, 0, "%s/goaccess_fifo_%s", tmp, fname) + 1); - sprintf (path, "%s/goaccess_fifo_%s", tmp, fname); + len = snprintf (NULL, 0, "%s/goaccess_fifo_%s", tmp, fname) + 1; + path = xmalloc (len); + snprintf (path, len, "%s/goaccess_fifo_%s", tmp, fname); return path; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/gstorage.c new/goaccess-1.4.3/src/gstorage.c --- old/goaccess-1.4.2/src/gstorage.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/gstorage.c 2020-12-04 02:19:31.000000000 +0100 @@ -52,6 +52,18 @@ return metrics; } +/* Free memory of a GMetrics object */ +void +free_gmetrics (GMetrics * metric) { + if (metric == NULL) + return; + + free (metric->data); + free (metric->method); + free (metric->protocol); + free (metric); +} + /* Get the module string value given a metric enum value. * * On error, NULL is returned. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/gstorage.h new/goaccess-1.4.3/src/gstorage.h --- old/goaccess-1.4.2/src/gstorage.h 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/gstorage.h 2020-12-04 02:19:31.000000000 +0100 @@ -61,6 +61,7 @@ } GSMetric; GMetrics *new_gmetrics (void); +void free_gmetrics (GMetrics * metric); uint32_t *i322ptr (uint32_t val); uint64_t *uint642ptr (uint64_t val); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/json.c new/goaccess-1.4.3/src/json.c --- old/goaccess-1.4.2/src/json.c 2020-11-15 21:52:43.000000000 +0100 +++ new/goaccess-1.4.3/src/json.c 2020-12-04 02:19:31.000000000 +0100 @@ -1001,7 +1001,7 @@ } } -/* Ouput Geolocation data and the IP's hostname. */ +/* Output Geolocation data and the IP's hostname. */ static void print_json_host_items (GJSON * json, GHolderItem * item, GPercTotals totals, int size, int iisp) { @@ -1015,7 +1015,7 @@ process_host_agents (json, item, iisp); } -/* Ouput data and determine if there are children nodes. */ +/* Output data and determine if there are children nodes. */ static void print_data_metrics (GJSON * json, GHolder * h, GPercTotals totals, int sp, const struct GPanel_ *panel) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/khash.h new/goaccess-1.4.3/src/khash.h --- old/goaccess-1.4.2/src/khash.h 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/khash.h 2020-12-04 02:19:31.000000000 +0100 @@ -624,7 +624,7 @@ code; \ } } -/* More conenient interfaces */ +/* More convenient interfaces */ /*! @function @abstract Instantiate a hash set containing integer keys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/options.c new/goaccess-1.4.3/src/options.c --- old/goaccess-1.4.2/src/options.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/options.c 2020-12-04 02:19:31.000000000 +0100 @@ -111,6 +111,7 @@ {"invalid-requests" , required_argument , 0 , 0 } , {"json-pretty-print" , no_argument , 0 , 0 } , {"keep-last" , required_argument , 0 , 0 } , + {"html-refresh" , required_argument , 0 , 0 } , {"log-format" , required_argument , 0 , 0 } , {"max-items" , required_argument , 0 , 0 } , {"no-color" , no_argument , 0 , 0 } , @@ -175,6 +176,7 @@ " --html-custom-js=<path.js> - Specify a custom JS file in the HTML report.\n" " --html-prefs=<json_obj> - Set default HTML report preferences.\n" " --html-report-title=<title> - Set HTML report page title and header.\n" + " --html-refresh=<secs> - Refresh HTML report every X seconds (>=1 or <=60).\n" " --json-pretty-print - Format JSON output w/ tabs & newlines.\n" " --max-items - Maximum number of items to show per panel. See man page for limits.\n" " --no-color - Disable colored output.\n" @@ -546,6 +548,15 @@ conf.keep_last = keeplast >= 0 ? keeplast : 0; } + /* refresh html every X seconds */ + if (!strcmp ("html-refresh", name)) { + char *sEnd; + uint64_t ref = strtoull (oarg, &sEnd, 10); + if (oarg == sEnd || *sEnd != '\0' || errno == ERANGE) + return; + conf.html_refresh = ref >= 1 && ref <= 60 ? 1000000 * ref : 0; + } + /* specifies the path of the database file */ if (!strcmp ("db-path", name)) conf.db_path = oarg; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/options.h new/goaccess-1.4.3/src/options.h --- old/goaccess-1.4.2/src/options.h 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/options.h 2020-12-04 02:19:31.000000000 +0100 @@ -32,6 +32,7 @@ #define CYN "\x1B[36m" #define RESET "\x1B[0m" +#define HTML_REFRESH 1000000 /* 1s */ void add_dash_filename (void); void cmd_help (void) __attribute__((noreturn)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/parser.c new/goaccess-1.4.3/src/parser.c --- old/goaccess-1.4.2/src/parser.c 2020-11-15 21:54:03.000000000 +0100 +++ new/goaccess-1.4.3/src/parser.c 2020-12-04 02:25:48.000000000 +0100 @@ -532,6 +532,8 @@ /* UMS */ logitem->mime_type = NULL; logitem->tls_type = NULL; + logitem->tls_cypher = NULL; + logitem->tls_type_cypher = NULL; memset (logitem->site, 0, sizeof (logitem->site)); localtime_r (&now, &logitem->dt); @@ -593,6 +595,10 @@ free (logitem->mime_type); if (logitem->tls_type != NULL) free (logitem->tls_type); + if (logitem->tls_cypher != NULL) + free (logitem->tls_cypher); + if (logitem->tls_type_cypher != NULL) + free (logitem->tls_type_cypher); free (logitem); } @@ -683,8 +689,10 @@ *ptr = '\0'; referer = decode_url (r); - if (referer == NULL || *referer == '\0') + if (referer == NULL || *referer == '\0') { + free (referer); return 1; + } referer = char_replace (referer, '+', ' '); *keyphrase = trim_str (referer); @@ -1227,8 +1235,10 @@ if (logitem->req) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); tkn = parse_string (&(*str), end, 1); - if (tkn == NULL || *tkn == '\0') + if (tkn == NULL || *tkn == '\0') { + free (tkn); return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); + } if ((logitem->req = decode_url (tkn)) == NULL) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); @@ -1242,8 +1252,10 @@ if (logitem->qstr) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); tkn = parse_string (&(*str), end, 1); - if (tkn == NULL || *tkn == '\0') + if (tkn == NULL || *tkn == '\0') { + free (tkn); return 0; + } if ((logitem->qstr = decode_url (tkn)) == NULL) { spec_err (logitem, SPEC_TOKN_INV, *p, tkn); @@ -1409,17 +1421,28 @@ free (tkn); break; - /* UMS: Krypto (TLS) parameters like "TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256" */ + /* UMS: Krypto (TLS) "ECDHE-RSA-AES128-GCM-SHA256" */ + case 'k': + /* error to set this twice */ + if (logitem->tls_cypher) + return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); + + if (!(tkn = parse_string (&(*str), end, 1))) + return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); + + logitem->tls_cypher = tkn; + break; + + /* UMS: Krypto (TLS) parameters like "TLSv1.2" */ case 'K': /* error to set this twice */ if (logitem->tls_type) return spec_err (logitem, SPEC_TOKN_SET, *p, NULL); - if (!(tkn = parse_string (&(*str), end, 2))) + if (!(tkn = parse_string (&(*str), end, 1))) return spec_err (logitem, SPEC_TOKN_NUL, *p, NULL); logitem->tls_type = tkn; - break; /* UMS: Mime-Type like "text/html" */ @@ -2147,7 +2170,10 @@ */ static int gen_req_key (GKeyData * kdata, GLogItem * logitem) { - if (logitem->req && logitem->qstr) + if (!logitem->req) + return 1; + + if (logitem->qstr) append_query_string (&logitem->req, logitem->qstr); logitem->req_key = gen_unique_req_key (logitem); @@ -2385,12 +2411,12 @@ extract_tlsmajor (const char *token) { const char *lookfor; - if ((lookfor = "SSLv3", strstr (token, lookfor)) || - (lookfor = "TLSv1.1", strstr (token, lookfor)) || - (lookfor = "TLSv1.2", strstr (token, lookfor)) || - (lookfor = "TLSv1.3", strstr (token, lookfor)) || - // Nope, it's not 1.0 - (lookfor = "TLSv1", strstr (token, lookfor))) + if ((lookfor = "SSLv3", !strncmp (token, lookfor, 5)) || + (lookfor = "TLSv1.1", !strncmp (token, lookfor, 7)) || + (lookfor = "TLSv1.2", !strncmp (token, lookfor, 7)) || + (lookfor = "TLSv1.3", !strncmp (token, lookfor, 7)) || + /* Nope, it's not 1.0 */ + (lookfor = "TLSv1", !strncmp (token, lookfor, 5))) return lookfor; return NULL; } @@ -2403,6 +2429,7 @@ static int gen_tls_type_key (GKeyData * kdata, GLogItem * logitem) { const char *tls; + size_t tlen = 0, clen = 0; if (!logitem->tls_type) return 1; @@ -2413,9 +2440,23 @@ if (!tls) return 1; - kdata->data = logitem->tls_type; - kdata->data_key = logitem->tls_type; kdata->numdate = logitem->numdate; + if (!logitem->tls_cypher) { + kdata->data_key = kdata->data = kdata->root = kdata->root_key = tls; + return 0; + } + + clen = strlen (logitem->tls_cypher); + tlen = strlen (tls); + + logitem->tls_type_cypher = xmalloc (tlen + clen + 2); + memcpy (logitem->tls_type_cypher, tls, tlen); + logitem->tls_type_cypher[tlen] = '/'; + /* includes terminating null */ + memcpy (logitem->tls_type_cypher + tlen + 1, logitem->tls_cypher, clen + 1); + + kdata->data = logitem->tls_type_cypher; + kdata->data_key = logitem->tls_type_cypher; kdata->root = tls; kdata->root_key = tls; @@ -2611,7 +2652,7 @@ parse->datamap (module, kdata); /* insert rootmap and root-data map */ - if (parse->rootmap) { + if (parse->rootmap && kdata->root) { parse->rootmap (module, kdata); insert_root (module, kdata); } @@ -2761,16 +2802,16 @@ * Returns 1 if the content is likely the same or no data to compare * Returns 0 if it has different content */ static int -is_likely_same_log (GLog * glog, GLastParse lp) { +is_likely_same_log (GLog * glog, const GLastParse * lp) { size_t size = 0; - if (!lp.size) + if (!lp->size) return 1; /* Must be a LOG */ - size = MIN (glog->snippetlen, lp.snippetlen); - if (glog->snippet[0] != '\0' && lp.snippet[0] != '\0' && - memcmp (glog->snippet, lp.snippet, size) == 0) + size = MIN (glog->snippetlen, lp->snippetlen); + if (glog->snippet[0] != '\0' && lp->snippet[0] != '\0' && + memcmp (glog->snippet, lp->snippet, size) == 0) return 1; return 0; @@ -2797,7 +2838,7 @@ /* If our current line is greater or equal (zero indexed) to the last parsed * line and have equal timestamps, then keep parsing then */ - if (glog->inode && is_likely_same_log (glog, lp)) { + if (glog->inode && is_likely_same_log (glog, &lp)) { if (glog->size > lp.size && glog->read >= lp.line) return 0; return 1; @@ -2842,7 +2883,7 @@ /* If our current line is greater or equal (zero indexed) to the last parsed * line then keep parsing then */ - if (glog->inode && is_likely_same_log (glog, lp)) { + if (glog->inode && is_likely_same_log (glog, &lp)) { /* only count invalids if we're past the last parsed line */ if (glog->size > lp.size && glog->read >= lp.line) count_process_and_invalid (glog, line); @@ -3075,10 +3116,14 @@ * * On error, 1 is returned. * On success, 0 is returned. */ -static int +int set_initial_persisted_data (GLog * glog, FILE * fp, const char *fn) { size_t len; + /* reset the snippet */ + memset (glog->snippet, 0, sizeof (glog->snippet)); + glog->snippetlen = 0; + if (glog->size == 0) return 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/parser.h new/goaccess-1.4.3/src/parser.h --- old/goaccess-1.4.2/src/parser.h 2020-11-15 21:53:49.000000000 +0100 +++ new/goaccess-1.4.3/src/parser.h 2020-12-04 02:19:31.000000000 +0100 @@ -91,6 +91,8 @@ /* UMS */ char *mime_type; char *tls_type; + char *tls_cypher; + char *tls_type_cypher; char *errstr; struct tm dt; @@ -110,7 +112,7 @@ uint8_t log_erridx; uint32_t read; /* lines read/parsed */ uint32_t inode; /* inode of the log */ - uint64_t bytes; /* bytes read */ + uint64_t bytes; /* bytes read on each iteration */ uint64_t size; /* original size of log */ uint64_t length; /* length read from the log so far */ uint64_t invalid; /* invalid lines for this log */ @@ -205,6 +207,7 @@ char **test_format (Logs * logs, int *len); int parse_log (Logs * logs, int dry_run); int pre_process_log (GLog * glog, char *line, int dry_run); +int set_initial_persisted_data (GLog * glog, FILE * fp, const char *fn); void free_logerrors (GLog * glog); void free_logs (Logs * logs); void free_raw_data (GRawData * raw_data); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/settings.c new/goaccess-1.4.3/src/settings.c --- old/goaccess-1.4.2/src/settings.c 2020-11-15 21:53:25.000000000 +0100 +++ new/goaccess-1.4.3/src/settings.c 2020-12-04 02:19:31.000000000 +0100 @@ -596,8 +596,10 @@ char *buf = NULL, *tf = set_format_time (); const char *df = conf.date_num_format; - if (!df || !tf) + if (!df || !tf) { + free (tf); return; + } if (conf.date_spec_hr && strchr (tf, 'H')) buf = append_spec_date_format (df, "%H"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/settings.h new/goaccess-1.4.3/src/settings.h --- old/goaccess-1.4.2/src/settings.h 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/settings.h 2020-12-04 02:19:31.000000000 +0100 @@ -174,6 +174,7 @@ int skip_term_resolver; /* no terminal resolver */ uint32_t keep_last; /* number of days to keep in storage */ uint32_t num_tests; /* number of lines to test */ + uint64_t html_refresh; /* refresh html report every X of seconds */ uint64_t log_size; /* log size override */ /* Internal flags */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/tpl.c new/goaccess-1.4.3/src/tpl.c --- old/goaccess-1.4.2/src/tpl.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/tpl.c 2020-12-04 02:19:31.000000000 +0100 @@ -1103,6 +1103,7 @@ } } free (buf); + va_end (ap); return -1; } } while (sz > 0); @@ -1114,6 +1115,7 @@ pa_sz = va_arg (ap, size_t); if (pa_sz < sz) { tpl_hook.oops ("tpl_dump: buffer too small, need %zu bytes\n", sz); + va_end (ap); return -1; } rc = tpl_dump_to_mem (r, pa_addr, sz); @@ -1281,7 +1283,7 @@ if (((tpl_root_data *) (r->data))->flags & TPL_XENDIAN) tpl_byteswap (&intlsz, sizeof (uint32_t)); if (!excess_ok && (intlsz != bufsz)) - return ERR_INCONSISTENT_SZ; /* inconsisent buffer/internal size */ + return ERR_INCONSISTENT_SZ; /* inconsistent buffer/internal size */ dv = (void *) ((uintptr_t) dv + sizeof (uint32_t)); /* dv points to the start of the format string. Look for nul w/in buf sz */ @@ -1425,7 +1427,7 @@ if (xendian) tpl_byteswap (&intlsz, sizeof (uint32_t)); if (intlsz != sz) - goto fail; /* inconsisent buffer/internal size */ + goto fail; /* inconsistent buffer/internal size */ dv = (void *) ((uintptr_t) dv + sizeof (uint32_t)); /* dv points to the start of the format string. Look for nul w/in buf sz */ @@ -2465,7 +2467,7 @@ } /* Used by select()-driven apps which want to gather tpl images piecemeal */ -/* the file descriptor must be non-blocking for this functino to work. */ +/* the file descriptor must be non-blocking for this function to work. */ static int tpl_gather_nonblocking (int fd, tpl_gather_t ** gs, tpl_gather_cb * cb, void *data) { char buf[TPL_GATHER_BUFLEN], *img, *tpl; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/ui.c new/goaccess-1.4.3/src/ui.c --- old/goaccess-1.4.2/src/ui.c 2020-11-15 21:53:25.000000000 +0100 +++ new/goaccess-1.4.3/src/ui.c 2020-12-04 02:19:31.000000000 +0100 @@ -204,15 +204,15 @@ /* init header screen */ *header_win = newwin (6, col, 0, 0); - keypad (*header_win, TRUE); if (*header_win == NULL) FATAL ("Unable to allocate memory for header_win."); + keypad (*header_win, TRUE); /* init main screen */ *main_win = newwin (row - 8, col, 7, 0); - keypad (*main_win, TRUE); if (*main_win == NULL) FATAL ("Unable to allocate memory for main_win."); + keypad (*main_win, TRUE); set_wbkgd (*main_win, *header_win); } @@ -951,6 +951,7 @@ touchwin (main_win); close_win (win); + win = NULL; wrefresh (main_win); out: @@ -962,6 +963,7 @@ free (menu->items); free (menu); free_agents_array (agents); + close_win (win); } /* Render the processing spinner. This runs within its own thread. */ @@ -987,7 +989,8 @@ if (!sp->curses && !conf.no_progress) fprintf (stderr, "\n"); - break; + pthread_mutex_unlock (&sp->mutex); + return; } setlocale (LC_NUMERIC, ""); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/util.c new/goaccess-1.4.3/src/util.c --- old/goaccess-1.4.2/src/util.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/util.c 2020-12-04 02:19:31.000000000 +0100 @@ -447,13 +447,15 @@ char * get_user_config (void) { char *user_home = NULL, *path = NULL; + size_t len; user_home = getenv ("HOME"); if (user_home == NULL) return NULL; - path = xmalloc (snprintf (NULL, 0, "%s/.goaccessrc", user_home) + 1); - sprintf (path, "%s/.goaccessrc", user_home); + len = snprintf (NULL, 0, "%s/.goaccessrc", user_home) + 1; + path = xmalloc (len); + snprintf (path, len, "%s/.goaccessrc", user_home); return path; } @@ -464,9 +466,11 @@ char * get_global_config (void) { char *path = NULL; + size_t len; - path = xmalloc (snprintf (NULL, 0, "%s/goaccess/goaccess.conf", SYSCONFDIR) + 1); - sprintf (path, "%s/goaccess/goaccess.conf", SYSCONFDIR); + len = snprintf (NULL, 0, "%s/goaccess/goaccess.conf", SYSCONFDIR) + 1; + path = xmalloc (len); + snprintf (path, len, "%s/goaccess/goaccess.conf", SYSCONFDIR); return path; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/websocket.c new/goaccess-1.4.3/src/websocket.c --- old/goaccess-1.4.2/src/websocket.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/websocket.c 2020-12-04 02:19:31.000000000 +0100 @@ -1224,7 +1224,7 @@ #endif } -/* Attmpt to send the given buffer to the given socket. +/* Attempt to send the given buffer to the given socket. * * On error, -1 is returned and the connection status is set. * On success, the number of bytes sent is returned. */ @@ -1473,7 +1473,7 @@ if (!headers->upgrade) headers->upgrade = xstrdup ("websocket"); if (!headers->connection) - headers->upgrade = xstrdup ("Upgrade"); + headers->connection = xstrdup ("Upgrade"); free (s); } @@ -1904,7 +1904,7 @@ } } -/* Attempt to read the frame's header and set the relavant data into +/* Attempt to read the frame's header and set the relevant data into * our frame structure. * * On error, or if no data available to read, the number of bytes is @@ -1993,7 +1993,7 @@ return 0; } -/* Attempt to read the frame's payload and set the relavant data into +/* Attempt to read the frame's payload and set the relevant data into * our message structure. * * On error, or if no data available to read, the number of bytes is @@ -2125,7 +2125,9 @@ if (newfd == -1) return; - client = ws_get_client_from_list (newfd, &server->colist); + if (!(client = ws_get_client_from_list (newfd, &server->colist))) + return; + if (newfd > FD_SETSIZE - 1) { LOG (("Too busy: %d %s.\n", newfd, client->remote_ip)); @@ -2160,7 +2162,7 @@ /* *INDENT-ON* */ gettimeofday (&client->start_proc, NULL); read_client_data (client, server); - /* An error ocurred while reading data or connection closed */ + /* An error occurred while reading data or connection closed */ if ((client->status & WS_CLOSE)) { handle_read_close (conn, client, server); } @@ -2190,7 +2192,7 @@ if (client->sockqueue == NULL) client->status &= ~WS_SENDING; - /* An error ocurred while sending data or while reading data but still + /* An error occurred while sending data or while reading data but still * waiting from the last send() from the server to the client. e.g., * sending status code */ if ((client->status & WS_CLOSE) && !(client->status & WS_SENDING)) @@ -2234,14 +2236,12 @@ } /* Open a named pipe (FIFO) for input to the server (reader). */ -static int +static void ws_openfifo_in (WSPipeIn * pipein) { ws_setfifo (wsconfig.pipein); /* we should be able to open it at as reader */ if ((pipein->fd = open (wsconfig.pipein, O_RDWR | O_NONBLOCK)) < 0) FATAL ("Unable to open fifo in: %s.", strerror (errno)); - - return pipein->fd; } @@ -2334,7 +2334,7 @@ pipeout->status |= WS_SENDING; } -/* Attmpt to send the given buffer to the given outgoing FIFO. +/* Attempt to send the given buffer to the given outgoing FIFO. * * On error, the data is queued up. * On success, the number of bytes sent is returned. */ @@ -2583,7 +2583,7 @@ return; } - /* Either send it to a specific client or brodcast message to all + /* Either send it to a specific client or broadcast message to all * clients */ if (listener != 0) ws_send_strict_fifo_to_client (server, listener, *pa); @@ -2602,7 +2602,7 @@ int bytes = 0; char buf[PIPE_BUF] = { 0 }; - if ((bytes = read (pi->fd, buf, PIPE_BUF)) < 0) + if ((bytes = read (pi->fd, buf, PIPE_BUF - 1)) < 0) return; buf[bytes] = '\0'; /* null-terminate */ @@ -2620,7 +2620,7 @@ return; } - /* brodcast message to all clients */ + /* broadcast message to all clients */ list_foreach (server->colist, ws_broadcast_fifo, *pa); clear_fifo_packet (pi); } @@ -2650,7 +2650,8 @@ FATAL ("Unable to set server: %s.", gai_strerror (errno)); /* Create a TCP socket. */ - *listener = socket (ai->ai_family, ai->ai_socktype, ai->ai_protocol); + if ((*listener = socket (ai->ai_family, ai->ai_socktype, ai->ai_protocol)) == -1) + FATAL ("Unable to open socket: %s.", strerror (errno)); /* Options */ if (setsockopt (*listener, SOL_SOCKET, SO_REUSEADDR, &ov, sizeof (ov)) == -1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/goaccess-1.4.2/src/win/mmap.c new/goaccess-1.4.3/src/win/mmap.c --- old/goaccess-1.4.2/src/win/mmap.c 2020-11-15 21:47:51.000000000 +0100 +++ new/goaccess-1.4.3/src/win/mmap.c 2020-12-04 02:19:31.000000000 +0100 @@ -16,7 +16,7 @@ * * @param addr the suggested start address (if != 0) * @param len length of the region - * @param prot region accesibility, bitwise OR of PROT_READ, PROT_WRITE, PROT_EXEC + * @param prot region accessibility, bitwise OR of PROT_READ, PROT_WRITE, PROT_EXEC * @param flags mapping type and options (ignored) * @param fd object to be mapped into memory * @param offset offset into mapped object _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
