Updated manual timestamps and the added stuffing filters to mime.html.

This commit is contained in:
Diego Nehab 2004-06-17 07:00:43 +00:00
parent 613534c795
commit eac26d2c8d
14 changed files with 61 additions and 39 deletions

View File

@ -118,7 +118,7 @@ message.
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:46:57 EDT 2004
</small>
</p>
</center>

View File

@ -267,7 +267,7 @@ f, e = ftp.put{
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:04 EDT 2004
</small>
</p>
</center>

View File

@ -303,7 +303,7 @@ r, c = http.request {
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>

View File

@ -284,7 +284,7 @@ those that have compatibility issues.
<p>
<small>
Last modified by Diego Nehab on <br>
Sun Aug 10 01:36:26 PDT 2003
Thu Jun 17 02:47:14 EDT 2004
</small>
</p>
</center>

View File

@ -330,7 +330,7 @@ io.write(socket.try((udp:receive())))
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>

View File

@ -415,7 +415,7 @@ Creates and returns a source that produces the contents of a
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>

View File

@ -156,6 +156,22 @@ base64 = ltn12.filter.chain(
)
</pre>
<!-- stuff +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id="stuff">
mime.<b>stuff()</b><br>
</p>
<p class=description>
Creates and returns a filter that performs stuffing of SMTP messages.
</p>
<p class=note>
Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function
uses this filter automatically. You don't need to chain it with your
source, or apply it to your message body.
</p>
<!-- wrap +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id="wrap">
@ -232,33 +248,36 @@ print((mime.b64("diego:password")))
<!-- dot +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id="dot">
A, B = mime.<b>dot(</b>C [, D]<b>)</b>
A, n = mime.<b>dot(</b>m [, B]<b>)</b>
</p>
<p class=description>
Low-level filter to perform Base64 encoding.
Low-level filter to perform SMTP stuffing and enable transmission of
messages containing the sequence "CRLF.CRLF".
</p>
<p class=description>
<tt>A</tt> is the encoded version of the largest prefix of
<tt>C..D</tt>
that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of
<tt>C..D</tt>, <em>before</em> encoding.
If <tt>D</tt> is <tt><b>nil</b></tt>, <tt>A</tt> is padded with
the encoding of the remaining bytes of <tt>C</tt>.
<p class=parameters>
<tt>A</tt> is the stuffed version of <tt>B</tt>. '<tt>n</tt>' gives the
number of characters from the sequence CRLF seen in the end of <tt>B</tt>.
'<tt>m</tt>' should tell the same, but for the previous chunk.
</p>
<p class=note>
Note: The simplest use of this function is to encode a string into it's
Base64 transfer content encoding. Notice the extra parenthesis around the
call to <tt>mime.b64</tt>, to discard the second return value.
<p class=note>Note: The message body is defined to begin with
an implicit CRLF. Therefore, to stuff a message correctly, the
first <tt>m</tt> should have the value 2.
</p>
<pre class=example>
print((mime.b64("diego:password")))
--&gt; ZGllZ286cGFzc3dvcmQ=
print((string.gsub(mime.dot(2, ".\r\nStuffing the message.\r\n.\r\n."), "\r\n", "\\n")))
--&gt; ..\nStuffing the message.\n..\n..
</pre>
<p class=note>
Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function
uses this filter automatically. You don't need to
apply it again.
</p>
<!-- eol ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<p class=name id="eol">
@ -273,7 +292,7 @@ context the function receives besides the chunk. An updated version of
the context is returned after each new chunk.
</p>
<p class=description>
<p class=parameters>
<tt>A</tt> is the translated version of <tt>D</tt>. <tt>C</tt> is the
ASCII value of the last character of the previous chunk, if it was a
candidate for line break, or 0 otherwise.
@ -296,7 +315,7 @@ A, B = mime.<b>qp(</b>C [, D, marker]<b>)</b>
Low-level filter to perform Quoted-Printable encoding.
</p>
<p class=description>
<p class=parameters>
<tt>A</tt> is the encoded version of the largest prefix of
<tt>C..D</tt>
that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of
@ -328,7 +347,7 @@ A, m = mime.<b>qpwrp(</b>n [, B, length]<b>)</b>
Low-level filter to break Quoted-Printable text into lines.
</p>
<p class=description>
<p class=parameters>
<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most
<tt>length</tt> bytes (defaults to 76).
'<tt>n</tt>' should tell how many bytes are left for the first
@ -352,7 +371,7 @@ A, B = mime.<b>unb64(</b>C [, D]<b>)</b>
Low-level filter to perform Base64 decoding.
</p>
<p class=description>
<p class=parameters>
<tt>A</tt> is the decoded version of the largest prefix of
<tt>C..D</tt>
that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of
@ -383,7 +402,7 @@ Low-level filter to remove the Quoted-Printable transfer content encoding
from data.
</p>
<p class=description>
<p class=parameters>
<tt>A</tt> is the decoded version of the largest prefix of
<tt>C..D</tt>
that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of
@ -414,7 +433,7 @@ Low-level filter to break text into lines with CRLF marker.
Text is assumed to be in the <a href=#normalize><tt>normalize</tt></a> form.
</p>
<p class=description>
<p class=parameters>
<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most
<tt>length</tt> bytes (defaults to 76).
'<tt>n</tt>' should tell how many bytes are left for the first
@ -443,7 +462,7 @@ marker.
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>

View File

@ -107,17 +107,19 @@
<a href="mime.html#normalize">normalize</a>,
<a href="mime.html#decode">decode</a>,
<a href="mime.html#encode">encode</a>,
<a href="mime.html#stuff">stuff</a>,
<a href="mime.html#wrap">wrap</a>.
</blockquote>
<blockquote>
<a href="mime.html#low">low-level</a>:
<a href="mime.html#b64">b64</a>,
<a href="mime.html#unb64">unb64</a>,
<a href="mime.html#dot">dot</a>,
<a href="mime.html#eol">eol</a>,
<a href="mime.html#qp">qp</a>,
<a href="mime.html#unqp">unqp</a>,
<a href="mime.html#wrp">wrp</a>,
<a href="mime.html#qpwrp">qpwrp</a>.
<a href="mime.html#unb64">unb64</a>,
<a href="mime.html#unqp">unqp</a>,
</blockquote>
</blockquote>
@ -218,7 +220,7 @@
<p>
<small>
Last modified by Diego Nehab on <br>
Thu Sep 27 16:18:27 EST 2001
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>

View File

@ -347,8 +347,9 @@ source = smtp.message{
[1] = {
body = mime.eol(0, [[
Lines in a message body should always end with CRLF.
The smtp module will *NOT* perform translation. It will
perform necessary stuffing or '.' characters, though.
The smtp module will *NOT* perform translation. However, the
send function *DOES* perform SMTP stuffing, whereas the message
function does *NOT*.
]])
},
-- second part: headers describe content to be a png image,
@ -397,7 +398,7 @@ r, e = smtp.send{
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>

View File

@ -251,7 +251,7 @@ This constant has a string describing the current LuaSocket version.
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>

View File

@ -462,7 +462,7 @@ This function returns 1.
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:47:21 EDT 2004
</small>
</p>
</center>

View File

@ -395,7 +395,7 @@ imperative nature obvious.
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:48:14 EDT 2004
</small>
</p>
</center>

View File

@ -315,7 +315,7 @@ The function returns the decoded string.
<p>
<small>
Last modified by Diego Nehab on <br>
Sat Aug 9 01:00:41 PDT 2003
Thu Jun 17 02:48:14 EDT 2004
</small>
</p>
</center>

View File

@ -23,7 +23,7 @@ source = smtp.message{
Lines in a message body should always end with CRLF.
The smtp module will *NOT* perform translation. It will
perform necessary stuffing, though.
]])
]])
},
-- second part: Headers describe content the to be an image,
-- sent under the base64 transfer content encoding.