Skip to content

Commit

Permalink
fix a few typos in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 11, 2017
1 parent b8d2b04 commit 8a405d8
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

7.46 2017-09-07
7.46 2017-09-11

7.45 2017-09-06
- Fixed support for versions of IO::Socket::SSL older than 1.965. (mudler,
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Asset.pm
Expand Up @@ -91,7 +91,7 @@ subclass.
my $bytes = $asset->get_chunk($offset, $max);
Get chunk of data starting from a specific position, defaults to a maximum
chunk size of C<131072> bytes (128KB). Meant to be overloaded in a subclass.
chunk size of C<131072> bytes (128KiB). Meant to be overloaded in a subclass.
=head2 is_file
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Asset/File.pm
Expand Up @@ -208,7 +208,7 @@ Check if asset contains a specific string.
my $bytes = $file->get_chunk($offset, $max);
Get chunk of data starting from a specific position, defaults to a maximum
chunk size of C<131072> bytes (128KB).
chunk size of C<131072> bytes (128KiB).
=head2 is_file
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Asset/Memory.pm
Expand Up @@ -106,7 +106,7 @@ automatically upgrade to a L<Mojo::Asset::File> object.
Maximum size in bytes of data to keep in memory before automatically upgrading
to a L<Mojo::Asset::File> object, defaults to the value of the
C<MOJO_MAX_MEMORY_SIZE> environment variable or C<262144> (256KB).
C<MOJO_MAX_MEMORY_SIZE> environment variable or C<262144> (256KiB).
=head2 mtime
Expand Down Expand Up @@ -139,7 +139,7 @@ Check if asset contains a specific string.
my $bytes = $mem->get_chunk($offset, $max);
Get chunk of data starting from a specific position, defaults to a maximum
chunk size of C<131072> bytes (128KB).
chunk size of C<131072> bytes (128KiB).
=head2 move_to
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Content.pm
Expand Up @@ -385,7 +385,7 @@ Content headers, defaults to a L<Mojo::Headers> object.
$content = $content->max_buffer_size(1024);
Maximum size in bytes of buffer for content parser, defaults to the value of
the C<MOJO_MAX_BUFFER_SIZE> environment variable or C<262144> (256KB).
the C<MOJO_MAX_BUFFER_SIZE> environment variable or C<262144> (256KiB).
=head2 max_leftover_size
Expand All @@ -394,7 +394,7 @@ the C<MOJO_MAX_BUFFER_SIZE> environment variable or C<262144> (256KB).
Maximum size in bytes of buffer for pipelined HTTP requests, defaults to the
value of the C<MOJO_MAX_LEFTOVER_SIZE> environment variable or C<262144>
(256KB).
(256KiB).
=head2 relaxed
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Headers.pm
Expand Up @@ -191,7 +191,7 @@ L<Mojo::Headers> implements the following attributes.
$headers = $headers->max_line_size(1024);
Maximum header line size in bytes, defaults to the value of the
C<MOJO_MAX_LINE_SIZE> environment variable or C<8192> (8KB).
C<MOJO_MAX_LINE_SIZE> environment variable or C<8192> (8KiB).
=head2 max_lines
Expand Down
10 changes: 5 additions & 5 deletions lib/Mojo/Message.pm
Expand Up @@ -380,15 +380,15 @@ defaults to C<UTF-8>.
$msg = $msg->max_line_size(1024);
Maximum start-line size in bytes, defaults to the value of the
C<MOJO_MAX_LINE_SIZE> environment variable or C<8192> (8KB).
C<MOJO_MAX_LINE_SIZE> environment variable or C<8192> (8KiB).
=head2 max_message_size
my $size = $msg->max_message_size;
$msg = $msg->max_message_size(1024);
Maximum message size in bytes, defaults to the value of the
C<MOJO_MAX_MESSAGE_SIZE> environment variable or C<16777216> (16MB). Setting
C<MOJO_MAX_MESSAGE_SIZE> environment variable or C<16777216> (16MiB). Setting
the value to C<0> will allow messages of indefinite size.
=head2 version
Expand Down Expand Up @@ -419,7 +419,7 @@ C<multipart/form-data> message body, usually a L<Mojo::Parameters> object. Note
that this method caches all data, so it should not be called before the entire
message body has been received. Parts of the message body need to be loaded
into memory to parse C<POST> parameters, so you have to make sure it is not
excessively large. There's a 16MB limit for requests and a 2GB limit for
excessively large. There's a 16MiB limit for requests and a 2GiB limit for
responses by default.
# Get POST parameter names and values
Expand Down Expand Up @@ -479,7 +479,7 @@ right away, which then returns a L<Mojo::Collection> object. Note that this
method caches all data, so it should not be called before the entire message
body has been received. The whole message body needs to be loaded into memory
to parse it, so you have to make sure it is not excessively large. There's a
16MB limit for requests and a 2GB limit for responses by default.
16MiB limit for requests and a 2GiB limit for responses by default.
# Perform "find" right away
say $msg->dom('h1, h2, h3')->map('text')->join("\n");
Expand Down Expand Up @@ -601,7 +601,7 @@ Pointer can be used to extract a specific value with L<Mojo::JSON::Pointer>.
Note that this method caches all data, so it should not be called before the
entire message body has been received. The whole message body needs to be
loaded into memory to parse it, so you have to make sure it is not excessively
large. There's a 16MB limit for requests and a 2GB limit for responses by
large. There's a 16MiB limit for requests and a 2GiB limit for responses by
default.
# Extract JSON values
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Message/Request.pm
Expand Up @@ -412,7 +412,7 @@ than just the last one, you can use L</"every_param">. Note that this method
caches all data, so it should not be called before the entire request body has
been received. Parts of the request body need to be loaded into memory to parse
C<POST> parameters, so you have to make sure it is not excessively large.
There's a 16MB limit for requests by default.
There's a 16MiB limit for requests by default.
=head2 params
Expand All @@ -423,7 +423,7 @@ C<application/x-www-form-urlencoded> or C<multipart/form-data> message body,
usually a L<Mojo::Parameters> object. Note that this method caches all data, so
it should not be called before the entire request body has been received. Parts
of the request body need to be loaded into memory to parse C<POST> parameters,
so you have to make sure it is not excessively large. There's a 16MB limit for
so you have to make sure it is not excessively large. There's a 16MiB limit for
requests by default.
# Get parameter names and values
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Message/Response.pm
Expand Up @@ -211,7 +211,7 @@ HTTP response status code.
$res = $res->max_message_size(1024);
Maximum message size in bytes, defaults to the value of the
C<MOJO_MAX_MESSAGE_SIZE> environment variable or C<2147483648> (2GB). Setting
C<MOJO_MAX_MESSAGE_SIZE> environment variable or C<2147483648> (2GiB). Setting
the value to C<0> will allow messages of indefinite size.
=head2 message
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Transaction/WebSocket.pm
Expand Up @@ -355,7 +355,7 @@ Mask outgoing frames with XOR cipher and a random 32-bit key.
$ws = $ws->max_websocket_size(1024);
Maximum WebSocket message size in bytes, defaults to the value of the
C<MOJO_MAX_WEBSOCKET_SIZE> environment variable or C<262144> (256KB).
C<MOJO_MAX_WEBSOCKET_SIZE> environment variable or C<262144> (256KiB).
=head1 METHODS
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent.pm
Expand Up @@ -911,7 +911,7 @@ object, depending on if the handshake was successful.
You can activate C<permessage-deflate> compression by setting the
C<Sec-WebSocket-Extensions> header, this can result in much better performance,
but also increases memory usage by up to 300KB per connection.
but also increases memory usage by up to 300KiB per connection.
$ua->websocket('ws://example.com/foo' => {
'Sec-WebSocket-Extensions' => 'permessage-deflate'
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent/CookieJar.pm
Expand Up @@ -168,7 +168,7 @@ A callback used to decide if a cookie should be ignored by L</"collect">.
my $size = $jar->max_cookie_size;
$jar = $jar->max_cookie_size(4096);
Maximum cookie size in bytes, defaults to C<4096> (4KB).
Maximum cookie size in bytes, defaults to C<4096> (4KiB).
=head1 METHODS
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Command/get.pm
Expand Up @@ -175,7 +175,7 @@ Mojolicious::Command::get - Get command
of MOJO_CONNECT_TIMEOUT or 10
-r, --redirect Follow up to 10 redirects
-S, --response-size <size> Maximum response size in bytes,
defaults to 2147483648 (2GB)
defaults to 2147483648 (2GiB)
-v, --verbose Print request and response headers to
STDERR
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -432,7 +432,7 @@ underlying connection might get closed early.
my $address = $c->tx->remote_address;
my $port = $c->tx->remote_port;
# Increase size limit for WebSocket messages to 16MB
# Increase size limit for WebSocket messages to 16MiB
$c->tx->max_websocket_size(16777216) if $c->tx->is_websocket;
# Perform non-blocking operation without knowing the connection status
Expand Down Expand Up @@ -584,7 +584,7 @@ message body, in that order. If there are multiple values sharing the same
name, and you want to access more than just the last one, you can use
L</"every_param">. Parts of the request body need to be loaded into memory to
parse C<POST> parameters, so you have to make sure it is not excessively large.
There's a 16MB limit for requests by default.
There's a 16MiB limit for requests by default.
# Get first value
my $first = $c->every_param('foo')->[0];
Expand Down Expand Up @@ -840,7 +840,7 @@ usually defaults to C<15> seconds.
Persistent data storage for the next few requests, all session data gets
serialized with L<Mojo::JSON> and stored Base64 encoded in HMAC-SHA1 signed
cookies, to prevent tampering. Note that cookies usually have a C<4096> byte
(4KB) limit, depending on browser.
(4KiB) limit, depending on browser.
# Manipulate session
$c->session->{foo} = 'bar';
Expand Down Expand Up @@ -931,7 +931,7 @@ validate file uploads as well as C<GET> and C<POST> parameters extracted from
the query string and C<application/x-www-form-urlencoded> or
C<multipart/form-data> message body. Parts of the request body need to be loaded
into memory to parse C<POST> parameters, so you have to make sure it is not
excessively large. There's a 16MB limit for requests by default.
excessively large. There's a 16MiB limit for requests by default.
# Validate GET/POST parameter
my $validation = $c->validation;
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -787,7 +787,7 @@ the WebSocket connection has been closed.

You can activate C<permessage-deflate> compression with
L<Mojo::Transaction::WebSocket/"with_compression">, this can result in much
better performance, but also increases memory usage by up to 300KB per
better performance, but also increases memory usage by up to 300KiB per
connection.

my $proto = $c->tx->with_protocols('v2.proto', 'v1.proto');
Expand Down Expand Up @@ -1135,7 +1135,7 @@ L<Mojo::UserAgent::Transactor/"tx">.

When downloading large files with L<Mojo::UserAgent> you don't have to worry
about memory usage at all, because it will automatically stream everything
above 250KB into a temporary file, which can then be moved into a permanent
above 250KiB into a temporary file, which can then be moved into a permanent
file with L<Mojo::Asset::File/"move_to">.

use Mojo::UserAgent;
Expand All @@ -1145,11 +1145,11 @@ file with L<Mojo::Asset::File/"move_to">.
my $tx = $ua->get('https://www.github.com/kraih/mojo/tarball/master');
$tx->result->content->asset->move_to('mojo.tar.gz');

To protect you from excessively large files there is also a limit of 2GB by
To protect you from excessively large files there is also a limit of 2GiB by
default, which you can tweak with the attribute
L<Mojo::UserAgent/"max_response_size">.

# Increase limit to 10GB
# Increase limit to 10GiB
$ua->max_response_size(10737418240);

=head2 Large file upload
Expand Down
10 changes: 5 additions & 5 deletions lib/Mojolicious/Guides/FAQ.pod
Expand Up @@ -134,24 +134,24 @@ Hypnotoad.

To protect your applications from excessively large requests and responses, our
HTTP parser has a cap after which it will automatically stop accepting new
data, and in most cases force the connection to be closed. The limit is 16MB for
requests, and 2GB for responses by default. You can use the attributes
data, and in most cases force the connection to be closed. The limit is 16MiB
for requests, and 2GiB for responses by default. You can use the attributes
L<Mojolicious/"max_request_size"> and L<Mojo::UserAgent/"max_response_size"> to
change these values.

=head2 What does the error "Maximum start-line size exceeded" mean?

This is a very similar protection mechanism to the one described in the
previous answer, but a little more specific. It limits the maximum length of
the start-line for HTTP requests and responses. The limit is 8KB by default,
the start-line for HTTP requests and responses. The limit is 8KiB by default,
you can use the attribute L<Mojo::Message/"max_line_size"> or
C<MOJO_MAX_LINE_SIZE> environment variable to change this value.

=head2 What does the error "Maximum header size exceeded" mean?

Almost the same as the previous answer, but this protection mechanism limits
the number and maximum length of HTTP request and response headers. The limits
are 100 headers with 8KB each by default, you can use the attributes
are 100 headers with 8KiB each by default, you can use the attributes
L<Mojo::Headers/"max_lines"> and L<Mojo::Headers/"max_line_size"> or the
C<MOJO_MAX_LINES> and C<MOJO_MAX_LINE_SIZE> environment variables to change
these values.
Expand All @@ -160,7 +160,7 @@ these values.

This protection mechanism limits how much content the HTTP parser is allowed to
buffer when parsing chunked, compressed and multipart messages. The limit is
around 256KB by default, you can use the attribute
around 256KiB by default, you can use the attribute
L<Mojo::Content/"max_buffer_size"> or C<MOJO_MAX_BUFFER_SIZE> environment
variable to change this value.

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Growing.pod
Expand Up @@ -431,7 +431,7 @@ through the method L<Mojolicious::Controller/"flash">.
$c->redirect_to('goodbye');

Just remember that all session data gets serialized with L<Mojo::JSON> and
stored in HMAC-SHA1 signed cookies, which usually have a C<4096> byte (4KB)
stored in HMAC-SHA1 signed cookies, which usually have a C<4096> byte (4KiB)
limit, depending on browser.

=head2 Final prototype
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Guides/Tutorial.pod
Expand Up @@ -792,7 +792,7 @@ really tamper resistant.

All files uploaded via C<multipart/form-data> request are automatically
available as L<Mojo::Upload> objects from L<Mojolicious::Controller/"param">.
And you don't have to worry about memory usage, because all files above 250KB
And you don't have to worry about memory usage, because all files above 250KiB
will be automatically streamed into a temporary file. To build HTML forms more
efficiently, you can also use tag helpers like
L<Mojolicious::Plugin::TagHelpers/"form_for">.
Expand Down Expand Up @@ -832,11 +832,11 @@ L<Mojolicious::Plugin::TagHelpers/"form_for">.
</body>
</html>

To protect you from excessively large files there is also a limit of 16MB by
To protect you from excessively large files there is also a limit of 16MiB by
default, which you can tweak with the attribute
L<Mojolicious/"max_request_size">.

# Increase limit to 1GB
# Increase limit to 1GiB
app->max_request_size(1073741824);

=head2 User agent
Expand Down

0 comments on commit 8a405d8

Please sign in to comment.