From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8922 invoked from network); 26 Sep 2002 13:38:31 -0000 Received: from unknown (HELO monty-python.gnu.org) (199.232.76.173) by sources.redhat.com with SMTP; 26 Sep 2002 13:38:31 -0000 Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17uYqR-0002tG-00; Thu, 26 Sep 2002 09:38:19 -0400 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17uYpq-0002pI-00 for help-gnats@gnu.org; Thu, 26 Sep 2002 09:37:42 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17uYpo-0002p5-00 for help-gnats@gnu.org; Thu, 26 Sep 2002 09:37:41 -0400 Received: from claven.astro.princeton.edu ([128.112.25.10]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17uYpn-0002os-00 for help-gnats@gnu.org; Thu, 26 Sep 2002 09:37:39 -0400 Received: from wire7.Princeton.EDU (IDENT:pstHK4GLRIYf0CwOY9CmYVOj33sn7Wj7@wire7 [128.112.24.203]) by claven.astro.princeton.edu (8.11.6/8.11.6) with ESMTP id g8QDbcd02202 for ; Thu, 26 Sep 2002 09:37:38 -0400 Received: (from rhl@localhost) by wire7.Princeton.EDU (8.11.6/8.11.2) id g8QDbc022494; Thu, 26 Sep 2002 09:37:38 -0400 From: Robert Lupton the Good MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15763.3490.841076.988437@wire7.Princeton.EDU> To: help-gnats@gnu.org Subject: Patch for gnatsweb.pl In-Reply-To: <20020925181413.GA1154909@cluster2.netman.dk> References: <20020922184733.GA1071317@cluster2.netman.dk> <15749.57217.976539.558063@wire7.Princeton.EDU> <5.1.0.14.2.20020925174747.044096d0@romulus.holland.sun.com> <20020925181413.GA1154909@cluster2.netman.dk> X-Mailer: VM 7.03 under Emacs 20.7.1 Sender: help-gnats-admin@gnu.org Errors-To: help-gnats-admin@gnu.org X-BeenThere: help-gnats@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General discussion about GNU GNATS List-Archive: Date: Thu, 26 Sep 2002 15:46:00 -0000 X-SW-Source: 2002-q3/txt/msg00130.txt.bz2 Here's a patch to help debug things (my patch.7). It allows the user to define a callback to print debugging information, specifically to add a "Debug" button to the gnats menubar. It's up to gnatsweb-site.pl what to do with this, but I use it to print the state of the server with a callback like: elsif ($reason eq 'cmd') { # Handle site-specific values for 'cmd' param. my $cmd = shift(@args); if ($cmd eq 'debug') { if(!@args) { print_header(); initialize(); print "global_prefs:\n
"; foreach (sort keys %global_prefs) { print "
$_\n
\"$global_prefs{$_}\"\n"; } print "
\n"; print "db_prefs:\n
"; foreach (sort keys %db_prefs) { print "
$_\n
\"$db_prefs{$_}\"\n"; } print "
\n"; print "
";
		debug_print_all_cookies(\*STDOUT);
		print "
"; } return 1; ... I also changed debug_print_all_cookies() to optinally take a file handle (the default's still STDERR so it goes to the httpd log). R *** /u/gnats/src/Patches/gnatsweb.pl Mon Sep 16 09:28:38 2002 --- /u/dss/cgi-bin/gnatsweb-v4.pl Wed Sep 18 15:44:57 2002 *************** *** 3285,3290 **** --- 3285,3292 ---- $row2 .= qq(LOG OUT) unless ($site_gnatsweb_server_auth); $row2 .= qq(HELP); + $row2 .= qq(DEBUG) + if(cb('cmd', 'debug', 'inquire')); $row2 .= qq(\n); $row2 .= qq(\n\n); *************** *** 4122,4140 **** sub debug_print_all_cookies { # Debug: print all our cookies into server log. ! warn "================= all cookies ===================================\n"; my @c; my $i = 0; foreach my $y ($q->cookie()) { @c = $q->cookie($y); ! warn "got cookie: length=", scalar(@c), ": $y =>@c<=\n"; $i += length($y); } # @c = $q->raw_cookie(); ! # warn "debug 0.5: @c:\n"; ! # warn "debug 0.5: total size of raw cookies: ", length("@c"), "\n"; } # set_pref - --- 4124,4149 ---- sub debug_print_all_cookies { + my($fd) = @_; + + if (!defined($fd)) + { + $fd = \*STDERR; + } + # Debug: print all our cookies into server log. ! print $fd "================= all cookies ===================================\n"; my @c; my $i = 0; foreach my $y ($q->cookie()) { @c = $q->cookie($y); ! print $fd "got cookie: length=", scalar(@c), ": $y =>@c<=\n"; $i += length($y); } # @c = $q->raw_cookie(); ! # print $fd "debug 0.5: @c:\n"; ! # print $fd "debug 0.5: total size of raw cookies: ", length("@c"), "\n"; } # set_pref - _______________________________________________ Help-gnats mailing list Help-gnats@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnats