Skip to content

Commit dec48b7

Browse files
committed
Improve documentation readability
1 parent b6efdc3 commit dec48b7

3 files changed

Lines changed: 28 additions & 27 deletions

File tree

Changes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Revision history for HTTP-Daemon
22

33
{{$NEXT}}
4+
- Improve documentation readability (GH#36) (Ferenc Erki)
45

56
6.06 2019-08-29 14:23:17Z
67
- Delimit IPv6 numeric address with brackets and URI-quote an IPv6 zone
@@ -34,7 +35,7 @@ Revision history for HTTP-Daemon
3435
6.01 2012-02-18
3536
- If you bind localhost, don't trust gethostbyaddr() to resolve the address.
3637
RT#67247
37-
- Restore perl-5.8.1 compatiblity.
38+
- Restore perl-5.8.1 compatibility.
3839

3940
6.00 2011-02-25
4041
- Initial release of HTTP-Daemon as a separate distribution. There are no code

README.pod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ version 6.06
1919
print "Please contact me at: <URL:", $d->url, ">\n";
2020
while (my $c = $d->accept) {
2121
while (my $r = $c->get_request) {
22-
if ($r->method eq 'GET' and $r->uri->path eq "/xyzzy") {
22+
if ($r->method eq 'GET' and $r->uri->path eq "/xyzzy") {
2323
# remember, this is *not* recommended practice :-)
24-
$c->send_file_response("/etc/passwd");
25-
}
26-
else {
27-
$c->send_error(RC_FORBIDDEN)
28-
}
24+
$c->send_file_response("/etc/passwd");
25+
}
26+
else {
27+
$c->send_error(RC_FORBIDDEN)
28+
}
2929
}
3030
$c->close;
3131
undef($c);
@@ -289,7 +289,7 @@ L<IO::Socket::IP>, L<IO::Socket>
289289

290290
=head1 SUPPORT
291291

292-
bugs may be submitted through L<https://github.com/libwww-perl/HTTP-Daemon/issues>.
292+
Bugs may be submitted through L<https://github.com/libwww-perl/HTTP-Daemon/issues>.
293293

294294
There is also a mailing list available for users of this distribution, at
295295
L<mailto:libwww@perl.org>.

lib/HTTP/Daemon.pm

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -639,13 +639,13 @@ __END__
639639
print "Please contact me at: <URL:", $d->url, ">\n";
640640
while (my $c = $d->accept) {
641641
while (my $r = $c->get_request) {
642-
if ($r->method eq 'GET' and $r->uri->path eq "/xyzzy") {
642+
if ($r->method eq 'GET' and $r->uri->path eq "/xyzzy") {
643643
# remember, this is *not* recommended practice :-)
644-
$c->send_file_response("/etc/passwd");
645-
}
646-
else {
647-
$c->send_error(RC_FORBIDDEN)
648-
}
644+
$c->send_file_response("/etc/passwd");
645+
}
646+
else {
647+
$c->send_error(RC_FORBIDDEN)
648+
}
649649
}
650650
$c->close;
651651
undef($c);
@@ -693,15 +693,15 @@ HTTP port will be constructed like this:
693693
);
694694
695695
See L<IO::Socket::IP> for a description of other arguments that can
696-
be used configure the daemon during construction.
696+
be used to configure the daemon during construction.
697697
698698
=item $c = $d->accept
699699
700700
=item $c = $d->accept( $pkg )
701701
702702
=item ($c, $peer_addr) = $d->accept
703703
704-
This method works the same the one provided by the base class, but it
704+
This method works the same as the one provided by the base class, but it
705705
returns an C<HTTP::Daemon::ClientConn> reference by default. If a
706706
package name is provided as argument, then the returned object will be
707707
blessed into the given class. It is probably a good idea to make that
@@ -712,7 +712,7 @@ and no connection is made within the given time. The timeout() method
712712
is described in L<IO::Socket::IP>.
713713
714714
In list context both the client object and the peer address will be
715-
returned; see the description of the accept method L<IO::Socket> for
715+
returned; see the description of the accept method of L<IO::Socket> for
716716
details.
717717
718718
=item $d->url
@@ -731,8 +731,8 @@ replaced with the version number of this module.
731731
732732
=back
733733
734-
The C<HTTP::Daemon::ClientConn> is a C<IO::Socket::IP>
735-
subclass. Instances of this class are returned by the accept() method
734+
The C<HTTP::Daemon::ClientConn> is a subclass of C<IO::Socket::IP>.
735+
Instances of this class are returned by the accept() method
736736
of C<HTTP::Daemon>. The following methods are provided:
737737
738738
=over 4
@@ -744,7 +744,7 @@ of C<HTTP::Daemon>. The following methods are provided:
744744
This method reads data from the client and turns it into an
745745
C<HTTP::Request> object which is returned. It returns C<undef>
746746
if reading fails. If it fails, then the C<HTTP::Daemon::ClientConn>
747-
object ($c) should be discarded, and you should not try call this
747+
object ($c) should be discarded, and you should not try to call this
748748
method again on it. The $c->reason method might give you some
749749
information about why $c->get_request failed.
750750
@@ -802,8 +802,8 @@ body must be generated for these requests.
802802
=item $c->force_last_request
803803
804804
Make sure that $c->get_request will not try to read more requests off
805-
this connection. If you generate a response that is not self
806-
delimiting, then you should signal this fact by calling this method.
805+
this connection. If you generate a response that is not self-delimiting,
806+
then you should signal this fact by calling this method.
807807
808808
This attribute is turned on automatically if the client announces
809809
protocol HTTP/1.0 or worse and does not include a "Connection:
@@ -850,16 +850,16 @@ Send one or more header lines.
850850
851851
=item $c->send_response( $res )
852852
853-
Write a C<HTTP::Response> object to the
853+
Write an C<HTTP::Response> object to the
854854
client as a response. We try hard to make sure that the response is
855-
self delimiting so that the connection can stay persistent for further
855+
self-delimiting so that the connection can stay persistent for further
856856
request/response exchanges.
857857
858858
The content attribute of the C<HTTP::Response> object can be a normal
859859
string or a subroutine reference. If it is a subroutine, then
860860
whatever this callback routine returns is written back to the
861861
client as the response content. The routine will be called until it
862-
return an undefined or empty value. If the client is HTTP/1.1 aware
862+
returns an undefined or empty value. If the client is HTTP/1.1 aware
863863
then we will use chunked transfer encoding for the response.
864864
865865
=item $c->send_redirect( $loc )
@@ -869,7 +869,7 @@ then we will use chunked transfer encoding for the response.
869869
=item $c->send_redirect( $loc, $code, $entity_body )
870870
871871
Send a redirect response back to the client. The location ($loc) can
872-
be an absolute or relative URL. The $code must be one the redirect
872+
be an absolute or relative URL. The $code must be one of the redirect
873873
status codes, and defaults to "301 Moved Permanently"
874874
875875
=item $c->send_error
@@ -880,7 +880,7 @@ status codes, and defaults to "301 Moved Permanently"
880880
881881
Send an error response back to the client. If the $code is missing a
882882
"Bad Request" error is reported. The $error_message is a string that
883-
is incorporated in the body of the HTML entity body.
883+
is incorporated in the body of the HTML entity.
884884
885885
=item $c->send_file_response( $filename )
886886

0 commit comments

Comments
 (0)