# hash key as input.
# - Add --compress and --decompress options.
#
-# Copyright (c) 2007-2022 Fabian Keil <fk@fabiankeil.de>
+# Copyright (c) 2007-2023 Fabian Keil <fk@fabiankeil.de>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
$c =~ s@(?<=accept failed: )(.*)@$h{'Error'}$1$h{'Standard'}@;
+ } elsif ($c =~ m/^Failed to accept\(\) incoming connection:/) {
+
+ # Failed to accept() incoming connection: Software caused connection abort
+ $c =~ s@(?<=connection: )(.*)@$h{'Error'}$1$h{'Standard'}@;
+
} elsif ($c =~ m/^Overriding forwarding settings/) {
# Overriding forwarding settings based on 'forward 10.0.0.1:8123'
} 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/) {
$c =~ s@(?<=connected over )(TLSv\d\.\d)@$h{'tls-version'}$1$h{'Standard'}@;
$c =~ s@(?<=\()([^)]+)@$h{'cipher-suite'}$1$h{'Standard'}@;
+ } elsif ($c =~ m/^Couldn't deliver the error message for/) {
+
+ # Couldn't deliver the error message for https://m.media-amazon.com/[...] through client socket 18 using TLS/SSL
+ $c = highlight_matched_url($c, "(?<=error message for )[^ ]*");
+ $c =~ s@(?<=client socket )(\d+)@$h{'Number'}$1$h{'Standard'}@;
+
} elsif ($c =~ m/^Looks like we / or
$c =~ m/^Unsetting keep-alive flag/ or
$c =~ m/^No connections to wait/ or
return $c;
}
+sub handle_loglevel_writing($) {
+
+ my $c = shift;
+
+ if ($c =~ m/^to socket/) {
+ # to socket 11: HTTP/1.1 200 Connection established\x0d\x0a\x0d\x0a
+
+ $c =~ s@(?<=to socket )(\d+)@$h{'Number'}$1$h{'Standard'}@;
+
+ } elsif ($c =~ m/^TLS on socket /) {
+ # TLS on socket 9: o~\xfcS[\xfa\x8f\xd6\x96\xe6_\xc7$\x1b[...]
+
+ $c =~ s@(?<=TLS on socket )(\d+)@$h{'Number'}$1$h{'Standard'}@;
+ }
+
+ return $c;
+}
+
sub handle_loglevel_ignore($) {
return shift;
}
'Force' => \&handle_loglevel_force,
'Error' => \&handle_loglevel_error,
'Fatal error' => \&handle_loglevel_ignore,
- 'Writing' => \&handle_loglevel_ignore,
+ 'Writing' => \&handle_loglevel_writing,
'Received' => \&handle_loglevel_received,
'Tagging' => \&handle_loglevel_tagging,
'Actions' => \&handle_loglevel_ignore,