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

[RFC/PATCH 1/5] gitweb: Jump do DONE_REQUEST not DONE_GITWEB on error

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 3, 2012, 17:56 UTC
Message-ID
<1330797423-22926-2-git-send-email-jnareb@gmail.com>
In-Reply-To
<1330797423-22926-1-git-send-email-jnareb@gmail.com>

On error (die_error()), instead of ending gitweb process by non-local jump to DONE_GITWEB label at the end of requests loop in run() subroutine, just end current request by jumping to DONE_REQUESt at the end of run_request() subroutine.

This change should improve truly persistent deployment methods, currently only FastCGI but in the future also PSGI, as an error page would no longer require reloading whole persistent environment, just end request.

This would allow to create new deployment mechanisms (for example PSGI) based on run_request() and not on run().

Note that DONE_REQUEST label is removed because it is no longer used, and it wouldn't work correctly for PSGI anyway.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Without this we could not write to_psgi_app() in patch 3/5.

This patch has its value independently on PSGI support, though if it is to be accepted standalone, the commit message would have to be slighlty edited, so that the last two paragraphs of it read:

 "This would allow to create new deployment mechanisms based on
  run_request() and not on run().
  DONE_REQUEST label is removed because it is no longer used."
 gitweb/gitweb.perl |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e2e6a73..2cca2cd 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1195,6 +1195,10 @@ sub run_request {
 	configure_gitweb_features();
 
 	dispatch();
+
+
+ DONE_REQUEST:
+	1;
 }
 
 our $is_last_request = sub { 1 };
@@ -1252,9 +1256,6 @@ sub run {
 
 		last REQUEST if ($is_last_request->());
 	}
-
- DONE_GITWEB:
-	1;
 }
 
 run();
@@ -4195,7 +4196,7 @@ EOF
 	print "</div>\n";
 
 	git_footer_html();
-	goto DONE_GITWEB
+	goto DONE_REQUEST
 		unless ($opts{'-error_handler'});
 }
 
-- 
1.7.9
Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 7 in “gitweb: Proof of concept of PSGI interface”
  1. 0/5 gitweb: Proof of concept of PSGI interfaceJakub Narebski, Mar 3, 2012
  2. 1/5 gitweb: Jump do DONE_REQUEST not DONE_GITWEB on errorJakub Narebski, Mar 3, 2012
  3. 2/5 gitweb: Prepare for splitting gitwebJakub Narebski, Mar 3, 2012
  4. 3/5 gitweb: Enable running gitweb as PSGI app, via CGI::Emulate::PSGIJakub Narebski, Mar 3, 2012
  5. 4/5 gitweb.psgi: Allow passing arguments to Plack::RunnerJakub Narebski, Mar 3, 2012
  6. 5/5 git-instaweb: Use new PSGI interface mode of gitwebJakub Narebski, Mar 3, 2012
  7. 6/5 gitweb.psgi: Use installed static files, if they are availableJakub Narebski, Mar 8, 2012

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.