/[meteor]/googlecode.com/svn/trunk/Meteor/Document.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 /googlecode.com/svn/trunk/Meteor/Document.pm

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

revision 31 by knops.gerd, Sun May 20 19:40:53 2007 UTC revision 32 by andrew.betts, Thu Dec 20 21:24:24 2007 UTC
# Line 68  sub emitHeaderToClient { Line 68  sub emitHeaderToClient {
68          my $self=shift;          my $self=shift;
69          my $client=shift;          my $client=shift;
70          my $status=shift;          my $status=shift;
71            my $length=shift;
72            my $contenttype=shift;
73            $length = 0 unless ($length);
74            $contenttype = "text/html" unless ($contenttype);
75                    
76          my $header=$::CONF{'DocumentHeaderTemplate'};          my $header="HTTP/1.1 ".$status."\r\nServer: ".$::PGM."\r\nContent-Type: ".$contenttype."; charset=utf-8\r\nPragma: no-cache\r\nCache-Control: no-cache, no-store, must-revalidate\r\nExpires: Thu, 1 Jan 1970 00:00:00 GMT\r\nContent-length: ".$length."\r\n\r\n";
           
         $header=~s/~([^~]+)~/  
                 if(!defined($1) || $1 eq '')  
                 {  
                         '~';  
                 }  
                 elsif($1 eq 'server')  
                 {  
                         $::PGM;  
                 }  
                 elsif($1 eq 'status')  
                 {  
                         $status;  
                 }  
                 else  
                 {  
                         '';  
                 }  
         /gex;  
77                    
78          $client->write($header);          $client->write($header);
79  }  }
# Line 248  sub newDocument { Line 233  sub newDocument {
233  sub serveTo {  sub serveTo {
234          my $self=shift;          my $self=shift;
235          my $client=shift;          my $client=shift;
236            my $ct = "text/html";
237            if ($self->{'path'} =~/\.(js)$/) {
238                    $ct = "text/javascript";
239            }
240                    
241          $self->emitHeaderToClient($client,'200 OK');          $self->emitHeaderToClient($client,'200 OK',$self->{'size'}, $ct);
242                    
243          $client->write($self->{'document'});          $client->write($self->{'document'});
244    
245  }  }
246    
247  sub path {  sub path {

Legend:
Removed from v.31  
changed lines
  Added in v.32

  ViewVC Help
Powered by ViewVC 1.1.26