| < draft-ietf-urn-ietf-04.txt | draft-ietf-urn-ietf-05.txt > | |||
|---|---|---|---|---|
| Internet-Draft Ryan Moats | Internet-Draft Ryan Moats | |||
| draft-ietf-urn-ietf-04.txt AT&T | draft-ietf-urn-ietf-05.txt AT&T | |||
| Expires in six months April 1998 | Expires in six months May 1998 | |||
| pl 10.0i | ||||
| A URN Namespace for IETF Documents | A URN Namespace for IETF Documents | |||
| Filename: draft-ietf-urn-ietf-04.txt | Filename: draft-ietf-urn-ietf-05.txt | |||
| Status of This Memo | Status of This Memo | |||
| This document is an Internet-Draft. Internet-Drafts are working | This document is an Internet-Draft. Internet-Drafts are working | |||
| documents of the Internet Engineering Task Force (IETF), its | documents of the Internet Engineering Task Force (IETF), its | |||
| areas, and its working groups. Note that other groups may also | areas, and its working groups. Note that other groups may also | |||
| distribute working documents as Internet-Drafts. | distribute working documents as Internet-Drafts. | |||
| Internet-Drafts are draft documents valid for a maximum of six | Internet-Drafts are draft documents valid for a maximum of six | |||
| months and may be updated, replaced, or obsoleted by other | months and may be updated, replaced, or obsoleted by other | |||
| skipping to change at page 2, line 5 ¶ | skipping to change at page 2, line 11 ¶ | |||
| This document has been restructured to use the template proposed in | This document has been restructured to use the template proposed in | |||
| draft-ietf-urn-nid-req-03.txt. Example Perl scripts for resolving | draft-ietf-urn-nid-req-03.txt. Example Perl scripts for resolving | |||
| this namespace have been supplied in an Appendix. | this namespace have been supplied in an Appendix. | |||
| 0.2 Changes from -03 | 0.2 Changes from -03 | |||
| Text was added to the template clarifying persistence and uniqueness. | Text was added to the template clarifying persistence and uniqueness. | |||
| Support for the BCP document series added to the examples and the | Support for the BCP document series added to the examples and the | |||
| ABNF. | ABNF. | |||
| 0.3 Changes from -04 | ||||
| More clarifications for the persistence section. In addition, | ||||
| cleaned up some typos and ensured that the Appendix examples are | ||||
| functional | ||||
| 1. Introduction | 1. Introduction | |||
| This document proposes the "ietf" namespace, which consists of the | This document proposes the "ietf" namespace, which consists of the | |||
| RFC family of documents (RFCs, STDs, FYIs, and BCPs) developed by the | RFC family of documents (RFCs, STDs, FYIs, and BCPs) developed by the | |||
| IETF and published by the RFC editor and the minutes of working | IETF and published by the RFC editor and the minutes of working | |||
| groups (WG) and birds of a feather (BOF) meetings that occur during | groups (WG) and birds of a feather (BOF) meetings that occur during | |||
| IETF conferences. | IETF conferences. | |||
| The namespace specification is for a formal namespace. | The namespace specification is for a formal namespace. | |||
| skipping to change at page 2, line 34 ¶ | skipping to change at page 2, line 46 ¶ | |||
| jayhawk@att.com | jayhawk@att.com | |||
| Declaration of structure: | Declaration of structure: | |||
| The identifier has the following ABNF [2] specification: | The identifier has the following ABNF [2] specification: | |||
| NSS = (family ":" number) / ("mtg-" number "-" wgbofname) | NSS = (family ":" number) / ("mtg-" number "-" wgbofname) | |||
| family = "rfc" / "std" / "fyi" / "bcp" | family = "rfc" / "std" / "fyi" / "bcp" | |||
| number = 1*DIGIT | number = 1*DIGIT | |||
| wgbofname = 1*LETDIGIT | wgbofname = 1*LETDIGIT | |||
| LETDIGIT = DIGIT / %x41..%x5a / %x61..%x7a | LETDIGIT = DIGIT / %x41-%x5a / %x61-%x7a | |||
| DIGIT = %x30..%x39 | DIGIT = %x30-%x39 | |||
| If the IESG (or it successor) adds a new document | If the IESG (or it successor) adds a new document | |||
| series, this ABNF specification will need to be | series, this ABNF specification will need to be | |||
| updated. Further, If a working group or BOF is | updated. Further, if a working group or BOF is | |||
| created that used characters outside the range of this | created that used characters outside the range of this | |||
| ABNF specification, this specification will need to be | ABNF specification, this specification will need to be | |||
| updated. Any system intended to resolve names for | updated. Any system intended to resolve names for | |||
| this namespace should be written with the awareness | this namespace should be written with the awareness | |||
| that this could occur at any time. | that this could occur at any time. | |||
| Identifier uniqueness considerations: | Identifier uniqueness considerations: | |||
| Because the rfc-editor assigns the RFC number uniquely | Because the rfc-editor assigns the RFC number uniquely | |||
| these URNs are unique. Since the mapping between RFCs | these URNs are unique. Since the mapping between RFCs | |||
| and other rfc-editor docuent series (STDs, FYIs or | and other rfc-editor document series (STDs, FYIs or | |||
| BCPs) is not necessarily one-to-one, uniqueness of | BCPs) is not necessarily one-to-one, uniqueness of | |||
| STDs, FYIs and BCPs are defined based on the document | STDs, FYIs and BCPs are defined based on the document | |||
| mappings maintained by the RFC Editor (the index files | mappings maintained by the RFC Editor (the index files | |||
| "rfc-index.txt", "fyi-index.txt", "bcp-index.txt" and | "rfc-index.txt", "fyi-index.txt", "bcp-index.txt" and | |||
| "std-index.txt") are defined to be the definitive | "std-index.txt") are defined to be the definitive | |||
| statement of the assignment of RFC Family URNs in this | statement of the assignment of RFC Family URNs in this | |||
| namespace. The meeting minutes portion of the | namespace. The meeting minutes portion of the | |||
| namespace is guaranteed unique because the URN | namespace is guaranteed unique because the URN | |||
| includes the sequence number of the IETF conference. | includes the sequence number of the IETF conference. | |||
| Identifier persistence considerations: | Identifier persistence considerations: | |||
| Persistence of the URNs of this namespace is dependent | Persistence of the URNs of this namespace is | |||
| on the persistence of the underlying documents. The | independent of the mutability of the underlying | |||
| fundamental difference between RFCs on one hand and | documents. A URN once assigned will never be | |||
| STDs, FYIs, or BCPs on the other is that only RFCs are | reassigned to a different resource; the assignment is | |||
| real, even persistent, documents while the others are | persistent and immutable. Distinct from this, the | |||
| just names for sets of one or more RFCs which may | resources identified as RFCs are immutable, whereas | |||
| change over time. | the other sorts of documents, STDs, FYIs, and BCPs are | |||
| not. They may be composites of one or more RFCs and | ||||
| the set of RFCs that comprise them may change with | ||||
| time. It is important to note that this mutability of | ||||
| some resources is independent of the immutability of | ||||
| URN assignment to a resource. | ||||
| Process of identifier assignment: | Process of identifier assignment: | |||
| Assignment of URNs from this namespace occur in two | Assignment of URNs from this namespace occurs in two | |||
| ways. The first is when a new RFC, FYI, STD or BCP is | ways. The first is when a new RFC, FYI, STD or BCP is | |||
| passed by the IESG and published by the RFC | passed by the IESG and published by the RFC | |||
| Editor. This new document will have a new series | Editor. This new document will have a new series | |||
| number and will therefore define a new URN. The | number and will therefore define a new URN. The | |||
| document mappings maintained by the RFC Editor (the | document mappings maintained by the RFC Editor (the | |||
| index files "rfc-index.txt", "fyi-index.txt", | index files "rfc-index.txt", "fyi-index.txt", | |||
| "bcp-index.txt" and "std-index.txt") are defined to be | "bcp-index.txt" and "std-index.txt") are defined to be | |||
| the definitive statement of the assignment of RFC | the definitive statement of the assignment of RFC | |||
| Family URNs in this namespace. | Family URNs in this namespace. | |||
| skipping to change at page 4, line 34 ¶ | skipping to change at page 5, line 13 ¶ | |||
| Cooperative Agreement NCR-9218179. | Cooperative Agreement NCR-9218179. | |||
| 4. References | 4. References | |||
| Request For Comments (RFC) and Internet Draft documents are available | Request For Comments (RFC) and Internet Draft documents are available | |||
| from <URL:ftp://ftp.internic.net> and numerous mirror sites. | from <URL:ftp://ftp.internic.net> and numerous mirror sites. | |||
| [1] R. Moats, "URN Syntax," RFC 2141, May 5, 1997. | [1] R. Moats, "URN Syntax," RFC 2141, May 5, 1997. | |||
| [2] D. Crocker, P. Overell, "Augmented BNF for Syntax Specifica- | [2] D. Crocker, P. Overell, "Augmented BNF for Syntax Specifica- | |||
| tions: ABNF," Internet Draft (work in progress), January | tions: ABNF," RFC 2234, November 1997. | |||
| 1997. | ||||
| 5. Author's Address | 5. Author's Address | |||
| Ryan Moats | Ryan Moats | |||
| AT&T | AT&T | |||
| 15621 Drexel Circle | 15621 Drexel Circle | |||
| Omaha, NE 68135-2358 | Omaha, NE 68135-2358 | |||
| USA | USA | |||
| Phone: +1 402 894-9456 | Phone: +1 402 894-9456 | |||
| skipping to change at page 5, line 40 ¶ | skipping to change at page 6, line 25 ¶ | |||
| (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | |||
| (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | |||
| &urn_error("400 Bad Request\n"); | &urn_error("400 Bad Request\n"); | |||
| sub resolve2 { | sub resolve2 { | |||
| my($ietfnum, $sesnam) = @_; | my($ietfnum, $sesnam) = @_; | |||
| &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | |||
| my($date)=$number2date{$ietfnum}; | my($date)=$number2date{$ietfnum}; | |||
| my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| print "HTTP/1.0 200 OK\r\n"; | print "Status: 200 OK\r\n"; | |||
| print "Content-type: text/html\r\n\r\n"; | print "Content-type: text/html\r\n\r\n"; | |||
| print "<HTML>\n<TITLE>Citation for $urn</TITLE>\n"; | print "<HTML>\n<TITLE>Citation for $urn</TITLE>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<H1><A HREF=\"$link\">$urn</A>:</H1>\n"; | print "<H1><A HREF=\"$link\">$urn</A>:</H1>\n"; | |||
| print "Minutes of the $sesnam working group from the " . &end($ietfnum) . " IETF"; | print "Minutes of the $sesnam working group from the " . &end($ietfnum) . " IETF"; | |||
| print "</BODY>\n</HTML>\n"; | print "</BODY>\n</HTML>\n"; | |||
| return; | return; | |||
| } | } | |||
| my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| print "HTTP/1.0 200 OK\r\n"; | print "Status: 200 OK\r\n"; | |||
| print "Content-type: text/html\r\n\r\n"; | print "Content-type: text/html\r\n\r\n"; | |||
| print "<HTML>\n<TITLE>Citation for $urn</TITLE>\n"; | print "<HTML>\n<TITLE>Citation for $urn</TITLE>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<H1><A HREF=\"$link\">$urn</A>:</H1>\n"; | print "<H1><A HREF=\"$link\">$urn</A>:</H1>\n"; | |||
| print "Minutes of the $sesnam working group from the " . &end($ietfnum) . " IETF"; | print "Minutes of the $sesnam working group from the " . &end($ietfnum) . " IETF"; | |||
| print "</BODY>\n</HTML>\n"; | print "</BODY>\n</HTML>\n"; | |||
| return; | return; | |||
| } | } | |||
| &urn_error("404 Not Found\n"); | &urn_error("404 Not Found\n"); | |||
| } | } | |||
| skipping to change at page 6, line 38 ¶ | skipping to change at page 7, line 29 ¶ | |||
| while (<INPUT>) { | while (<INPUT>) { | |||
| $flag = 1 if (/^0*$value /); | $flag = 1 if (/^0*$value /); | |||
| if ($flag == 1) { | if ($flag == 1) { | |||
| last if (/^$/); | last if (/^$/); | |||
| chop; | chop; | |||
| push @bib,$_; | push @bib,$_; | |||
| } | } | |||
| } | } | |||
| if ($scheme ne "rfc") { | if ($scheme ne "rfc") { | |||
| print "HTTP/1.0 200 OK\r\n"; | print "Status: 200 OK\r\n"; | |||
| print "Content-type: text/html\r\n\r\n"; | print "Content-type: text/html\r\n\r\n"; | |||
| $bib[0] =~ s/^[0-9]*\s*/<B>/; | $bib[0] =~ s/^[0-9]*\s*/<B>/; | |||
| for ($i=0; $i<=$#bib; $i+=1) { | for ($i=0; $i<=$#bib; $i+=1) { | |||
| last if ($bib[$i] =~ s/\./.<\/B>/); | last if ($bib[$i] =~ s/\./.<\/B>/); | |||
| } | } | |||
| for ($i=0;$i<=$#bib;$i+=1) { | for ($i=0;$i<=$#bib;$i+=1) { | |||
| $k=$bib[$i]; | $k=$bib[$i]; | |||
| while ($k =~ /(fyi|std|rfc|bcp)([0-9]+)(.*)/i) { | while ($k =~ /(fyi|std|rfc|bcp)([0-9]+)(.*)/i) { | |||
| push @ref,"$1$2"; | push @ref,"$1$2"; | |||
| $k=$3; | $k=$3; | |||
| skipping to change at page 7, line 4 ¶ | skipping to change at page 7, line 49 ¶ | |||
| $k=$3; | $k=$3; | |||
| } | } | |||
| $done=""; | $done=""; | |||
| foreach $j (@ref) { | foreach $j (@ref) { | |||
| next if ($done =~ $j); | next if ($done =~ $j); | |||
| $done .= "$j "; | $done .= "$j "; | |||
| $l = $j; | $l = $j; | |||
| $l =~ tr/A-Z/a-z/; | $l =~ tr/A-Z/a-z/; | |||
| $link=&make_link("$l"); | $link=&make_link("$l"); | |||
| $bib[$i] =~ s/$j/<A HREF="$link">$j<\/A>/g; | $bib[$i] =~ s/$j/<A HREF="$link">$j<\/A>/g; | |||
| } | } | |||
| } | } | |||
| print "<HTML>\n<TITLE>Citation for $urn</TITLE>\n"; | print "<HTML>\n<TITLE>Citation for $urn</TITLE>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| $link=&make_link("$scheme$value"); | $link=&make_link("$scheme$value"); | |||
| print "<H1><A HREF=\"$link\">$scheme$value</A>:</H1>\n"; | print "<H1><A HREF=\"$link\">$scheme$value</A>:</H1>\n"; | |||
| foreach $i (@bib) { | foreach $i (@bib) { | |||
| print "$i\n"; | print "$i\n"; | |||
| } | } | |||
| print "</BODY>\n</HTML>\n"; | print "</BODY>\n</HTML>\n"; | |||
| } else { | } else { | |||
| print "HTTP/1.0 200 OK\r\n"; | print "Status: 200 OK\r\n"; | |||
| print "Content-type: text/html\r\n\r\n"; | print "Content-type: text/html\r\n\r\n"; | |||
| $bib[0] =~ s/^[0-9]*\s*//; | $bib[0] =~ s/^[0-9]*\s*//; | |||
| $j=0; | $j=0; | |||
| for ($i=0; $i<=$#bib; $i+=1) { | for ($i=0; $i<=$#bib; $i+=1) { | |||
| $j += ($bib[$i] =~ s/, "/, <B>"/); | $j += ($bib[$i] =~ s/, "/, <B>"/); | |||
| $j += ($bib[$i] =~ s/",/"<\/B>,/); | $j += ($bib[$i] =~ s/",/"<\/B>,/); | |||
| } | } | |||
| for ($i=0;$i<=$#bib;$i+=1) { | for ($i=0;$i<=$#bib;$i+=1) { | |||
| $k=$bib[$i]; | $k=$bib[$i]; | |||
| while ($k =~ /(fyi\s|std\s|rfc|bcp)([0-9]+)(.*)/i) { | while ($k =~ /(fyi\s|std\s|rfc|bcp)([0-9]+)(.*)/i) { | |||
| skipping to change at page 8, line 4 ¶ | skipping to change at page 9, line 7 ¶ | |||
| } | } | |||
| } | } | |||
| sub make_link { | sub make_link { | |||
| my($sc); | my($sc); | |||
| my($inarg)=@_; | my($inarg)=@_; | |||
| ($sc=$1) if ($inarg =~ /([a-z]*)/); | ($sc=$1) if ($inarg =~ /([a-z]*)/); | |||
| return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); | return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); | |||
| return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); | return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); | |||
| return "/$sc/$inarg.txt"; | return "/$sc/$inarg.txt"; | |||
| } | } | |||
| sub urn_error { | sub urn_error { | |||
| my($code) = @_; #store failure code here... | my($code) = @_; #store failure code here... | |||
| print "HTTP/1.0 $code"; | print "Status: $code"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2C $code</title></head>\n"; | print "<head><title>URN Resolution: I2C $code</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN to URC resolution failed for the URN:</h1>\n"; | print "<h1>URN to URC resolution failed for the URN:</h1>\n"; | |||
| print "<hr><h3>$urn</h3>\n"; | print "<hr><h3>$urn</h3>\n"; | |||
| print "</body>\n"; | print "</body>\n"; | |||
| print "</html>\n"; | print "</html>\n"; | |||
| exit; | exit; | |||
| }; | }; | |||
| skipping to change at page 9, line 9 ¶ | skipping to change at page 10, line 18 ¶ | |||
| (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | |||
| (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | |||
| &urn_error("400 Bad Request\n"); | &urn_error("400 Bad Request\n"); | |||
| sub resolve2 { | sub resolve2 { | |||
| my($ietfnum, $sesnam) = @_; | my($ietfnum, $sesnam) = @_; | |||
| &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | |||
| my($date)=$number2date{$ietfnum}; | my($date)=$number2date{$ietfnum}; | |||
| my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| print "HTTP/1.0 302 Moved temporarily\n"; | print "Status: 302 Moved temporarily\n"; | |||
| print "Location: $link\n"; | print "Location: $link\n"; | |||
| return; | return; | |||
| } | } | |||
| my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| print "HTTP/1.0 302 Moved temporarily\n"; | print "Status: 302 Moved temporarily\n"; | |||
| print "Location: $link\n"; | print "Location: $link\n"; | |||
| return; | return; | |||
| } | } | |||
| &urn_error("404 Not Found\n"); | &urn_error("404 Not Found\n"); | |||
| } | } | |||
| sub end { | sub end { | |||
| my($inarg)=@_; | my($inarg)=@_; | |||
| return $inarg . "st" if ($inarg =~ /1$/); | return $inarg . "st" if ($inarg =~ /1$/); | |||
| return $inarg . "nd" if ($inarg =~ /2$/); | return $inarg . "nd" if ($inarg =~ /2$/); | |||
| skipping to change at page 9, line 41 ¶ | skipping to change at page 10, line 50 ¶ | |||
| my($flag,@bib,$i,$k,$j,$done,@ref); | my($flag,@bib,$i,$k,$j,$done,@ref); | |||
| my($l,$link); | my($l,$link); | |||
| my($scheme, $value) = @_; | my($scheme, $value) = @_; | |||
| $scheme =~ tr/A-Z/a-z/; | $scheme =~ tr/A-Z/a-z/; | |||
| &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); | &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); | |||
| my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; | my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; | |||
| my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; | my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; | |||
| my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; | my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; | |||
| MIME_SWITCH: { | MIME_SWITCH: { | |||
| if ($accept =~ /application\/postscript/ && -f $pstry) { | if ($accept =~ /application\/postscript/ && -f $pstry) { | |||
| print "HTTP/1.0 302 Moved temporarily\n"; | print "Status: 302 Moved temporarily\n"; | |||
| print "Location: http://$host/$pathbase{$scheme}$value.ps\n\n"; | print "Location: http://$host/$pathbase{$scheme}$value.ps\n\n"; | |||
| last MIME_SWITCH; | last MIME_SWITCH; | |||
| } | } | |||
| if ($accept =~ /text\/html/ && -f $htmltry) { | if ($accept =~ /text\/html/ && -f $htmltry) { | |||
| print "HTTP/1.0 302 Moved temporarily\n"; | print "Status: 302 Moved temporarily\n"; | |||
| print "Location: http://$host/$pathbase{$scheme}$value.html\n\n"; | print "Location: http://$host/$pathbase{$scheme}$value.html\n\n"; | |||
| last MIME_SWITCH; | last MIME_SWITCH; | |||
| } | } | |||
| if ($accept =~ /\*\/\*|text\/plain/ && -f $txttry) { | if ($accept =~ /\*\/\*|text\/plain/ && -f $txttry) { | |||
| print "HTTP/1.0 302 Moved temporarily\n"; | print "Status: 302 Moved temporarily\n"; | |||
| print "Location: http://$host/$pathbase{$scheme}$value.txt\n\n"; | print "Location: http://$host/$pathbase{$scheme}$value.txt\n\n"; | |||
| last MIME_SWITCH; | last MIME_SWITCH; | |||
| } | } | |||
| &urn_error("404 Not Found\n"); | &urn_error("404 Not Found\n"); | |||
| } | } | |||
| } | } | |||
| sub urn_error { | sub urn_error { | |||
| my($code) = @_; #store failure code here... | my($code) = @_; #store failure code here... | |||
| print "HTTP/1.0 $code"; | print "Status: $code"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2L $code</title></head>\n"; | print "<head><title>URN Resolution: I2L $code</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN to URL resolution failed for the URN:</h1>\n"; | print "<h1>URN to URL resolution failed for the URN:</h1>\n"; | |||
| print "<hr><h3>$urn</h3>\n"; | print "<hr><h3>$urn</h3>\n"; | |||
| print "</body>\n"; | print "</body>\n"; | |||
| print "</html>\n"; | print "</html>\n"; | |||
| exit; | exit; | |||
| } | } | |||
| skipping to change at page 11, line 4 ¶ | skipping to change at page 12, line 23 ¶ | |||
| 19 => "90dec" ); | 19 => "90dec" ); | |||
| my($wgpath) = "/ftp/ietf"; | my($wgpath) = "/ftp/ietf"; | |||
| my($urn) = $ENV{'QUERY_STRING'}; | my($urn) = $ENV{'QUERY_STRING'}; | |||
| my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs | my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs | |||
| my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header | my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header | |||
| (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | |||
| (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | |||
| &urn_error("400 Bad Request\n"); | &urn_error("400 Bad Request\n"); | |||
| sub resolve2 { | sub resolve2 { | |||
| my($ietfnum, $sesnam) = @_; | my($ietfnum, $sesnam) = @_; | |||
| &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | |||
| my($date)=$number2date{$ietfnum}; | my($date)=$number2date{$ietfnum}; | |||
| my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| $link=~s/^\/ftp\///; | $link=~s/^\/ftp\///; | |||
| my($ftplink)="ftp://$host/$link"; | my($ftplink)="ftp://$host/$link"; | |||
| my($httplink)="http://$host/$link"; | my($httplink)="http://$host/$link"; | |||
| my($glink)="gopher://$host:70/0/$link"; | my($glink)="gopher://$host:70/0/$link"; | |||
| if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html | if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/uri-list\n\n\n"; | print "Content-type: text/uri-list\n\n\n"; | |||
| print "#$urn\n"; | print "#$urn\n"; | |||
| print "$ftplink\n"; | print "$ftplink\n"; | |||
| print "$httplink\n"; | print "$httplink\n"; | |||
| print "$glink\n"; | print "$glink\n"; | |||
| } | } | |||
| if ($accept =~ /\*\/\*|text\/html/) { | if ($accept =~ /\*\/\*|text\/html/) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2Ls</title></head>\n"; | print "<head><title>URN Resolution: I2Ls</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN $urn resolves to the following URLs:</h1>\n"; | print "<h1>URN $urn resolves to the following URLs:</h1>\n"; | |||
| print "<hr><ul>\n"; | print "<hr><ul>\n"; | |||
| print "<a href=\"$ftplink\">$ftplink</a>\n"; | print "<a href=\"$ftplink\">$ftplink</a>\n"; | |||
| print "<a href=\"$httplink\">$httplink</a>\n"; | print "<a href=\"$httplink\">$httplink</a>\n"; | |||
| print "<a href=\"$glink\">$glink</a>\n"; | print "<a href=\"$glink\">$glink</a>\n"; | |||
| print "</UL>\n</body>\n</HTML>\n"; | print "</UL>\n</body>\n</HTML>\n"; | |||
| } | } | |||
| return; | return; | |||
| } | } | |||
| my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| $link=~s/^\/ftp\///; | $link=~s/^\/ftp\///; | |||
| my($ftplink)="ftp://$host/$link"; | my($ftplink)="ftp://$host/$link"; | |||
| my($httplink)="http://$host/$link"; | my($httplink)="http://$host/$link"; | |||
| my($glink)="gopher://$host:70/0/$link"; | my($glink)="gopher://$host:70/0/$link"; | |||
| if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html | if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/uri-list\n\n\n"; | print "Content-type: text/uri-list\n\n\n"; | |||
| print "#$urn\n"; | print "#$urn\n"; | |||
| print "$ftplink\n"; | print "$ftplink\n"; | |||
| print "$httplink\n"; | print "$httplink\n"; | |||
| print "$glink\n"; | print "$glink\n"; | |||
| } | } | |||
| if ($accept =~ /\*\/\*|text\/html/) { | if ($accept =~ /\*\/\*|text\/html/) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2Ls</title></head>\n"; | print "<head><title>URN Resolution: I2Ls</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN $urn resolves to the following URLs:</h1>\n"; | print "<h1>URN $urn resolves to the following URLs:</h1>\n"; | |||
| print "<hr><ul>\n"; | print "<hr><ul>\n"; | |||
| print "<a href=\"$ftplink\">$ftplink</a>\n"; | print "<a href=\"$ftplink\">$ftplink</a>\n"; | |||
| print "<a href=\"$httplink\">$httplink</a>\n"; | print "<a href=\"$httplink\">$httplink</a>\n"; | |||
| print "<a href=\"$glink\">$glink</a>\n"; | print "<a href=\"$glink\">$glink</a>\n"; | |||
| print "</UL>\n</body>\n</HTML>\n"; | print "</UL>\n</body>\n</HTML>\n"; | |||
| } | } | |||
| skipping to change at page 12, line 41 ¶ | skipping to change at page 14, line 20 ¶ | |||
| $try="/ftp/$pathbase{$scheme}$value.html"; | $try="/ftp/$pathbase{$scheme}$value.html"; | |||
| if (-f $try) { | if (-f $try) { | |||
| push(@urls, "http://$host/$pathbase{$scheme}$value.html"); | push(@urls, "http://$host/$pathbase{$scheme}$value.html"); | |||
| push(@urls, "ftp://$host/$pathbase{$scheme}$value.html"); | push(@urls, "ftp://$host/$pathbase{$scheme}$value.html"); | |||
| } | } | |||
| &urn_error("404 Not Found\n") if ($#urls == -1); | &urn_error("404 Not Found\n") if ($#urls == -1); | |||
| MIME_SWITCH: { | MIME_SWITCH: { | |||
| if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html | if ($accept =~ /text\/uri-list/) { #look for text/uri-list, otherwise text/html | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/uri-list\n\n\n"; | print "Content-type: text/uri-list\n\n\n"; | |||
| print "#$urn\n"; | print "#$urn\n"; | |||
| foreach $i (@urls) { | foreach $i (@urls) { | |||
| print "$i\n"; | print "$i\n"; | |||
| } | } | |||
| last MIME_SWITCH; | last MIME_SWITCH; | |||
| } | } | |||
| if ($accept =~ /\*\/\*|text\/html/) { | if ($accept =~ /\*\/\*|text\/html/) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2Ls</title></head>\n"; | print "<head><title>URN Resolution: I2Ls</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN $urn resolves to the following URLs:</h1>\n"; | print "<h1>URN $urn resolves to the following URLs:</h1>\n"; | |||
| print "<hr><ul>\n"; | print "<hr><ul>\n"; | |||
| foreach $i (@urls) { | foreach $i (@urls) { | |||
| print "<LI><A HREF=\"$i\">$i</A>\n"; | print "<LI><A HREF=\"$i\">$i</A>\n"; | |||
| } | } | |||
| print "</UL>\n</body>\n</HTML>\n"; | print "</UL>\n</body>\n</HTML>\n"; | |||
| last MIME_SWITCH; | last MIME_SWITCH; | |||
| } | } | |||
| } | } | |||
| } | } | |||
| sub urn_error { | sub urn_error { | |||
| my($code) = @_; #store failure code here... | my($code) = @_; #store failure code here... | |||
| print "HTTP/1.0 $code"; | print "Status: $code"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2Ls $code</title></head>\n"; | print "<head><title>URN Resolution: I2Ls $code</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN to URL resolution failed for the URN:</h1>\n"; | print "<h1>URN to URL resolution failed for the URN:</h1>\n"; | |||
| print "<hr><h3>$urn</h3>\n"; | print "<hr><h3>$urn</h3>\n"; | |||
| print "</body>\n"; | print "</body>\n"; | |||
| print "</html>\n"; | print "</html>\n"; | |||
| exit; | exit; | |||
| } | } | |||
| skipping to change at page 14, line 4 ¶ | skipping to change at page 15, line 42 ¶ | |||
| 31 => "94dec", 30 => "94jul", 29 => "94mar", | 31 => "94dec", 30 => "94jul", 29 => "94mar", | |||
| 28 => "93nov", 27 => "93jul", 26 => "93mar", | 28 => "93nov", 27 => "93jul", 26 => "93mar", | |||
| 25 => "92nov", 24 => "92jul", 23 => "92mar", | 25 => "92nov", 24 => "92jul", 23 => "92mar", | |||
| 22 => "91nov", 21 => "91jul", 20 => "91mar", | 22 => "91nov", 21 => "91jul", 20 => "91mar", | |||
| 19 => "90dec" ); | 19 => "90dec" ); | |||
| my($wgpath) = "/ftp/ietf"; | my($wgpath) = "/ftp/ietf"; | |||
| my($urn) = $ENV{'QUERY_STRING'}; | my($urn) = $ENV{'QUERY_STRING'}; | |||
| my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs | my($host) = $ENV{'SERVER_NAME'}; #get my host name for ftp: URLs | |||
| my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header | my($accept) = $ENV{'HTTP_ACCEPT'}; #this is the "Accept:" HTTP header | |||
| (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | |||
| (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | |||
| &urn_error("400 Bad Request\n"); | &urn_error("400 Bad Request\n"); | |||
| sub resolve2 { | sub resolve2 { | |||
| my($ietfnum, $sesnam) = @_; | my($ietfnum, $sesnam) = @_; | |||
| &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | |||
| my($date)=$number2date{$ietfnum}; | my($date)=$number2date{$ietfnum}; | |||
| my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| if ($accept =~ /text\/uri-list/) { | if ($accept =~ /text\/uri-list/) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/uri-list\n\n\n"; | print "Content-type: text/uri-list\n\n\n"; | |||
| print "#$urn\n"; | print "#$urn\n"; | |||
| return; | return; | |||
| } | } | |||
| if ($accept =~ /\*\/\*|text\/html/) { | if ($accept =~ /\*\/\*|text\/html/) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2Ns</title></head>\n"; | print "<head><title>URN Resolution: I2Ns</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN $urn resolves to the following URNs:</h1>\n"; | print "<h1>URN $urn resolves to the following URNs:</h1>\n"; | |||
| print "<hr><ul>\n"; | print "<hr><ul>\n"; | |||
| print "</UL>\n</body>\n</HTML>\n"; | print "</UL>\n</body>\n</HTML>\n"; | |||
| return; | return; | |||
| } | } | |||
| } | } | |||
| my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| if ($accept =~ /text\/uri-list/) { | if ($accept =~ /text\/uri-list/) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/uri-list\n\n\n"; | print "Content-type: text/uri-list\n\n\n"; | |||
| print "#$urn\n"; | print "#$urn\n"; | |||
| return; | return; | |||
| } | } | |||
| if ($accept =~ /\*\/\*|text\/html/) { | if ($accept =~ /\*\/\*|text\/html/) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2Ns</title></head>\n"; | print "<head><title>URN Resolution: I2Ns</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN $urn resolves to the following URNs:</h1>\n"; | print "<h1>URN $urn resolves to the following URNs:</h1>\n"; | |||
| print "<hr><ul>\n"; | print "<hr><ul>\n"; | |||
| print "</UL>\n</body>\n</HTML>\n"; | print "</UL>\n</body>\n</HTML>\n"; | |||
| return; | return; | |||
| } | } | |||
| } | } | |||
| &urn_error("404 Not Found\n"); | &urn_error("404 Not Found\n"); | |||
| skipping to change at page 15, line 40 ¶ | skipping to change at page 17, line 37 ¶ | |||
| $a=$2; $b=$3; | $a=$2; $b=$3; | |||
| if (($a ne $scheme || $b ne $value) && ($1 !~ /obso/i)){ | if (($a ne $scheme || $b ne $value) && ($1 !~ /obso/i)){ | |||
| $a =~ tr/A-Z/a-z/; | $a =~ tr/A-Z/a-z/; | |||
| $b =~ s/^0*//; | $b =~ s/^0*//; | |||
| push @ref,"urn:ietf:$a:$b"; | push @ref,"urn:ietf:$a:$b"; | |||
| } | } | |||
| } | } | |||
| MIME_SWITCH: { | MIME_SWITCH: { | |||
| if ($accept =~ /text\/uri-list/) { | if ($accept =~ /text\/uri-list/) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/uri-list\n\n\n"; | print "Content-type: text/uri-list\n\n\n"; | |||
| print "#$urn\n"; | print "#$urn\n"; | |||
| foreach $i (@ref) { | foreach $i (@ref) { | |||
| print "$i\n"; | print "$i\n"; | |||
| } | } | |||
| last MIME_SWITCH; | last MIME_SWITCH; | |||
| } | } | |||
| if ($accept =~ /\*\/\*|text\/html/) { | if ($accept =~ /\*\/\*|text\/html/) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2Ns</title></head>\n"; | print "<head><title>URN Resolution: I2Ns</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN $urn resolves to the following URNs:</h1>\n"; | print "<h1>URN $urn resolves to the following URNs:</h1>\n"; | |||
| print "<hr><ul>\n"; | print "<hr><ul>\n"; | |||
| foreach $i (@ref) { | foreach $i (@ref) { | |||
| print "<li>$i: Click to resolve using\n"; | print "<li>$i: Click to resolve using\n"; | |||
| print "<a href=\"http://$host:$port/uri-res/I2C?$i\">I2C</a>,\n"; | print "<a href=\"http://$host:$port/uri-res/I2C?$i\">I2C</a>,\n"; | |||
| print "<a href=\"http://$host:$port/uri-res/I2L?$i\">I2L</a>,\n"; | print "<a href=\"http://$host:$port/uri-res/I2L?$i\">I2L</a>,\n"; | |||
| print "<a href=\"http://$host:$port/uri-res/I2Ls?$i\">I2Ls</a>,\n"; | print "<a href=\"http://$host:$port/uri-res/I2Ls?$i\">I2Ls</a>,\n"; | |||
| skipping to change at page 16, line 26 ¶ | skipping to change at page 18, line 29 ¶ | |||
| my($inarg)=@_; | my($inarg)=@_; | |||
| ($sc=$1) if ($inarg =~ /([a-z]*)/); | ($sc=$1) if ($inarg =~ /([a-z]*)/); | |||
| return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); | return "/$sc/$inarg.ps" if (-e "/ftp/$sc/$inarg.ps"); | |||
| return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); | return "/$sc/$inarg.html" if (-e "/ftp/$sc/$inarg.html"); | |||
| return "/$sc/$inarg.txt"; | return "/$sc/$inarg.txt"; | |||
| } | } | |||
| sub urn_error { | sub urn_error { | |||
| my($code) = @_; #store failure code here... | my($code) = @_; #store failure code here... | |||
| print "HTTP/1.0 $code"; | print "Status: $code"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2Ns $code</title></head>\n"; | print "<head><title>URN Resolution: I2Ns $code</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN to URC resolution failed for the URN:</h1>\n"; | print "<h1>URN to URC resolution failed for the URN:</h1>\n"; | |||
| print "<hr><h3>$urn</h3>\n"; | print "<hr><h3>$urn</h3>\n"; | |||
| print "</body>\n"; | print "</body>\n"; | |||
| print "</html>\n"; | print "</html>\n"; | |||
| exit; | exit; | |||
| }; | }; | |||
| skipping to change at page 17, line 26 ¶ | skipping to change at page 19, line 35 ¶ | |||
| (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | (&resolve1($1, $2), exit) if ($urn =~ /urn:ietf:(\w*):(\d*)/i); | |||
| (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | (&resolve2($1, $2), exit) if ($urn =~ /urn:ietf:mtg-(\d*)-(\w*)/i); | |||
| &urn_error("400 Bad Request\n"); | &urn_error("400 Bad Request\n"); | |||
| sub resolve2 { | sub resolve2 { | |||
| my($ietfnum, $sesnam) = @_; | my($ietfnum, $sesnam) = @_; | |||
| &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | |||
| my($date)=$number2date{$ietfnum}; | my($date)=$number2date{$ietfnum}; | |||
| my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/plain\n\n"; | print "Content-type: text/plain\n\n"; | |||
| open(FILE, "$link"); | open(FILE, "$link"); | |||
| while (<FILE>) { | while (<FILE>) { | |||
| print $_; | print $_; | |||
| } | } | |||
| close FILE; | close FILE; | |||
| return; | return; | |||
| } | } | |||
| my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$date/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/plain\n\n"; | print "Content-type: text/plain\n\n"; | |||
| open(FILE, "$link"); | open(FILE, "$link"); | |||
| while (<FILE>) { | while (<FILE>) { | |||
| print $_; | print $_; | |||
| } | } | |||
| close FILE; | close FILE; | |||
| return; | return; | |||
| } | } | |||
| &urn_error("404 Not Found\n"); | &urn_error("404 Not Found\n"); | |||
| } | } | |||
| skipping to change at page 18, line 14 ¶ | skipping to change at page 20, line 29 ¶ | |||
| my($flag,@bib,$i,$k,$j,$done,@ref); | my($flag,@bib,$i,$k,$j,$done,@ref); | |||
| my($l,$link); | my($l,$link); | |||
| my($scheme, $value) = @_; | my($scheme, $value) = @_; | |||
| $scheme =~ tr/A-Z/a-z/; | $scheme =~ tr/A-Z/a-z/; | |||
| &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); | &urn_error("404 Not Found\n")if (!defined $pathbase{$scheme}); | |||
| my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; | my($txttry)="/ftp/$pathbase{$scheme}$value.txt"; | |||
| my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; | my($pstry)="/ftp/$pathbase{$scheme}$value.ps"; | |||
| my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; | my($htmltry)="/ftp/$pathbase{$scheme}$value.html"; | |||
| MIME_SWITCH: { | MIME_SWITCH: { | |||
| if ($accept =~ /application\/postscript/ && -f $pstry) { | if ($accept =~ /application\/postscript/ && -f $pstry) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: application/postscript\n\n"; | print "Content-type: application/postscript\n\n"; | |||
| open(FILE, "$pstry"); | open(FILE, "$pstry"); | |||
| while (<FILE>) { | while (<FILE>) { | |||
| print $_; | print $_; | |||
| } | } | |||
| close FILE; | close FILE; | |||
| last MIME_SWITCH; | last MIME_SWITCH; | |||
| } | } | |||
| if ($accept =~ /text\/html/ && -f $htmltry) { | if ($accept =~ /text\/html/ && -f $htmltry) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/html\n\n"; | print "Content-type: text/html\n\n"; | |||
| open(FILE, "$htmltry"); | open(FILE, "$htmltry"); | |||
| while (<FILE>) { | while (<FILE>) { | |||
| print $_; | print $_; | |||
| } | } | |||
| close FILE; | close FILE; | |||
| last MIME_SWITCH; | last MIME_SWITCH; | |||
| } | } | |||
| if ($accept =~ /\*\/\*|text\/plain/ && -f $txttry) { | if ($accept =~ /\*\/\*|text\/plain/ && -f $txttry) { | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: text/plain\n\n"; | print "Content-type: text/plain\n\n"; | |||
| open(FILE, "$txttry"); | open(FILE, "$txttry"); | |||
| while (<FILE>) { | while (<FILE>) { | |||
| print $_; | print $_; | |||
| } | } | |||
| close FILE; | close FILE; | |||
| last MIME_SWITCH; | last MIME_SWITCH; | |||
| } | } | |||
| &urn_error("404 Not Found\n"); | &urn_error("404 Not Found\n"); | |||
| } | } | |||
| } | } | |||
| sub urn_error { | sub urn_error { | |||
| my($code) = @_; #store failure code here... | my($code) = @_; #store failure code here... | |||
| print "HTTP/1.0 $code"; | print "Status: $code"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2R $code</title></head>\n"; | print "<head><title>URN Resolution: I2R $code</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN to URL resolution failed for the URN:</h1>\n"; | print "<h1>URN to URL resolution failed for the URN:</h1>\n"; | |||
| print "<hr><h3>$urn</h3>\n"; | print "<hr><h3>$urn</h3>\n"; | |||
| print "</body>\n"; | print "</body>\n"; | |||
| print "</html>\n"; | print "</html>\n"; | |||
| exit; | exit; | |||
| } | } | |||
| skipping to change at page 20, line 4 ¶ | skipping to change at page 22, line 31 ¶ | |||
| my(@vers,$i); | my(@vers,$i); | |||
| &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | &urn_error("404 Not Found\n") if (!defined $number2date{$ietfnum}); | |||
| my($date)=$number2date{$ietfnum}; | my($date)=$number2date{$ietfnum}; | |||
| my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | my($link)="$wgpath/$sesnam/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| push(@vers,$link); | push(@vers,$link); | |||
| } | } | |||
| $link="$wgpath/$date/$sesnam-minutes-$date.txt"; | $link="$wgpath/$date/$sesnam-minutes-$date.txt"; | |||
| if (-f $link) { | if (-f $link) { | |||
| push(@vers,$link); | push(@vers,$link); | |||
| } | } | |||
| &urn_error("404 Not Found\n") if ($#vers==-1); | &urn_error("404 Not Found\n") if ($#vers==-1); | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: multipart/alternative; boundary=endpart\n\n"; | print "Content-type: multipart/alternative; boundary=endpart\n\n"; | |||
| foreach $i (@vers) { | foreach $i (@vers) { | |||
| print "--endpart\n"; | print "--endpart\n"; | |||
| if ($i =~ /html$/) { | if ($i =~ /html$/) { | |||
| print "Content-Type: text/html\n\n"; | print "Content-Type: text/html\n\n"; | |||
| } | } | |||
| if ($i =~ /txt$/) { | if ($i =~ /txt$/) { | |||
| print "Content-Type: text/plain\n\n"; | print "Content-Type: text/plain\n\n"; | |||
| } | } | |||
| if ($i =~ /ps$/) { | if ($i =~ /ps$/) { | |||
| skipping to change at page 20, line 48 ¶ | skipping to change at page 23, line 27 ¶ | |||
| push(@vers, $try); | push(@vers, $try); | |||
| } | } | |||
| $try="/ftp/$pathbase{$scheme}$value.ps"; | $try="/ftp/$pathbase{$scheme}$value.ps"; | |||
| if (-f $try) { | if (-f $try) { | |||
| push(@vers, $try); | push(@vers, $try); | |||
| } | } | |||
| $try="/ftp/$pathbase{$scheme}$value.html"; | $try="/ftp/$pathbase{$scheme}$value.html"; | |||
| if (-f $try) { | if (-f $try) { | |||
| push(@vers, $try); | push(@vers, $try); | |||
| } | } | |||
| print "HTTP/1.0 200 OK\n"; | print "Status: 200 OK\n"; | |||
| print "Content-type: multipart/alternative; boundary=endpart\n\n"; | print "Content-type: multipart/alternative; boundary=endpart\n\n"; | |||
| foreach $i (@vers) { | foreach $i (@vers) { | |||
| print "--endpart\n"; | print "--endpart\n"; | |||
| if ($i =~ /html$/) { | if ($i =~ /html$/) { | |||
| print "Content-Type: text/html\n\n"; | print "Content-Type: text/html\n\n"; | |||
| } | } | |||
| if ($i =~ /txt$/) { | if ($i =~ /txt$/) { | |||
| print "Content-Type: text/plain\n\n"; | print "Content-Type: text/plain\n\n"; | |||
| } | } | |||
| if ($i =~ /ps$/) { | if ($i =~ /ps$/) { | |||
| skipping to change at page 21, line 18 ¶ | skipping to change at page 23, line 52 ¶ | |||
| print "$_"; | print "$_"; | |||
| } | } | |||
| close FILE; | close FILE; | |||
| } | } | |||
| print "--endpart\n"; | print "--endpart\n"; | |||
| } | } | |||
| sub urn_error { | sub urn_error { | |||
| my($code) = @_; #store failure code here... | my($code) = @_; #store failure code here... | |||
| print "HTTP/1.0 $code"; | print "Status: $code"; | |||
| print "Content-type: text/html\n\n<HTML>\n"; | print "Content-type: text/html\n\n<HTML>\n"; | |||
| print "<head><title>URN Resolution: I2Rs $code</title></head>\n"; | print "<head><title>URN Resolution: I2Rs $code</title></head>\n"; | |||
| print "<BODY>\n"; | print "<BODY>\n"; | |||
| print "<h1>URN to URL resolution failed for the URN:</h1>\n"; | print "<h1>URN to URL resolution failed for the URN:</h1>\n"; | |||
| print "<hr><h3>$urn</h3>\n"; | print "<hr><h3>$urn</h3>\n"; | |||
| print "</body>\n"; | print "</body>\n"; | |||
| print "</html>\n"; | print "</html>\n"; | |||
| exit; | exit; | |||
| } | } | |||
| End of changes. 50 change blocks. | ||||
| 56 lines changed or deleted | 64 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||