user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 2/4] www: comments for denoting Plack::Request vs CGI
  2016-01-04  1:03  5% [PATCH 0/4] misc updates to push Eric Wong
@ 2016-01-04  1:03  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-01-04  1:03 UTC (permalink / raw)
  To: meta

We'll probably want to continue supporting CGI for mod_perl
compatibility.
---
 lib/PublicInbox/ExtMsg.pm | 2 +-
 lib/PublicInbox/Feed.pm   | 2 +-
 lib/PublicInbox/WWW.pm    | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/ExtMsg.pm b/lib/PublicInbox/ExtMsg.pm
index 59bbae5..a56df33 100644
--- a/lib/PublicInbox/ExtMsg.pm
+++ b/lib/PublicInbox/ExtMsg.pm
@@ -89,7 +89,7 @@ sub ext_msg {
 again:
 		my $cgi = $ctx->{cgi};
 		my $url = ref($cgi) eq 'CGI' ? $cgi->url(-base) . '/'
-					: $cgi->base->as_string;
+				: $cgi->base->as_string; # Plack::Request
 		$url .= $listname;
 		unshift @pfx, { git_dir => $ctx->{git_dir}, url => $url };
 		foreach my $pfx (@pfx) {
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index 5708b60..65514eb 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -287,7 +287,7 @@ sub get_feedopts {
 		my $base;
 		if (ref($cgi) eq 'CGI') {
 			$base = $cgi->url(-base);
-		} else {
+		} else { # Plack::Request
 			$base = $cgi->base->as_string;
 			$base =~ s!/\z!!;
 		}
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index b4c050b..411db16 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -198,6 +198,7 @@ sub get_thread {
 
 sub self_url {
 	my ($cgi) = @_;
+						# Plack::Request
 	ref($cgi) eq 'CGI' ? $cgi->self_url : $cgi->uri->as_string;
 }
 
@@ -362,7 +363,7 @@ sub r301 {
 	if (ref($cgi) eq 'CGI') {
 		$url = $cgi->url(-base) . '/';
 		$qs = $cgi->query_string;
-	} else {
+	} else { # Plack::Request
 		$url = $cgi->base->as_string;
 		$qs = $cgi->env->{QUERY_STRING};
 	}
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/4] misc updates to push
@ 2016-01-04  1:03  5% Eric Wong
  2016-01-04  1:03  7% ` [PATCH 2/4] www: comments for denoting Plack::Request vs CGI Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-01-04  1:03 UTC (permalink / raw)
  To: meta

4 changes:
      examples/public-inbox.psgi: shorten to simplify
      www: comments for denoting Plack::Request vs CGI
      misc doc updates
      view: label "relevance" in threaded search view

 HACKING                       |  5 ++++-
 README                        |  3 ++-
 TODO                          | 12 ++++++++++++
 examples/public-inbox.psgi    |  6 +++---
 lib/PublicInbox/ExtMsg.pm     |  2 +-
 lib/PublicInbox/Feed.pm       |  2 +-
 lib/PublicInbox/SearchView.pm |  2 ++
 lib/PublicInbox/View.pm       |  4 ++--
 lib/PublicInbox/WWW.pm        |  3 ++-
 9 files changed, 29 insertions(+), 10 deletions(-)


^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-01-04  1:03  5% [PATCH 0/4] misc updates to push Eric Wong
2016-01-04  1:03  7% ` [PATCH 2/4] www: comments for denoting Plack::Request vs CGI Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.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).