ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/myhttpd/httpd.pl
(Generate patch)

Comparing Coro/myhttpd/httpd.pl (file contents):
Revision 1.27 by root, Sun Aug 19 23:57:52 2001 UTC vs.
Revision 1.28 by root, Mon Aug 20 16:58:19 2001 UTC

150 150
151sub response { 151sub response {
152 my ($self, $code, $msg, $hdr, $content) = @_; 152 my ($self, $code, $msg, $hdr, $content) = @_;
153 my $res = "HTTP/1.1 $code $msg\015\012"; 153 my $res = "HTTP/1.1 $code $msg\015\012";
154 154
155 #$res .= "Connection: close\015\012"; 155 $self->{h}{connection} ||= $hdr->{Connection};
156
156 $res .= "Date: ".(time2str $::NOW)."\015\012"; # slow? nah. :( 157 $res .= "Date: ".(time2str $::NOW)."\015\012"; # slow? nah. :(
157 158
158 while (my ($h, $v) = each %$hdr) { 159 while (my ($h, $v) = each %$hdr) {
159 $res .= "$h: $v\015\012" 160 $res .= "$h: $v\015\012"
160 } 161 }
198 { 199 {
199 "Content-Type" => "text/html", 200 "Content-Type" => "text/html",
200 "Retry-After" => $::BLOCKTIME, 201 "Retry-After" => $::BLOCKTIME,
201 "Warning" => "Please do NOT retry, you have been blocked", 202 "Warning" => "Please do NOT retry, you have been blocked",
202 "WWW-Authenticate" => "Basic realm=\"Please do NOT retry, you have been blocked\"", 203 "WWW-Authenticate" => "Basic realm=\"Please do NOT retry, you have been blocked\"",
204 "Connection" => "close",
203 }, 205 },
204 <<EOF); 206 <<EOF);
205<html> 207<html>
206<head> 208<head>
207<title>Too many connections</title> 209<title>Too many connections</title>
212may retry at</p> 214may retry at</p>
213 215
214 <p><blockquote>$time.</blockquote></p> 216 <p><blockquote>$time.</blockquote></p>
215 217
216<p>Until then, each new access will renew the block. You might want to have a 218<p>Until then, each new access will renew the block. You might want to have a
217look at the <a href="http://www.goof.com/pcg/marc/animefaq.html">FAQ</a>.</p> 219look at the <a href="http://www.goof.com/pcg/marc/animefaq.html#connectionlimit">FAQ</a>.</p>
218 220
219</body></html> 221</body></html>
220EOF 222EOF
221} 223}
222 224
459 461
460satisfiable: 462satisfiable:
461 # check for segmented downloads 463 # check for segmented downloads
462 if ($l && $::NO_SEGMENTED) { 464 if ($l && $::NO_SEGMENTED) {
463 if (%{$uri{$self->{remote_addr}}{$self->{uri}}} > 1) { 465 if (%{$uri{$self->{remote_addr}}{$self->{uri}}} > 1) {
464 $self->err(400, "segmented downloads are not allowed"); 466 $self->err(400, "segmented downloads are not allowed",
467 { "Content-Type" => "text/html", Connection => "close" }, <<EOF);
468<html>
469<head>
470<title>Segmented downloads are not allowed</title>
471</head>
472<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000080" alink="#ff0000">
473
474<p>Segmented downloads are not allowed on this server. Please refer to the
475<a href="http://www.goof.com/pcg/marc/animefaq.html#segmented_downloads">FAQ</a>.</p>
476
477</body></html>
478EOF
479EOF
465 } 480 }
466 } 481 }
467 482
468 $hdr->{"Content-Range"} = "bytes $l-$h/$length"; 483 $hdr->{"Content-Range"} = "bytes $l-$h/$length";
469 @code = (206, "partial content"); 484 @code = (206, "partial content");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines