git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/6] gitweb: Precompile CGI routines for mod_perl

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 27, 2006, 23:00 UTC
Message-ID
<200612280000.52586.jnareb@gmail.com>
In-Reply-To
<200612272355.31923.jnareb@gmail.com>

Following advice from CGI(3pm) man page, precompile all CGI routines for mod_perl, in the BEGIN block.

  If you want to compile without importing use the compile() method
  instead:
    use CGI();
    CGI->compile();
  This is particularly useful in a mod_perl environment, in which you
  might want to precompile all CGI routines in a startup script, and then
  import the functions individually in each mod_perl script.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Could help. I'm a bit unsure.
 gitweb/gitweb.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index bb1d66c..3888563 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -18,6 +18,10 @@ use File::Find qw();
 use File::Basename qw(basename);
 binmode STDOUT, ':utf8';
 
+BEGIN {
+	CGI->compile() if $ENV{MOD_PERL};
+}
+
 our $cgi = new CGI;
 our $version = "++GIT_VERSION++";
 our $my_url = $cgi->url();
-- 
1.4.4.3
Previous: Jakub NarebskiNext: Jakub Narebski
Message 6 of 11 in “gitweb: Some mod_perl specific support (but not only)”
  1. 0/6 gitweb: Some mod_perl specific support (but not only)Jakub Narebski, Dec 27, 2006
  2. 1/6 gitweb: Separate HTTP header outputJakub Narebski, Dec 27, 2006
  3. Junio C HamanoDec 28, 2006
  4. Shawn PearceDec 28, 2006
  5. 2/6 gitweb: Add mod_perl version string to "generator" meta headerJakub Narebski, Dec 27, 2006
  6. 3/6 gitweb: Precompile CGI routines for mod_perlJakub Narebski, Dec 27, 2006
  7. 4/6 gitweb: Prepare for mod_perl specific supportJakub Narebski, Dec 27, 2006
  8. 5/6 gitweb: Make possible to run under mod_perl without SetupEnvJakub Narebski, Dec 27, 2006
  9. 6/6 gitweb: Make possible to run under mod_perl without ParseHeadersJakub Narebski, Dec 28, 2006
  10. Robert FitzsimonsDec 28, 2006
  11. Jakub NarebskiDec 28, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.