git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>
Subject: [RFC/PATCH 1/5] gitweb: Jump do DONE_REQUEST not DONE_GITWEB on error
Date: Sat,  3 Mar 2012 18:56:59 +0100	[thread overview]
Message-ID: <1330797423-22926-2-git-send-email-jnareb@gmail.com> (raw)
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

  reply	other threads:[~2012-03-03 17:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03 17:56 [RFC/PATCH 0/5] gitweb: Proof of concept of PSGI interface Jakub Narebski
2012-03-03 17:56 ` Jakub Narebski [this message]
2012-03-03 17:57 ` [RFC/PATCH 2/5] gitweb: Prepare for splitting gitweb Jakub Narebski
2012-03-03 17:57 ` [RFC/PATCH 3/5] gitweb: Enable running gitweb as PSGI app, via CGI::Emulate::PSGI Jakub Narebski
2012-03-03 17:57 ` [RFC/PATCH 4/5] gitweb.psgi: Allow passing arguments to Plack::Runner Jakub Narebski
2012-03-03 17:57 ` [RFC/PATCH 5/5] git-instaweb: Use new PSGI interface mode of gitweb Jakub Narebski
2012-03-08 14:06 ` [RFC/PATCH 6/5] gitweb.psgi: Use installed static files, if they are available Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330797423-22926-2-git-send-email-jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).