cvsuser     05/03/13 05:04:14

  Modified:    .        RELEASE_INSTRUCTIONS
               examples/io httpd.imc
               lib/Parrot/Docs/Section Info.pm
  Log:
  Changed the document root of the tiny HTTP server, in order to make links
  in http://localhost:1234/docs/html/info.html work.
  Added a redirect to http://localhost:1234/docs/html/index.html when getting
  http://localhost:1234.
  Added a hint to set PARROT_NET_DEVEL in include/io_private.h.
  -------------
  Mention docs/ROADMAP in RELEASE_INSTRUCTIONS and
  in lib/Parrot/Docs/Section/Info.pm.
  
  Revision  Changes    Path
  1.14      +3 -1      parrot/RELEASE_INSTRUCTIONS
  
  Index: RELEASE_INSTRUCTIONS
  ===================================================================
  RCS file: /cvs/public/parrot/RELEASE_INSTRUCTIONS,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- RELEASE_INSTRUCTIONS      8 Mar 2005 08:51:32 -0000       1.13
  +++ RELEASE_INSTRUCTIONS      13 Mar 2005 13:04:10 -0000      1.14
  @@ -1,3 +1,5 @@
  +# $Id: RELEASE_INSTRUCTIONS,v 1.14 2005/03/13 13:04:10 bernhard Exp $
  +
   To prepare a release:
   
       0.  Announce to perl6-internals and #parrot at least a
  @@ -17,7 +19,7 @@
   
           c.  Update README.
   
  -        d.  Update ChangeLog and NEWS.
  +        d.  Update ChangeLog, NEWS and docs/ROADMAP.
   
           e.  Make sure nothing in TODO has been done.
   
  
  
  
  1.2       +41 -26    parrot/examples/io/httpd.imc
  
  Index: httpd.imc
  ===================================================================
  RCS file: /cvs/public/parrot/examples/io/httpd.imc,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- httpd.imc 14 Feb 2005 10:57:19 -0000      1.1
  +++ httpd.imc 13 Mar 2005 13:04:12 -0000      1.2
  @@ -31,7 +31,7 @@
   
   =cut
   
  -.sub _main
  +.sub main @MAIN
       .local pmc sock
       .local pmc work
       .local pmc fp
  @@ -43,33 +43,34 @@
       .local int ret
       .local int len
       .local int pos
  -     .local int occ1
  -     .local int occ2
  -     .local string meth
  -     .local string url
  -     .local string doc_root
  -     .local string file_con
  +    .local int occ1
  +    .local int occ2
  +    .local string meth
  +    .local string url
  +    .local string doc_root
  +    .local string file_con
   
  -     .local string tst
  -     .local string tst2
  +    .local string tst
  +    .local string tst2
   
  -     doc_root = "docs"
  +    doc_root = "."
   
       socket sock, 2, 1, 0
  -    unless sock goto ERR
  +    unless sock goto ERR_NO_SOCKET
   
       # Pack a sockaddr_in structure with IP and port
       sockaddr address, 1234, "localhost"
  -    print "Binding to port 1234\n"
  +    print "Binding to port 1234.\n"
  +    print "The Parrot documentation can now be accessed at 
http://localhost:1234 .\n"
       bind ret, sock, address
   
   
   NEXT:
       listen ret, sock, 5
   
  -     accept work, sock
  +    accept work, sock
   
  -     req = ""
  +    req = ""
   MORE:
       recv ret, work, buf
       if ret <= 0 goto SERVE_REQ
  @@ -107,9 +108,8 @@
       # decode the url
        url = urldecode (url)
        # open the file in url
  -     if url !="/" goto GET2
  -     url = "/index.html"
  -     GET2:
  +     if url == "/" goto SERVE_301
  +     rep = "HTTP/1.x 301 OK\n"
        concat url, doc_root, url
        open fp, url, "<"
        unless fp goto SERVE_404
  @@ -124,7 +124,7 @@
        concat rep, temp
        concat rep, "\n\n"
        concat rep, file_con
  -
  +        SEND:
        send ret, work, rep
   
        print "served file '"
  @@ -132,15 +132,27 @@
        print "'\n"
        goto NEXT
   
  +SERVE_301:
  +    rep = "HTTP1/1 301 Moved Permamently\nLocation: 
/docs/html/index.html\nContent-Length: "
  +    file_con = "Please go to <a href='docs/html/index.html'>Parrot 
Documentation</a>." 
  +    length len, file_con
  +    temp = to_string (len)
  +    concat rep, temp
  +    concat rep, "\n\n"
  +    concat rep, file_con
  +    send ret, work, rep
  +    print "Redirect to 'docs/html/index.hmtl'\n"
  +    goto NEXT
   SERVE_404:
  -     rep = "HTTP1/1 404 Not Found\nContent-Length: 3\n\n404\n"
  -     print "File not found: '"
  -     print url
  -     print "'\n"
  -     send ret, work, rep
  -     goto NEXT
  -ERR:
  -    print "Socket error\n"
  +    rep = "HTTP1/1 404 Not Found\nContent-Length: 3\n\n404\n"
  +    print "File not found: '"
  +    print url
  +    print "'\n"
  +    send ret, work, rep
  +    goto NEXT
  +ERR_NO_SOCKET:
  +    print "Could not open socket.\n"
  +    print "Did you enable PARROT_NET_DEVEL in include/io_private.h?\n"
       end
   END:
       close sock
  @@ -150,6 +162,7 @@
   
   .sub to_string
        .param int n
  +
        .local string ret
        .local string char
        .local int rest
  @@ -173,6 +186,7 @@
   
   .sub urldecode
        .param string in
  +
        .local string out
        .local string char_in
        .local string char_out
  @@ -209,6 +223,7 @@
   
   .sub hex_to_int
        .param string in
  +
        .local string char
        .local int ret
        .local int pos
  
  
  
  1.8       +2 -1      parrot/lib/Parrot/Docs/Section/Info.pm
  
  Index: Info.pm
  ===================================================================
  RCS file: /cvs/public/parrot/lib/Parrot/Docs/Section/Info.pm,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Info.pm   20 Feb 2005 19:25:37 -0000      1.7
  +++ Info.pm   13 Mar 2005 13:04:14 -0000      1.8
  @@ -1,5 +1,5 @@
   # Copyright: 2004 The Perl Foundation.  All Rights Reserved.
  -# $Id: Info.pm,v 1.7 2005/02/20 19:25:37 bernhard Exp $
  +# $Id: Info.pm,v 1.8 2005/03/13 13:04:14 bernhard Exp $
   
   =head1 NAME
   
  @@ -43,6 +43,7 @@
                $self->new_group('Documentation', '',
                        $self->new_item('General information about licences, 
prerequisites, and building instructions.', 'README'),
                        $self->new_item('This file lists what\'s new in each 
version.', 'NEWS'),
  +                     $self->new_item('A plan for Parrot.', 'docs/ROADMAP'),
                        $self->new_item('A list of things that need doing in 
Parrot.', 'TODO'),
                        $self->new_item('This is a description of the steps 
someone should follow when they have to prepare a new version for release.', 
'RELEASE_INSTRUCTIONS'),
                ),
  
  
  

Reply via email to