/[Frey]/trunk/lib/Frey/Server.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Server.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 476 by dpavlin, Wed Nov 19 15:35:34 2008 UTC revision 477 by dpavlin, Thu Nov 20 13:57:38 2008 UTC
# Line 64  sub main { Line 64  sub main {
64    
65          eval {          eval {
66    
67                  #warn "REQUEST: $path ",dump( $req->params );                  sub refresh {
68                            my $url = shift || '/';
69                            warn "# refresh $url";
70                            qq|
71                                    <html>
72                                    <head>
73                                            <META HTTP-EQUIV="Refresh" CONTENT="1; URL=$url"></META>
74                                    </head>
75                                    <body>
76                                            Refresh <a href="$url"><tt>$url</tt></a>
77                                    </body>
78                                    </html>
79                                    \n\r\n\r
80                            |; # XXX newlines at end are important to flush content to browser
81                    }
82    
83                  if ( $path =~ m!reload! || $req->param('reload') ) {                  if ( $path =~ m{/reload(.*)} ) {
                         warn "# reload!";  
                         Module::Reload->check;  
84                          Frey::Server->new->load_config;                          Frey::Server->new->load_config;
85                            Module::Reload->check;
86                            warn "# reload done";
87                            $req->print( refresh( $1 ) );
88                            return;
89                    } elsif ( $path =~ m{/exit(.*)} ) {
90                            # FIXME do we need some kind of check here for production? :-)
91                            # ./bin/dev.sh will restart us during development
92                            $req->print( refresh( $1 ) );
93                            exit;
94                  }                  }
95    
96  #               warn $req->request->header('User_Agent');  #               warn $req->request->header('User_Agent');
# Line 125  sub main { Line 146  sub main {
146                  }                  }
147    
148                  if ( $f ) {                  if ( $f ) {
149                            push @{ $f->status }, { req => $req };
150                          $req->print( $f->html );                          $req->print( $f->html );
151                  } else {                  } else {
152                          warn "# can't call request on nothing!";                          warn "# can't call request on nothing!";

Legend:
Removed from v.476  
changed lines
  Added in v.477

  ViewVC Help
Powered by ViewVC 1.1.26