[Privoxy-commits] [privoxy] 06/07: privoxy-log-parser: Highlight the socket number in 'debug 32768' messages
User Git
git at git.privoxy.org
Sun Oct 2 09:48:27 CEST 2022
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository privoxy.
commit 9926c9ea2a6818818ec0be1a95115b40d24f6805
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Thu Sep 29 16:34:59 2022 +0200
privoxy-log-parser: Highlight the socket number in 'debug 32768' messages
---
tools/privoxy-log-parser.pl | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl
index b511931b..c248ec66 100755
--- a/tools/privoxy-log-parser.pl
+++ b/tools/privoxy-log-parser.pl
@@ -2211,6 +2211,23 @@ sub handle_loglevel_error($) {
return $c;
}
+sub handle_loglevel_received($) {
+
+ my $c = shift;
+
+ if ($c =~ m/^TLS from socket/) {
+ # TLS from socket 3: \x16\xda\xe2\xa2;\x0d\x0a
+
+ $c =~ s@(?<=TLS from socket )(\d+)@$h{'Number'}$1$h{'Standard'}@;
+
+ } elsif ($c =~ m/^from socket/) {
+ # from socket 3: HEAD http://p.p/ HTTP/1.1\x0d\x0aHost: p.p\x0d\x0aUser-Agent: curl/7.85.0\x0d\x0aAccept: */*\x0d\x0aProxy-Connection: Keep-Alive\x0d\x0a\x0d\x0a
+
+ $c =~ s@(?<=from socket )(\d+)@$h{'Number'}$1$h{'Standard'}@;
+ }
+
+ return $c;
+}
sub handle_loglevel_ignore($) {
return shift;
@@ -2670,7 +2687,7 @@ sub parse_loop() {
'Error' => \&handle_loglevel_error,
'Fatal error' => \&handle_loglevel_ignore,
'Writing' => \&handle_loglevel_ignore,
- 'Received' => \&handle_loglevel_ignore,
+ 'Received' => \&handle_loglevel_received,
'Tagging' => \&handle_loglevel_tagging,
'Actions' => \&handle_loglevel_ignore,
'Unknown log level' => \&handle_loglevel_ignore,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Privoxy-commits
mailing list