Final push for release...
This commit is contained in:
parent
37f7af4b9f
commit
0c3cdd5ef2
31 changed files with 332 additions and 255 deletions
10
doc/ftp.html
10
doc/ftp.html
|
@ -106,6 +106,7 @@ ftp.<b>get{</b><br>
|
|||
[port = <i>number</i>,]<br>
|
||||
[type = <i>string</i>,]<br>
|
||||
[step = <i>LTN12 pump step</i>,]<br>
|
||||
[create = <i>function</i>]<br>
|
||||
<b>}</b>
|
||||
</p>
|
||||
|
||||
|
@ -138,7 +139,9 @@ authentication. Defaults to "<tt>ftp:anonymous@anonymous.org</tt>";
|
|||
<li><tt>step</tt>:
|
||||
<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
|
||||
pump step function used to pass data from the
|
||||
server to the sink. Defaults to the LTN12 <tt>pump.step</tt> function.
|
||||
server to the sink. Defaults to the LTN12 <tt>pump.step</tt> function;
|
||||
<li><tt>accept</tt>: An optional function to be used instead of
|
||||
<a href=tcp.html#socket.tcp><tt>socket.tcp</tt></a> when the communications socket is created.
|
||||
</ul>
|
||||
|
||||
<p class=return>
|
||||
|
@ -188,6 +191,7 @@ ftp.<b>put{</b><br>
|
|||
[port = <i>number</i>,]<br>
|
||||
[type = <i>string</i>,]<br>
|
||||
[step = <i>LTN12 pump step</i>,]<br>
|
||||
[create = <i>function</i>]<br>
|
||||
<b>}</b>
|
||||
</p>
|
||||
|
||||
|
@ -220,7 +224,9 @@ authentication. Defaults to "<tt>ftp:anonymous@anonymous.org</tt>";
|
|||
<li><tt>step</tt>:
|
||||
<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
|
||||
pump step function used to pass data from the
|
||||
server to the sink. Defaults to the LTN12 <tt>pump.step</tt> function.
|
||||
server to the sink. Defaults to the LTN12 <tt>pump.step</tt> function;
|
||||
<li><tt>accept</tt>: An optional function to be used instead of
|
||||
<a href=tcp.html#socket.tcp><tt>socket.tcp</tt></a> when the communications socket is created.
|
||||
</ul>
|
||||
|
||||
<p class=return>
|
||||
|
|
|
@ -131,7 +131,8 @@ http.<b>request{</b><br>
|
|||
[source = <i>LTN12 source</i>],<br>
|
||||
[step = <i>LTN12 pump step</i>,]<br>
|
||||
[proxy = <i>string</i>,]<br>
|
||||
[redirect = <i>boolean</i>]<br>
|
||||
[redirect = <i>boolean</i>,]<br>
|
||||
[create = <i>function</i>]<br>
|
||||
<b>}</b>
|
||||
</p>
|
||||
|
||||
|
@ -178,7 +179,9 @@ pump step function used to move data.
|
|||
Defaults to the LTN12 <tt>pump.step</tt> function.
|
||||
<li><tt>proxy</tt>: The URL of a proxy server to use. Defaults to no proxy;
|
||||
<li><tt>redirect</tt>: Set to <tt><b>false</b></tt> to prevent the
|
||||
function from automatically following 301 or 302 server redirect messages.
|
||||
function from automatically following 301 or 302 server redirect messages;
|
||||
<li><tt>accept</tt>: An optional function to be used instead of
|
||||
<a href=tcp.html#socket.tcp><tt>socket.tcp</tt></a> when the communications socket is created.
|
||||
</ul>
|
||||
|
||||
<p class=return>
|
||||
|
|
|
@ -168,6 +168,7 @@ support.
|
|||
<li> Improved: <tt>tcp:send(data, i, j)</tt> to return <tt>(i+sent-1)</tt>. This is great for non-blocking I/O, but might break some code;
|
||||
<li> Improved: HTTP, SMTP, and FTP functions to accept a new field
|
||||
<tt>create</tt> that overrides the function used to create socket objects;
|
||||
<li> Fixed: <tt>smtp.send</tt> was hanging on errors returned by LTN12 sources;
|
||||
<li> Fixed: <tt>url.absolute()</tt> to work when <tt>base_url</tt> is in
|
||||
parsed form;
|
||||
<li> Fixed: <tt>http.request()</tt> not to redirect when the location
|
||||
|
@ -194,7 +195,8 @@ with descriptor 0 to be ignored (Renato Maia);
|
|||
<li> Fixed: "Bug" that caused <tt>gethostbyname</tt> to crash under VMS
|
||||
(Renato Maia);
|
||||
<li> Fixed: <tt>tcp:send("")</tt> to return 0 bytes sent (Alexander Marinov);
|
||||
<li> Improved: <tt>socket.DEBUG</tt> and <tt>socket.VERSION</tt> became <tt>socket._DEBUGs</tt> and <tt>socket._VERSION</tt> for uniformity with other libraries.
|
||||
<li> Improved: <tt>socket.DEBUG</tt> and <tt>socket.VERSION</tt> became <tt>socket._DEBUGs</tt> and <tt>socket._VERSION</tt> for uniformity with other libraries;
|
||||
<li> Improved: <tt>socket.select</tt> now works on empty sets on Windows.
|
||||
</ul>
|
||||
|
||||
<!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
|
|
|
@ -71,11 +71,11 @@ Here is the standard LuaSocket distribution directory structure:</p>
|
|||
|
||||
<pre class=example>
|
||||
<ROOT>/compat-5.1.lua
|
||||
<ROOT>/socket.lua
|
||||
<ROOT>/lsocket.dll
|
||||
<ROOT>/mime.lua
|
||||
<ROOT>/lmime.dll
|
||||
<ROOT>/ltn12.lua
|
||||
<ROOT>/mime/init.lua
|
||||
<ROOT>/mime/core.dll
|
||||
<ROOT>/socket/init.lua
|
||||
<ROOT>/socket/core.dll
|
||||
<ROOT>/socket/http.lua
|
||||
<ROOT>/socket/tp.lua
|
||||
<ROOT>/socket/ftp.lua
|
||||
|
@ -83,10 +83,8 @@ Here is the standard LuaSocket distribution directory structure:</p>
|
|||
<ROOT>/socket/url.lua
|
||||
</pre>
|
||||
|
||||
<p> Naturally, on Unix systems, <tt>lsocket.dll</tt> and <tt>lmime.dll</tt>
|
||||
would be replaced by <tt>lsocket.so</tt> and <tt>lmime.so</tt>. In Mac OS
|
||||
X, they would be replaced by <tt>lsocket.dylib</tt> and
|
||||
<tt>lmime.dylib</tt>. </p>
|
||||
<p> Naturally, on Unix systems, <tt>core.dll</tt>
|
||||
would be replaced by <tt>core.so</tt>.
|
||||
|
||||
<p> In order for the interpreter to find all LuaSocket components, three
|
||||
environment variables need to be set. The first environment variable tells
|
||||
|
|
|
@ -142,7 +142,7 @@ Support, Manual">
|
|||
<blockquote>
|
||||
<a href="socket.html">Socket</a>
|
||||
<blockquote>
|
||||
<a href="socket.html#_debug">_DEBUG</a>,
|
||||
<a href="socket.html#debug">_DEBUG</a>,
|
||||
<a href="dns.html#dns">dns</a>,
|
||||
<a href="socket.html#gettime">gettime</a>,
|
||||
<a href="socket.html#newtry">newtry</a>,
|
||||
|
@ -155,7 +155,7 @@ Support, Manual">
|
|||
<a href="tcp.html#tcp">tcp</a>,
|
||||
<a href="socket.html#try">try</a>,
|
||||
<a href="udp.html#udp">udp</a>,
|
||||
<a href="socket.html#_version">_VERSION</a>.
|
||||
<a href="socket.html#version">_VERSION</a>.
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
|
||||
|
|
|
@ -127,6 +127,7 @@ smtp.<b>send{</b><br>
|
|||
[port = <i>number</i>,]<br>
|
||||
[domain = <i>string</i>,]<br>
|
||||
[step = <i>LTN12 pump step</i>,]<br>
|
||||
[create = <i>function</i>]<br>
|
||||
<b>}</b>
|
||||
</p>
|
||||
|
||||
|
@ -138,6 +139,7 @@ doesn't have a simple interface. However, see the
|
|||
a very powerful way to define the message contents.
|
||||
</p>
|
||||
|
||||
|
||||
<p class=parameters>
|
||||
The sender is given by the e-mail address in the <tt>from</tt> field.
|
||||
<tt>Rcpt</tt> is a Lua table with one entry for each recipient e-mail
|
||||
|
@ -158,7 +160,9 @@ local machine host name;
|
|||
<li> <tt>step</tt>:
|
||||
<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
|
||||
pump step function used to pass data from the
|
||||
source to the server. Defaults to the LTN12 <tt>pump.step</tt> function.
|
||||
source to the server. Defaults to the LTN12 <tt>pump.step</tt> function;
|
||||
<li><tt>accept</tt>: An optional function to be used instead of
|
||||
<a href=tcp.html#socket.tcp><tt>socket.tcp</tt></a> when the communications socket is created.
|
||||
</ul>
|
||||
|
||||
<p class=return>
|
||||
|
@ -167,7 +171,7 @@ If successful, the function returns 1. Otherwise, the function returns
|
|||
</p>
|
||||
|
||||
<p class=note>
|
||||
Note: SMTP servers are can be very picky with the format of e-mail
|
||||
Note: SMTP servers can be very picky with the format of e-mail
|
||||
addresses. To be safe, use only addresses of the form
|
||||
"<tt><fulano@example.com></tt>" in the <tt>from</tt> and
|
||||
<tt>rcpt</tt> arguments to the <tt>send</tt> function. In headers, e-mail
|
||||
|
|
|
@ -80,12 +80,12 @@ socket.<b>connect(</b>address, port [, locaddr, locport]<b>)</b>
|
|||
This function is a shortcut that creates and returns a TCP client object
|
||||
connected to a remote <tt>host</tt> at a given <tt>port</tt>. Optionally,
|
||||
the user can also specify the local address and port to bind
|
||||
(<tt>locaddr</tt> and </tt>locport</tt>).
|
||||
(<tt>locaddr</tt> and <tt>locport</tt>).
|
||||
</p>
|
||||
|
||||
<!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
|
||||
<p class=name id=_debug>
|
||||
<p class=name id=debug>
|
||||
socket.<b>_DEBUG</b>
|
||||
</p>
|
||||
|
||||
|
@ -372,7 +372,7 @@ c = socket.try(socket.connect("localhost", 80))
|
|||
|
||||
<!-- version ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
|
||||
<p class=name id=_version>
|
||||
<p class=name id=version>
|
||||
socket.<b>_VERSION</b>
|
||||
</p>
|
||||
|
||||
|
|
21
doc/tcp.html
21
doc/tcp.html
|
@ -79,7 +79,7 @@ reported by <b><tt>nil</tt></b> followed by a message describing the error.
|
|||
<p class=note>
|
||||
Note: calling <a href=socket.html#select><tt>socket.select</tt></a>
|
||||
with a server object in
|
||||
the <tt>receive</tt> parameter before a call to <tt>accept</tt> does
|
||||
the <tt>recvt</tt> parameter before a call to <tt>accept</tt> does
|
||||
<em>not</em> guarantee <tt>accept</tt> will return immediately. Use the <a
|
||||
href=#settimeout><tt>settimeout</tt></a> method or <tt>accept</tt>
|
||||
might block until <em>another</em> client shows up.
|
||||
|
@ -111,7 +111,7 @@ method returns <b><tt>nil</tt></b> followed by an error message.
|
|||
|
||||
<p class=note>
|
||||
Note: The function <a href=socket.html#bind><tt>socket.bind</tt></a>
|
||||
is available and is a shortcut for the creation server sockets.
|
||||
is available and is a shortcut for the creation of server sockets.
|
||||
</p>
|
||||
|
||||
<!-- close ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
|
@ -173,8 +173,11 @@ is available and is a shortcut for the creation of client sockets.
|
|||
<p class=note>
|
||||
Note: Starting with LuaSocket 2.0,
|
||||
the <a href=#settimeout><tt>settimeout</tt></a>
|
||||
method affects the behavior of connect, causing it to return in case of
|
||||
a timeout.
|
||||
method affects the behavior of <tt>connect</tt>, causing it to return
|
||||
with an error in case of a timeout. If that happens, you can still call <a
|
||||
href=socket.html#select><tt>socket.select</tt></a> with the socket in the
|
||||
<tt>sendt</tt> table. The socket will be writable when the connection is
|
||||
stablished.
|
||||
</p>
|
||||
|
||||
<!-- getpeername ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
|
@ -328,11 +331,11 @@ substring to be sent.
|
|||
</p>
|
||||
|
||||
<p class=return>
|
||||
If successful, the method returns the number of bytes accepted by
|
||||
the transport layer. In case of error, the method returns
|
||||
If successful, the method returns the number of bytes sent.
|
||||
In case of error, the method returns
|
||||
<b><tt>nil</tt></b>, followed by an error message, followed by the
|
||||
partial number of bytes accepted by the transport layer.
|
||||
The error message can be '<tt>closed</tt>' in case
|
||||
index of the first character within <tt>[i, j]</tt> that has not been sent yet
|
||||
(you might want to try again from then on). The error message can be '<tt>closed</tt>' in case
|
||||
the connection was closed before the transmission was completed or the
|
||||
string '<tt>timeout</tt>' in case there was a timeout during the
|
||||
operation.
|
||||
|
@ -433,7 +436,7 @@ of bandwidth.
|
|||
<p class=parameters>
|
||||
<tt>Received</tt> is a number with the new number of bytes received.
|
||||
<tt>Sent</tt> is a number with the new number of bytes sent.
|
||||
<tt>Age</tt> is the new age in seconds</tt>
|
||||
<tt>Age</tt> is the new age in seconds.
|
||||
</p>
|
||||
|
||||
<p class=return>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue