vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r16119: Change Apache::Constants with constants ...

Committer: vsukhanov
Change Apache::Constants with constants from LJ::Request
U   branches/modernize2/cgi-bin/Apache/DebateSuicide.pm
U   branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm
U   branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/ElsewhereInfo.pm
U   branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/FotoBilder.pm
U   branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/S2.pm
U   branches/modernize2/cgi-bin/Apache/LiveJournal/PalImg.pm
U   branches/modernize2/cgi-bin/Apache/LiveJournal.pm
U   branches/modernize2/cgi-bin/Apache/SendStats.pm
U   branches/modernize2/cgi-bin/LJ/AccessLogRecord.pm
U   branches/modernize2/cgi-bin/LJ/NewWorker.pm
U   branches/modernize2/cgi-bin/LJ/Request/Apache.pm
U   branches/modernize2/cgi-bin/LJ/Request/Apache2.pm
U   branches/modernize2/cgi-bin/LJ/Request.pm
U   branches/modernize2/cgi-bin/LJ/URI.pm
Modified: branches/modernize2/cgi-bin/Apache/DebateSuicide.pm
===================================================================
--- branches/modernize2/cgi-bin/Apache/DebateSuicide.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/Apache/DebateSuicide.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -4,7 +4,6 @@
 package Apache::DebateSuicide;
 
 use strict;
-use Apache::Constants qw(:common);
 use Class::Autouse qw(
                       LJ::ModuleCheck
                       );
@@ -17,11 +16,11 @@
 sub handler
 {
     #my $r = shift;
-    return OK if LJ::Request->main;
-    return OK unless $LJ::SUICIDE && LJ::ModuleCheck->have("GTop");
+    return LJ::Request::OK if LJ::Request->main;
+    return LJ::Request::OK unless $LJ::SUICIDE && LJ::ModuleCheck->have("GTop");
 
     my $meminfo;
-    return OK unless open (MI, "/proc/meminfo");
+    return LJ::Request::OK unless open (MI, "/proc/meminfo");
     $meminfo = join('', <MI>);
     close MI;
 
@@ -31,7 +30,7 @@
     }
 
     my $memfree = $meminfo{'MemFree'} + $meminfo{'Cached'};
-    return OK unless $memfree;
+    return LJ::Request::OK unless $memfree;
 
     my $goodfree = $LJ::SUICIDE_UNDER{$LJ::SERVER_NAME} || $LJ::SUICIDE_UNDER ||   150_000;
     my $is_under = $memfree < $goodfree;
@@ -51,7 +50,7 @@
 
         $is_over = $proc_size_k > $maxproc;
     }
-    return OK unless $is_over || $is_under;
+    return LJ::Request::OK unless $is_over || $is_under;
 
     # we'll proceed to die if we're one of the largest processes
     # on this machine
@@ -101,7 +100,7 @@
         CORE::exit(0);
     }
 
-    return OK;
+    return LJ::Request::OK;
 }
 
 sub pid_info {

Modified: branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm
===================================================================
--- branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -3,7 +3,6 @@
 package Apache::LiveJournal::Interface::AtomAPI;
 
 use strict;
-use Apache::Constants qw(:common);
 use Digest::SHA1;
 use MIME::Base64;
 use lib "$ENV{LJHOME}/cgi-bin";
@@ -70,7 +69,7 @@
     LJ::Request->content_type($type);
     LJ::Request->send_http_header();
     LJ::Request->print($out);
-    return OK;
+    return LJ::Request::OK;
 };
 
 sub handle_upload
@@ -535,7 +534,7 @@
         if ($op{'handler_return'}) {
             # this could be a conditional GET shortcut, honor it
             LJ::Request->status($op{'handler_return'});
-            return OK;
+            return LJ::Request::OK;
         }
         # should never get here
         return respond(404, "Unknown error.");
@@ -663,7 +662,7 @@
         'categories' => \&handle_categories,
     }->{$action}->($remote, $u, $opts);
 
-    return OK;
+    return LJ::Request::OK;
 }
 
 # Authenticate via the WSSE header.

Modified: branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/ElsewhereInfo.pm
===================================================================
--- branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/ElsewhereInfo.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/ElsewhereInfo.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -87,7 +87,7 @@
 
     respond(200, JSON::objToJson(\%resp));
 
-    return OK;
+    return LJ::Request::OK;
 }
 
 sub respond {
@@ -106,7 +106,7 @@
     LJ::Request->send_http_header();
     LJ::Request->print($body);
 
-    return OK;
+    return LJ::Request::OK;
 };
 
 1;

Modified: branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/FotoBilder.pm
===================================================================
--- branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/FotoBilder.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/FotoBilder.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -4,8 +4,6 @@
 package Apache::LiveJournal::Interface::FotoBilder;
 
 use strict;
-use Apache::Constants qw(:common REDIRECT HTTP_NOT_MODIFIED
-                         HTTP_MOVED_PERMANENTLY BAD_REQUEST);
 
 sub run_method
 {
@@ -29,23 +27,23 @@
 sub handler
 {
     my $uri = LJ::Request->uri;
-    return 404 unless $uri =~ m#^/interface/fotobilder(?:/(\w+))?$#;
+    return LJ::Request::NOT_FOUND unless $uri =~ m#^/interface/fotobilder(?:/(\w+))?$#;
     my $cmd = $1;
 
-    return BAD_REQUEST unless LJ::Request->method eq "POST";
+    return LJ::Request::BAD_REQUEST unless LJ::Request->method eq "POST";
 
     LJ::Request->content_type("text/plain");
     LJ::Request->send_http_header();
 
     my %POST = LJ::Request->post_params;
     my $res = run_method($cmd, \%POST)
-        or return BAD_REQUEST;
+        or return LJ::Request::BAD_REQUEST;
 
     $res->{"fotobilder-interface-version"} = 1;
 
     LJ::Request->print(join("", map { "$_: $res->{$_}\n" } keys %$res));
 
-    return OK;
+    return LJ::Request::OK;
 }
 
 # Is there a current LJ session?

Modified: branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/S2.pm
===================================================================
--- branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/S2.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/Apache/LiveJournal/Interface/S2.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -5,7 +5,6 @@
 
 use strict;
 use MIME::Base64 ();
-use Apache::Constants;
 
 sub load { 1 }
 
@@ -18,7 +17,7 @@
     if ($uri =~ m!^/interface/s2/(\d+)$!) {
         $id = $1 + 0;
     } else {
-        return NOT_FOUND;
+        return LJ::Request::NOT_FOUND;
     }
 
     my $lay = LJ::S2::load_layer($id);
@@ -34,7 +33,7 @@
         LJ::Request->send_http_header("text/plain; charset=utf-8");
         LJ::Request->print("Unauthorized\nYou must send your $LJ::SITENAME username and password or a valid session cookie\n");
 
-        return OK;
+        return LJ::Request::OK;
     }
 
     my $dbr = LJ::get_db_reader();
@@ -95,7 +94,7 @@
             $error =~ s!, .+?(src/s2|cgi-bin)/!, !g;
 
             print $error;
-            return OK;
+            return LJ::Request::OK;
         }
         else {
             LJ::Request->status_line("201 Compiled and Saved");
@@ -119,7 +118,7 @@
     LJ::Request->print("$string\n$long\n");
 
     # Tell Apache OK so it won't try to handle the error
-    return OK;
+    return LJ::Request::OK;
 }
 
 1;

Modified: branches/modernize2/cgi-bin/Apache/LiveJournal/PalImg.pm
===================================================================
--- branches/modernize2/cgi-bin/Apache/LiveJournal/PalImg.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/Apache/LiveJournal/PalImg.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -4,7 +4,7 @@
 package Apache::LiveJournal::PalImg;
 
 use strict;
-use Apache::Constants qw(:common REDIRECT HTTP_NOT_MODIFIED);
+#use Apache::Constants qw(:common REDIRECT HTTP_NOT_MODIFIED);
 use PaletteModify;
 
 # for callers to 'ping' as a class method for Class::Autouse to lazily load
@@ -20,10 +20,10 @@
     my $uri = LJ::Request->uri;
     my ($base, $ext, $extra) = $uri =~ m!^/palimg/(.+)\.(\w+)(.*)$!;
     LJ::Request->notes("codepath" => "img.palimg");
-    return 404 unless $base && $base !~ m!\.\.!;
+    return LJ::Request::NOT_FOUND unless $base && $base !~ m!\.\.!;
 
     my $disk_file = "$LJ::HOME/htdocs/palimg/$base.$ext";
-    return 404 unless -e $disk_file;
+    return LJ::Request::NOT_FOUND unless -e $disk_file;
 
     my @st = stat(_);
     my $size = $st[7];
@@ -40,7 +40,7 @@
         if ($extra =~ m!^/p(.+)$!) {
             $palspec = $1;
         } else {
-            return 404;
+            return LJ::Request::NOT_FOUND;
         }
     }
 
@@ -73,7 +73,7 @@
             # gradient from index $1, color $2, to index $3, color $4
             my $from = hex($1);
             my $to = hex($3);
-            return 404 if $from == $to;
+            return LJ::Request::NOT_FOUND if $from == $to;
             my $fcolor = parse_hex_color($2);
             my $tcolor = parse_hex_color($4);
             if ($to < $from) {
@@ -94,10 +94,10 @@
             $pal_colors{'tint'} = parse_hex_color($t);
             $pal_colors{'tint_dark'} = $td ? parse_hex_color($td) : [0,0,0];
         } elsif (length($pals) > 42 || $pals =~ /[^0-9a-f]/) {
-            return 404;
+            return LJ::Request::NOT_FOUND;
         } else {
             my $len = length($pals);
-            return 404 if $len % 7;  # must be multiple of 7 chars
+            return LJ::Request::NOT_FOUND if $len % 7;  # must be multiple of 7 chars
             for (my $i = 0; $i < $len/7; $i++) {
                 my $palindex = hex(substr($pals, $i*7, 1));
                 $pal_colors{$palindex} = [
@@ -113,7 +113,7 @@
 
     $etag = '"' . $etag . '"';
     my $ifnonematch = LJ::Request->header_in("If-None-Match");
-    return HTTP_NOT_MODIFIED if
+    return LJ::Request::HTTP_NOT_MODIFIED if
         defined $ifnonematch && $etag eq $ifnonematch;
 
     # send the file
@@ -127,12 +127,12 @@
     LJ::Request->send_http_header();
 
     # HEAD request?
-    return OK if LJ::Request->method eq "HEAD";
+    return LJ::Request::OK if LJ::Request->method eq "HEAD";
 
     # this is slow way of sending file.
     # but in productions this code should not be called.
     open my $fh, "<" => $disk_file
-        or return 404;
+        or return LJ::Request::NOT_FOUND;
     binmode $fh;
     my $palette = undef;
     if (%pal_colors) {
@@ -142,7 +142,7 @@
             $palette = PaletteModify::new_png_palette($fh, \%pal_colors);
         }
         unless ($palette) {
-            return 404;  # image isn't palette changeable?
+            return LJ::Request::NOT_FOUND;  # image isn't palette changeable?
         }
     }
     LJ::Request->print($palette) if $palette;
@@ -153,7 +153,7 @@
 
 =head
     my $fh = Apache::File->new($disk_file);
-    return 404 unless $fh;
+    return LJ::Request::NOT_FOUND unless $fh;
     binmode($fh);
 
     my $palette;
@@ -164,7 +164,7 @@
             $palette = PaletteModify::new_png_palette($fh, \%pal_colors);
         }
         unless ($palette) {
-            return 404;  # image isn't palette changeable?
+            return LJ::Request::NOT_FOUND;  # image isn't palette changeable?
         }
     }
 
@@ -172,7 +172,7 @@
     $r->send_fd($fh); # sends remaining data (or all of it) quickly
     $fh->close();
 =cut
-    return OK;
+    return LJ::Request::OK;
 }
 
 1;

Modified: branches/modernize2/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- branches/modernize2/cgi-bin/Apache/LiveJournal.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/Apache/LiveJournal.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -38,7 +38,6 @@
 # load.  in non-apache mode, they're loaded via LJ::ModuleCheck->have
 use Class::Autouse qw(
                       Compress::Zlib
-                      XMLRPC::Transport::HTTP
                       LJ::URI
                       );
 
@@ -260,6 +259,9 @@
     my $args = LJ::Request->args;
     my $args_wq = $args ? "?$args" : "";
     my $host = LJ::Request->header_in("Host");
+warn "HOST: $host";
+warn "URI: " . LJ::Request->uri;
+warn "Filename: " . LJ::Request->filename;
     my $hostport = ($host =~ s/:\d+$//) ? $& : "";
     $host =~ s/\.$//; ## 'www.livejournal.com.' is a valid DNS hostname
 
@@ -283,8 +285,10 @@
 
     my $is_ssl = $LJ::IS_SSL = LJ::run_hook("ssl_check");
 
+#=head
     my $bml_handler = sub {
         my $filename = shift;
+warn "BML HANDLER: filename=$filename";
         LJ::Request->handler("perl-script");
         LJ::Request->notes("bml_filename" => $filename);
         LJ::Request->push_handlers(PerlHandler => \&Apache::BML::handler);
@@ -367,6 +371,7 @@
     if ($LJ::DOMAIN_WEB && LJ::Request->method eq "GET" &&
         $host eq $LJ::DOMAIN && $LJ::DOMAIN_WEB ne $LJ::DOMAIN)
     {
+warn "REDIRECT TO SITEROOT";
         my $url = "$LJ::SITEROOT$uri";
         $url .= "?" . $args if $args;
         return redir($url);
@@ -430,6 +435,7 @@
     my $journal_view = sub {
         my $opts = shift;
         $opts ||= {};
+warn "Journal view";
 
         my $orig_user = $opts->{'user'};
         $opts->{'user'} = LJ::canonical_username($opts->{'user'});
@@ -588,6 +594,7 @@
         my $mode = undef;
         my $pe;
         my $ljentry;
+warn "Determine view: uuri=$uuri";
 
         # if favicon, let filesystem handle it, for now, until
         # we have per-user favicons.
@@ -969,6 +976,8 @@
         LJ::Request->notes("bml_filename" => $file);
         return Apache::BML::handler();
     }
+#=cut
+warn "End of trans";
 
     return LJ::Request::DECLINED
 }

Modified: branches/modernize2/cgi-bin/Apache/SendStats.pm
===================================================================
--- branches/modernize2/cgi-bin/Apache/SendStats.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/Apache/SendStats.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -9,15 +9,14 @@
 
 use strict;
 use IO::Socket::INET;
-use Apache::Constants qw(:common);
 use Socket qw(SO_BROADCAST);
 
 use vars qw(%udp_sock);
 
 sub handler
 {
-    return OK if LJ::Request->main;
-    return OK unless $LJ::HAVE_AVAIL && $LJ::FREECHILDREN_BCAST;
+    return LJ::Request::OK if LJ::Request->main;
+    return LJ::Request::OK unless $LJ::HAVE_AVAIL && $LJ::FREECHILDREN_BCAST;
 
     my $callback = LJ::Request->is_inited ? LJ::Request->current_callback() : '';
     my $cleanup = $callback eq "PerlCleanupHandler";
@@ -66,7 +65,7 @@
             unless $res;
     }
 
-    return OK;
+    return LJ::Request::OK;
 }
 
 1;

Modified: branches/modernize2/cgi-bin/LJ/AccessLogRecord.pm
===================================================================
--- branches/modernize2/cgi-bin/LJ/AccessLogRecord.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/LJ/AccessLogRecord.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -3,16 +3,15 @@
 
 sub new {
     my $class = shift;
-    my $rl = LJ::Request->r;
 
     my $now = time();
     my @now = gmtime($now);
 
-    my $remote = eval { LJ::load_user($rl->notes('ljuser')) };
+    my $remote = eval { LJ::load_user(LJ::Request->notes('ljuser')) };
     my $remotecaps = $remote ? $remote->{caps} : undef;
     my $remoteid   = $remote ? $remote->{userid} : 0;
-    my $ju = eval { LJ::load_userid($rl->notes('journalid')) };
-    my $ctype = $rl->content_type;
+    my $ju = eval { LJ::load_userid(LJ::Request->notes('journalid')) };
+    my $ctype = LJ::Request->content_type;
     $ctype =~ s/;.*//;  # strip charset
 
     my $self = bless {
@@ -21,24 +20,24 @@
         'whn' => sprintf("%04d%02d%02d%02d%02d%02d", $now[5]+1900, $now[4]+1, @now[3, 2, 1, 0]),
         'whnunix' => $now,
         'server' => $LJ::SERVER_NAME,
-        'addr' => LJ::Request->connection->remote_ip,
-        'ljuser' => $rl->notes('ljuser'),
+        'addr' => LJ::Request->remote_ip,
+        'ljuser' => LJ::Request->notes('ljuser'),
         'remotecaps' => $remotecaps,
         'remoteid'   => $remoteid,
-        'journalid' => $rl->notes('journalid'),
+        'journalid' => LJ::Request->notes('journalid'),
         'journaltype' => ($ju ? $ju->{journaltype} : ""),
         'journalcaps' => ($ju ? $ju->{caps} : undef),
-        'codepath' => $rl->notes('codepath'),
-        'anonsess' => $rl->notes('anonsess'),
-        'langpref' => $rl->notes('langpref'),
-        'clientver' => $rl->notes('clientver'),
+        'codepath' => LJ::Request->notes('codepath'),
+        'anonsess' => LJ::Request->notes('anonsess'),
+        'langpref' => LJ::Request->notes('langpref'),
+        'clientver' => LJ::Request->notes('clientver'),
         'uniq' => LJ::Request->notes('uniq'),
         'method' => LJ::Request->method,
         'uri' => LJ::Request->uri,
         'args' => scalar LJ::Request->args,
-        'status' => $rl->status,
+        'status' => LJ::Request->status,
         'ctype' => $ctype,
-        'bytes' => $rl->bytes_sent,
+        'bytes' => LJ::Request->bytes_sent,
         'browser' => LJ::Request->header_in("User-Agent"),
         'secs' => $now - LJ::Request->request_time(),
         'ref' => LJ::Request->header_in("Referer"),

Modified: branches/modernize2/cgi-bin/LJ/NewWorker.pm
===================================================================
--- branches/modernize2/cgi-bin/LJ/NewWorker.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/LJ/NewWorker.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -196,8 +196,8 @@
 ##########################
 # Memory consuption checks
 
-use GTop ();
-my $gtop = GTop->new;
+#use GTop ();
+#my $gtop = GTop->new;
 my $last_mem_check = 0;
 
 sub set_memory_limit {

Modified: branches/modernize2/cgi-bin/LJ/Request/Apache.pm
===================================================================
--- branches/modernize2/cgi-bin/LJ/Request/Apache.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/LJ/Request/Apache.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -17,6 +17,7 @@
 sub LJ::Request::M_OPTIONS                 { return Apache::Constants::M_OPTIONS() }
 sub LJ::Request::NOT_FOUND                 { return Apache::Constants::NOT_FOUND() }
 sub LJ::Request::SERVER_ERROR              { return Apache::Constants::SERVER_ERROR() }
+sub LJ::Request::BAD_REQUEST               { return Apache::Constants::BAD_REQUEST() }
 #sub LJ::Request:: { return Apache::Constants::() }
 
 
@@ -136,6 +137,11 @@
     $instance->{apr}->method;
 }
 
+sub LJ::Request::bytes_sent {
+    my $class = shift;
+    $instance->{r}->bytes_sent(@_);
+}
+
 sub LJ::Request::document_root {
     my $class = shift;
     $instance->{apr}->document_root;

Modified: branches/modernize2/cgi-bin/LJ/Request/Apache2.pm
===================================================================
--- branches/modernize2/cgi-bin/LJ/Request/Apache2.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/LJ/Request/Apache2.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -25,9 +25,9 @@
 sub LJ::Request::M_TRACE                   { return Apache2::Const::M_TRACE() }
 sub LJ::Request::M_OPTIONS                 { return Apache2::Const::M_OPTIONS() }
 sub LJ::Request::SERVER_ERROR              { return Apache2::Const::SERVER_ERROR() }
+sub LJ::Request::BAD_REQUEST               { return Apache2::Const::BAD_REQUEST() }
 
 
-
 my $instance = '';
 sub LJ::Request::request { $instance }
 sub LJ::Request::r {
@@ -130,6 +130,11 @@
     $instance->{r}->method;
 }
 
+sub LJ::Request::bytes_sent {
+    my $class = shift;
+    $instance->{r}->bytes_sent(@_);
+}
+
 sub LJ::Request::document_root {
     my $class = shift;
     $instance->{r}->document_root;
@@ -198,10 +203,10 @@
     $instance = undef;
 }
 
-
+# use pnotes instead of notes
 sub LJ::Request::notes {
     my $class = shift;
-    $instance->{apr}->notes (@_);
+    $instance->{apr}->pnotes (@_);
 }
 
 sub LJ::Request::pnotes {

Modified: branches/modernize2/cgi-bin/LJ/Request.pm
===================================================================
--- branches/modernize2/cgi-bin/LJ/Request.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/LJ/Request.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -7,7 +7,7 @@
 BEGIN {
     if (MP2){
         require LJ::Request::Apache2;
-    } else {
+    } elsif($ENV{MOD_PERL_API_VERSION} or $ENV{MOD_PERL}) {
         require LJ::Request::Apache;
     }
 }

Modified: branches/modernize2/cgi-bin/LJ/URI.pm
===================================================================
--- branches/modernize2/cgi-bin/LJ/URI.pm	2010-01-22 12:16:14 UTC (rev 16118)
+++ branches/modernize2/cgi-bin/LJ/URI.pm	2010-01-25 04:38:20 UTC (rev 16119)
@@ -2,9 +2,6 @@
 use strict;
 
 package LJ::URI;
-use Apache::Constants qw(:common REDIRECT HTTP_NOT_MODIFIED
-                         HTTP_MOVED_PERMANENTLY HTTP_MOVED_TEMPORARILY
-                         M_TRACE M_OPTIONS);
 
 # Takes an Apache a path to BML filename relative to htdocs
 sub bml_handler {
@@ -13,7 +10,7 @@
     LJ::Request->handler("perl-script");
     LJ::Request->notes("bml_filename" => "$LJ::HOME/htdocs/$filename");
     LJ::Request->push_handlers(PerlHandler => \&Apache::BML::handler);
-    return OK;
+    return LJ::Request::OK;
 }
 
 # Handle a URI. Returns response if success, undef if not handled
@@ -37,7 +34,7 @@
 
     # handle URI redirects
     if (my $url = $LJ::URI_REDIRECT{$uri}) {
-        return Apache::LiveJournal::redir($url, HTTP_MOVED_TEMPORARILY);
+        return Apache::LiveJournal::redir($url, LJ::Request::HTTP_MOVED_TEMPORARILY);
     }
 
     # handle vertical URLs

Tags: livejournal, pm, vadvs
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments