privoxy-log-parser: Properly highlight a log message that now has a period
authorFabian Keil <fk@fabiankeil.de>
Sun, 27 Nov 2022 18:20:57 +0000 (19:20 +0100)
committerFabian Keil <fk@fabiankeil.de>
Sat, 31 Dec 2022 14:01:03 +0000 (15:01 +0100)
tools/privoxy-log-parser.pl

index 52105fb..c58726c 100755 (executable)
@@ -1805,8 +1805,13 @@ sub handle_loglevel_connect($) {
     } elsif ($c =~ m/^Optimistically sending /) {
 
         # Optimistically sending 318 bytes of client headers intended for www.privoxy.org
+        # Optimistically sending 318 bytes of client headers intended for www.privoxy.org.
         $c =~ s@(?<=sending )(\d+)@$h{'Number'}$1$h{'Standard'}@;
-        $c = highlight_matched_host($c, '(?<=for )[^\s]+');
+        if ($c =~ /\.$/) {
+            $c = highlight_matched_host($c, '[^\s]+(?=\.)');
+        } else {
+            $c = highlight_matched_host($c, '(?<=for )[^\s]+');
+        }
 
     } elsif ($c =~ m/^Stopping to watch the client socket/) {