diff --git a/.gitignore b/.gitignore index cfb65dd..71d4029 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ luasocket-2.0.2.tar.gz +/v3.0-rc1.tar.gz diff --git a/lua-socket.spec b/lua-socket.spec index 384fc22..2d29e65 100644 --- a/lua-socket.spec +++ b/lua-socket.spec @@ -1,20 +1,23 @@ %define luaver 5.2 %define lualibdir %{_libdir}/lua/%{luaver} %define luapkgdir %{_datadir}/lua/%{luaver} -%global baseversion 2.0.2 +%global baseversion 3.0-rc1 +%global upstreamname luasocket Name: lua-socket -Version: 2.1 -Release: 0.2.rc1%{?dist} +Version: 3.0 +Release: 0.3rc1%{?dist} Summary: Network support for the Lua language Group: Development/Libraries License: MIT URL: http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/ -Source0: http://luaforge.net/frs/download.php/2664/luasocket-%{baseversion}.tar.gz -# from https://github.com/diegonehab/luasocket/ -Patch0: luasocket-2.1rc1.patch -Patch1: luasocket-2.1-optflags.patch +#Source0: http://luaforge.net/frs/download.php/2664/luasocket-%{baseversion}.tar.gz +Source0: https://github.com/diegonehab/%{upstreamname}/archive/v%{baseversion}.tar.gz +Patch0: luasocket-optflags.patch +# All changes in the upstream repo from %{baseversion} tag to the +# current master. Seems to be harmless. +Patch1: luasocket-no-global-vars.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: lua >= %{luaver}, lua-devel >= %{luaver} @@ -31,19 +34,19 @@ Among the support modules, the most commonly used implement the SMTP, HTTP and FTP. In addition there are modules for MIME, URL handling and LTN12. %prep -%setup -q -n luasocket-%{baseversion} -%patch0 -p1 -b .21 -%patch1 -p1 -b .optflags +%setup -q -n %{upstreamname}-%{baseversion} +%patch0 -p1 -b .optflags +%patch1 -p1 -b .noglobal %build -make %{?_smp_mflags} OPTFLAGS="%{optflags} -fPIC" linux +make %{?_smp_mflags} OPTFLAGS="%{optflags} -fPIC" /usr/bin/iconv -f ISO8859-1 -t UTF8 LICENSE >LICENSE.UTF8 mv -f LICENSE.UTF8 LICENSE %install rm -rf $RPM_BUILD_ROOT -make install-unix INSTALL_TOP_LIB=$RPM_BUILD_ROOT%{lualibdir} INSTALL_TOP_SHARE=$RPM_BUILD_ROOT%{luapkgdir} +make install-unix INSTALL_TOP=$RPM_BUILD_ROOT INSTALL_TOP_CDIR=$RPM_BUILD_ROOT%{lualibdir} INSTALL_TOP_LDIR=$RPM_BUILD_ROOT%{luapkgdir} %clean @@ -59,6 +62,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Aug 23 2013 Matěj Cepl - 3.0-0.3rc1 +- update to the 3.0rc1 from git + * Sat Aug 03 2013 Fedora Release Engineering - 2.1-0.2.rc1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild @@ -74,7 +80,7 @@ rm -rf $RPM_BUILD_ROOT * Fri Jan 13 2012 Fedora Release Engineering - 2.0.2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild -* Wed Oct 10 2011 Matthew Garrett - 2.0.2-6 +* Mon Oct 10 2011 Matthew Garrett - 2.0.2-6 - Build support for Unix domain sockets (rhbz: #720692) * Tue Feb 08 2011 Fedora Release Engineering - 2.0.2-5 diff --git a/luasocket-2.1-optflags.patch b/luasocket-2.1-optflags.patch deleted file mode 100644 index ea40c24..0000000 --- a/luasocket-2.1-optflags.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up luasocket-2.0.2/src/makefile.optflags luasocket-2.0.2/src/makefile ---- luasocket-2.0.2/src/makefile.optflags 2013-05-10 14:00:45.415655745 -0400 -+++ luasocket-2.0.2/src/makefile 2013-05-10 14:01:41.625653735 -0400 -@@ -117,9 +117,9 @@ CC_linux=gcc - DEF_linux=-DLUASOCKET_$(DEBUG) -DLUA_COMPAT_MODULE \ - -DLUASOCKET_API='__attribute__((visibility("default")))' \ - -DMIME_API='__attribute__((visibility("default")))' --CFLAGS_linux= -I$(LUAINC) $(DEF) -pedantic -Wall -Wshadow -Wextra -Wimplicit -O2 -ggdb3 -fpic \ -+CFLAGS_linux= -I$(LUAINC) $(DEF) $(OPTFLAGS) \ - -fvisibility=hidden --LDFLAGS_linux=-O -shared -fpic -o -+LDFLAGS_linux=$(OPTFLAGS) -shared -o - LD_linux=gcc - SOCKET_linux=usocket.o - diff --git a/luasocket-2.1rc1.patch b/luasocket-2.1rc1.patch deleted file mode 100644 index 3b1036e..0000000 --- a/luasocket-2.1rc1.patch +++ /dev/null @@ -1,19987 +0,0 @@ -diff -up luasocket-2.0.2/doc/dns.html.21 luasocket-2.0.2/doc/dns.html ---- luasocket-2.0.2/doc/dns.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/dns.html 2013-05-10 13:49:50.353679160 -0400 -@@ -24,8 +24,8 @@ - - -

--home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -39,12 +39,16 @@ -

DNS

- -

--Name resolution functions return all information obtained from the --resolver in a table of the form: -+IPv4 name resolution functions -+dns.toip -+and -+dns.tohostname -+return all information obtained from -+the resolver in a table of the form: -

- -
--resolved = {
-+resolved4 = {
-   name = canonic-name,
-   alias = alias-list,
-   ip = ip-address-list
-@@ -55,6 +59,53 @@ resolved = {
- Note that the alias list can be empty. -

- -+

-+The more general name resolution function -+dns.getaddrinfo, which -+supports both IPv6 and IPv4, -+returns all information obtained from -+the resolver in a table of the form: -+

-+ -+
-+resolved6 = {
-+  [1] = {
-+    family = family-name-1,
-+    addr = address-1
-+  },
-+  ...
-+  [n] = {
-+    family = family-name-n,
-+    addr = address-n
-+  }
-+} -+
-+ -+

-+Here, family contains the string "inet" for IPv4 -+addresses, and "inet6" for IPv6 addresses. -+

-+ -+ -+ -+

-+socket.dns.getaddrinfo(address) -+

-+ -+

-+Converts from host name to address. -+

-+ -+

-+Address can be an IPv4 or IPv6 address or host name. -+

-+ -+

-+The function returns a table with all information returned by -+the resolver. In case of error, the function returns nil -+followed by an error message. -+

-+ - - -

-@@ -72,7 +123,7 @@ socket.dns.tohostname(address) -

- -

--Converts from IP address to host name. -+Converts from IPv4 address to host name. -

- -

-@@ -93,7 +144,7 @@ socket.dns.toip(address) -

- -

--Converts from host name to IP address. -+Converts from host name to IPv4 address. -

- -

-@@ -113,8 +164,8 @@ message. -


-
-

--home · --download · -+home · -+download · - installation · - introduction · - reference -diff -up luasocket-2.0.2/doc/ftp.html.21 luasocket-2.0.2/doc/ftp.html ---- luasocket-2.0.2/doc/ftp.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/ftp.html 2013-05-10 13:49:50.353679160 -0400 -@@ -24,8 +24,8 @@ - - -

--home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -42,7 +42,7 @@ - FTP (File Transfer Protocol) is a protocol used to transfer files - between hosts. The ftp namespace offers thorough support - to FTP, under a simple interface. The implementation conforms to --RFC 959. -+RFC 959. -

- -

-@@ -70,8 +70,8 @@ local ftp = require("socket.ftp") - -

- URLs MUST conform to --RFC --1738, that is, an URL is a string in the form: -+RFC 1738, -+that is, an URL is a string in the form: -

- -
-@@ -270,8 +270,8 @@ f, e = ftp.put{ -
-
-

--home · --download · -+home · -+download · - installation · - introduction · - reference -diff -up luasocket-2.0.2/doc/http.html.21 luasocket-2.0.2/doc/http.html ---- luasocket-2.0.2/doc/http.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/http.html 2013-05-10 13:49:50.354679160 -0400 -@@ -24,8 +24,8 @@ - - -

--home · --download · -+home · -+download · - introduction · - introduction · - reference -@@ -36,7 +36,7 @@ - - - --

HTTP

-+

HTTP

- -

- HTTP (Hyper Text Transfer Protocol) is the protocol used to exchange -@@ -45,8 +45,7 @@ namespace offers full support for the c - protocol (i.e., - the facilities that would be used by a web-browser implementation). The - implementation conforms to the HTTP/1.1 standard, --RFC --2616. -+RFC 2616. -

- -

-@@ -67,8 +66,7 @@ local http = require("socket.http") - -

- URLs must conform to --RFC --1738, -+RFC 1738, - that is, an URL is a string in the form: -

- -@@ -97,8 +95,9 @@ headers = {
-
- -

--Field names are case insensitive (as specified by the standard) and all --functions work with lowercase field names. -+Field names are case insensitive (as specified by the standard) and all -+functions work with lowercase field names (but see -+socket.headers.canonic). - Field values are left unmodified. -

- -@@ -119,9 +118,10 @@ the HTTP module: -
  • USERAGENT: default user agent reported to server. - - -+ - - --

    -+

    - http.request(url [, body])
    - http.request{
    -   url = string,
    -@@ -199,8 +199,7 @@ it usually returns a message body (a web - URL was not found or some other useless page). To make sure the - operation was successful, check the returned status code. For - a list of the possible values and their meanings, refer to RFC --2616. -+href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616. -

    - -

    -@@ -259,7 +258,7 @@ r, c, h = http.request { - -- } - - --

    -+

    - Note: When sending a POST request, simple interface adds a - "Content-type: application/x-www-form-urlencoded" - header to the request. This is the type used by -@@ -267,7 +266,7 @@ HTML forms. If you need another type, us - interface. -

    - --

    -+

    - Note: Some URLs are protected by their - servers from anonymous download. For those URLs, the server must receive - some sort of authentication along with the request or it will deny -@@ -278,7 +277,7 @@ download and return status "401 Aut - The HTTP/1.1 standard defines two authentication methods: the Basic - Authentication Scheme and the Digest Authentication Scheme, both - explained in detail in --RFC 2068. -+RFC 2068. -

    - -

    The Basic Authentication Scheme sends -@@ -304,7 +303,7 @@ b, c, h = http.request("http://fulano:si - -- the request directly. - r, c = http.request { - url = "http://www.example.com/private/index.html", -- headers = { authentication = "Basic " .. (mime.b64("fulano:silva")) } -+ headers = { authorization = "Basic " .. (mime.b64("fulano:silva")) } - } - - -@@ -314,8 +313,8 @@ r, c = http.request { -


    -
    -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -diff -up luasocket-2.0.2/doc/index.html.21 luasocket-2.0.2/doc/index.html ---- luasocket-2.0.2/doc/index.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/index.html 2013-05-10 13:49:50.354679160 -0400 -@@ -24,8 +24,8 @@ - - -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -78,8 +78,8 @@ LuaSocket. -

    - -

    --Copyright © 2004-2007 Diego Nehab. All rights reserved.
    --Author: Diego Nehab -+Copyright © 1999-2012 Diego Nehab. All rights reserved.
    -+Author: Diego Nehab -

    - - -@@ -87,25 +87,18 @@ Author: LuaSocket -+project page at GitHub. Besides the full C and Lua source code -+for the library, the distribution contains several examples, -+this user's manual and basic test procedures. -

    - -

    Take a look at the Special thanks - -

    --Throughout LuaSocket's history, many people gave suggestions that helped --improve it. For that, I thank the Lua community. --Special thanks go to --David Burgess, who has helped push the library to a new level of quality and --from whom I have learned a lot of stuff that doesn't show up in RFCs. --Special thanks also to Carlos Cassino, who played a big part in the --extensible design seen in the C core of LuaSocket 2.0. Mike Pall --has been helping a lot too! Thanks to you all! -+This marks the first release of LuaSocket that -+wholeheartedly embraces the open-source development -+philosophy. After a long hiatus, Matthew Wild finally -+convinced me it was time for a release including IPv6 -+and Lua 5.2 support. Special thanks to Sam Roberts, Florian -+Zeitz, and Paul Aurich, Liam Devine, and everybody else that -+has helped bring this library back to life. -

    - - -@@ -133,44 +125,30 @@ has been helping a lot too! Thanks to yo -

    What's New

    - -

    --2.0.2 is just a bug-fix/update release. -+Main changes for LuaSocket 2.1-rc1 are IPv6 support -+and Lua 5.2 compatibility. -

    - -
      --
    • Improved: http.request() now supports deprecated --HTTP/0.9 servers (Florian Berger); --
    • Fixed: could return "timedout" instead of "timeout" (Leo Leo); --
    • Fixed: crash when reading '*a' on closed socket (Paul Ducklin); --
    • Fixed: return values are consistent when reading from closed sockets; --
    • Fixed: case sensitivity in headers of multipart --messages in smtp.message() (Graham Henstridge); --
    • Fixed a couple instances of error() being called instead of --base.error(). These would cause an error when an error was --reported :) (Ketmar Dark); --
    • Fixed: test script now uses pairs() iterator instead --of the old Lua syntax (Robert Dodier). --
    -- --

    --2.0.1 is just a bug-fix/update release. --

    -- -+
  • Added: Compatible with Lua 5.2 (using LUA_COMPAT_MODULE); -+
  • Added: IPv6 support; -
      --
    • Updated: now using compat-5.1r5; --
    • Improved: http.request is more robust to --malformed URLs (Adrian Sietsma); --
    • Improved: the simple http.request interface sends a --"Content-type: application/x-www-form-urlencoded" --header (William Trenker); --
    • Improved: http.request is robust to evil --servers that send inappropriate 100-continue messages --(David Burgess); --
    • Fixed: http.request was using the old host header during --redirects (Florian Berger); --
    • Fixed: sample unix.c had fallen through the --cracks during development (Matthew Percival); --
    • Fixed: error code was not being propagated correctly in --ftp.lua (David Burgess). -+
    • Socket.connect and socket.bind support IPv6 addresses; -+
    • Getpeername and getsockname support -+IPv6 addresses, and return the socket family as a third value; -+
    • URL module updated to support IPv6 host names; -+
    • New socket.tcp6 and socket.udp6 functions; -+
    • New socket.dns.getaddrinfo function; -+
    -+
  • Added: getoption method; -+
  • Fixed: url.unescape was returning additional values; -+
  • Fixed: mime.qp, mime.unqp, -+ mime.b64, and mime.unb64 could -+ mistaking their own stack slots for functions arguments; -+
  • Fixed: Receiving zero-length datagram is now possible; -+
  • Improved: Hidden all internal library symbols; -+
  • Improved: Better error messages; -+
  • Improved: Better documentation of socket options. - - - -@@ -179,7 +157,7 @@ ftp.lua (David Burgess). - -

    - All previous versions of the LuaSocket library can be downloaded -+href="http://www.impa.br/~diego/software/luasocket/old"> - here. Although these versions are no longer supported, they are - still available for those that have compatibility issues. -

    -@@ -190,7 +168,7 @@ still available for those that have comp -
    -
    -

    --download · -+download · - installation · - introduction · - reference -@@ -198,7 +176,7 @@ still available for those that have comp -

    - - Last modified by Diego Nehab on
    --Wed Oct 3 02:07:59 BRT 2007 -+Mon Apr 16 21:58:56 HKT 2012 -
    -

    -
    -diff -up luasocket-2.0.2/doc/installation.html.21 luasocket-2.0.2/doc/installation.html ---- luasocket-2.0.2/doc/installation.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/installation.html 2013-05-10 13:49:50.354679160 -0400 -@@ -25,8 +25,8 @@ Installation"> - - -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -39,24 +39,16 @@ Installation"> - -

    Installation

    - --

    LuaSocket 2.0.2 uses the new package system for Lua 5.1. --All Lua library developers are encouraged to update their libraries so that --all libraries can coexist peacefully and users can benefit from the --standardization and flexibility of the standard. --

    -- --

    --Those stuck with Lua 5.0 will need the --compat-5.1 --module. It is maintained by --The Kepler --Project's team, and implements the Lua 5.1 package proposal --on top of Lua 5.0.

    -- --

    Here we will only describe the standard distribution. --If the standard doesn't meet your needs, we refer you to the --Lua discussion list, where any question about the package --scheme will likely already have been answered.

    -+

    LuaSocket 2.1-rc still uses Lua 5.1's package -+system. Users that have already made the switch to -+Lua 5.2 should leave the default -+LUA_COMPAT_MODULE defined when compiling their Lua -+distribution for compatibility with LuaSocket.

    -+ -+

    Here we describe the standard distribution. If the -+standard doesn't meet your needs, we refer you to the Lua -+discussion list, where any question about the package scheme -+will likely already have been answered.

    - -

    Directory structure

    - -@@ -64,14 +56,19 @@ scheme will likely already have been ans - directories, one for system dependent files, and another for system - independent files. Let's call these directories <CDIR> - and <LDIR>, respectively. --For instance, in my laptop, I use '/usr/local/lib/lua/5.0' for --<CDIR> and '/usr/local/share/lua/5.0' for --<LDIR>. On Windows, sometimes only one directory is used, say --'c:\program files\lua\5.0'. Here is the standard LuaSocket -+For example, in my laptp, Lua 5.1 is configured to -+use '/usr/local/lib/lua/5.1' for -+<CDIR> and '/usr/local/share/lua/5.1' for -+<LDIR>. On Windows, <CDIR> -+usually points to the directory where the Lua executable is -+found, and <LDIR> points to a -+lua/ directory inside <CDIR>. (These -+settings can be overridden by environment variables -+LUA_PATH and LUA_CPATH. See the Lua -+documentation for details.) Here is the standard LuaSocket - distribution directory structure:

    - -
    --<LDIR>/compat-5.1.lua
    - <LDIR>/ltn12.lua
    - <LDIR>/socket.lua
    - <CDIR>/socket/core.dll
    -@@ -88,33 +85,6 @@ distribution directory structure:

    - would be replaced by core.so. -

    - --

    In order for the interpreter to find all LuaSocket components, three --environment variables need to be set. The first environment variable tells --the interpreter to load the compat-5.1.lua module at startup:

    -- --
    --LUA_INIT=@<LDIR>/compat-5.1.lua
    --
    -- --

    --This is only need for Lua 5.0! Lua 5.1 comes with --the package system built in, of course. --

    -- --

    --The other two environment variables instruct the compatibility module to --look for dynamic libraries and extension modules in the appropriate --directories and with the appropriate filename extensions. --

    -- --
    --LUA_PATH=<LDIR>/?.lua;?.lua
    --LUA_CPATH=<CDIR>/?.dll;?.dll
    --
    -- --

    Again, naturally, on Unix systems the shared library extension would be --.so instead of .dll.

    -- -

    Using LuaSocket

    - -

    With the above setup, and an interpreter with shared library support, -@@ -122,19 +92,19 @@ it should be easy to use LuaSocket. Just - require function to gain access to whatever module you need:

    - -
    --Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
    -+Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
    - > socket = require("socket")
    - > print(socket._VERSION)
    ----> LuaSocket 2.0.2
    -+--> LuaSocket 2.1-rc1
    - 
    - -

    Each module loads their dependencies automatically, so you only need to - load the modules you directly depend upon:

    - -
    --Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
    -+Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
    - > http = require("socket.http")
    --> print(http.request("http://www.cs.princeton.edu/~diego/professional/luasocket"))
    -+> print(http.request("http://www.impa.br/~diego/software/luasocket"))
    - --> homepage gets dumped to terminal
    - 
    - -@@ -144,8 +114,8 @@ Lua 5.1.2 Copyright (C) 1994-2007 Lua.o -
    -
    -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -153,7 +123,7 @@ Lua 5.1.2 Copyright (C) 1994-2007 Lua.o -

    - - Last modified by Diego Nehab on
    --Thu Apr 20 00:25:30 EDT 2006 -+Mon Apr 16 21:01:42 HKT 2012 -
    -

    -
    -diff -up luasocket-2.0.2/doc/introduction.html.21 luasocket-2.0.2/doc/introduction.html ---- luasocket-2.0.2/doc/introduction.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/introduction.html 2013-05-10 13:49:50.354679160 -0400 -@@ -25,8 +25,8 @@ Library, Support"> - - -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -314,8 +314,8 @@ and many others are covered by the -

    -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -diff -up luasocket-2.0.2/doc/ltn12.html.21 luasocket-2.0.2/doc/ltn12.html ---- luasocket-2.0.2/doc/ltn12.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/ltn12.html 2013-05-10 13:49:50.354679160 -0400 -@@ -25,8 +25,8 @@ Pump, Support, Library"> - - -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -411,8 +411,8 @@ Creates and returns a source that produc -


    -
    -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -diff -up luasocket-2.0.2/doc/mime.html.21 luasocket-2.0.2/doc/mime.html ---- luasocket-2.0.2/doc/mime.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/mime.html 2013-05-10 13:49:50.354679160 -0400 -@@ -24,8 +24,8 @@ - - -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -44,11 +44,11 @@ content transfer encodings, such as Base - It also provides functions to break text into lines and change - the end-of-line convention. - MIME is described mainly in --RFC 2045, --2046, --2047, --2048, and --2049. -+RFC 2045, -+2046, -+2047, -+2048, and -+2049. -

    - -

    -@@ -457,8 +457,8 @@ marker. -


    -
    -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -diff -up luasocket-2.0.2/doc/reference.html.21 luasocket-2.0.2/doc/reference.html ---- luasocket-2.0.2/doc/reference.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/reference.html 2013-05-10 13:49:50.354679160 -0400 -@@ -25,8 +25,8 @@ Support, Manual"> - - -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -42,9 +42,10 @@ Support, Manual"> -

    - DNS (in socket) -
    --toip, -+getaddrinfo, -+gethostname, - tohostname, --gethostname. -+toip. -
    -
    - -@@ -108,9 +109,9 @@ Support, Manual"> - MIME -
    - high-level: --normalize, - decode, - encode, -+normalize, - stuff, - wrap. -
    -@@ -120,10 +121,10 @@ Support, Manual"> - dot, - eol, - qp, --wrp, --qpwrp. -+qpwrp, - unb64, - unqp, -+wrp. -
  • - - -@@ -142,19 +143,27 @@ Support, Manual"> -
    - Socket -
    -+bind, -+connect, -+connect4, -+connect6, - _DEBUG, - dns, - gettime, -+headers.canonic, - newtry, - protect, - select, - sink, - skip, - sleep, -+_SETSIZE, - source, --tcp, -+tcp, -+tcp6, - try, --udp, -+udp, -+udp6, - _VERSION. -
    -
    -@@ -168,11 +177,16 @@ Support, Manual"> - bind, - close, - connect, -+dirty, -+getfd, -+getoption, - getpeername, - getsockname, - getstats, -+listen, - receive, - send, -+setfd, - setoption, - setstats, - settimeout, -@@ -186,6 +200,7 @@ Support, Manual"> - UDP (in socket) -
    - close, -+getoption, - getpeername, - getsockname, - receive, -@@ -220,8 +235,8 @@ Support, Manual"> -
    -
    -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -diff -up luasocket-2.0.2/doc/smtp.html.21 luasocket-2.0.2/doc/smtp.html ---- luasocket-2.0.2/doc/smtp.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/smtp.html 2013-05-10 13:49:50.355679160 -0400 -@@ -25,8 +25,8 @@ Library, Support"> - - -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -48,14 +48,13 @@ control (if you bother to read the code) -

    - -

    The implementation conforms to the Simple Mail Transfer Protocol, --RFC 2821. -+RFC 2821. - Another RFC of interest is RFC 2822, -+href="http://www.ietf.org/rfc/rfc2822.txt">RFC 2822, - which governs the Internet Message Format. - Multipart messages (those that contain attachments) are part - of the MIME standard, but described mainly --in RFC --2046 -+in RFC 2046 - -

    In the description below, good understanding of LTN012, Filters -@@ -91,8 +90,9 @@ headers = {
    -

    - -

    --Field names are case insensitive (as specified by the standard) and all --functions work with lowercase field names. -+Field names are case insensitive (as specified by the standard) and all -+functions work with lowercase field names (but see -+socket.headers.canonic). - Field values are left unmodified. -

    - -@@ -196,7 +196,7 @@ part of the message and will not be sent -

    - -

    --RFC 2822 -+RFC 2822 - has two important and short sections, "3.6.3. Destination address - fields" and "5. Security considerations", explaining the proper - use of these headers. Here is a summary of what it says: -@@ -236,9 +236,9 @@ exactly what you don't want to - -

    - I hope this clarifies the issue. Otherwise, please refer to --RFC 2821 -+RFC 2821 - and --RFC 2822. -+RFC 2822. -

    - -
    -@@ -398,8 +398,8 @@ r, e = smtp.send{
    - 
    -
    -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -diff -up luasocket-2.0.2/doc/socket.html.21 luasocket-2.0.2/doc/socket.html ---- luasocket-2.0.2/doc/socket.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/socket.html 2013-05-10 13:49:50.355679160 -0400 -@@ -24,8 +24,8 @@ - - -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -73,14 +73,19 @@ set to true. - - -

    --socket.connect(address, port [, locaddr, locport]) -+socket.connect[46](address, port [, locaddr] [, locport] [, family]) -

    - -

    - This function is a shortcut that creates and returns a TCP client object --connected to a remote host at a given port. Optionally, -+connected to a remote address at a given port. Optionally, - the user can also specify the local address and port to bind --(locaddr and locport). -+(locaddr and locport), or restrict the socket family -+to "inet" or "inet6". -+Without specifying family to connect, whether a tcp or tcp6 -+connection is created depends on your system configuration. Two variations -+of connect are defined as simple helper functions that restrict the -+family, socket.connect4 and socket.connect6. -

    - - -@@ -94,6 +99,47 @@ This constant is set to true< - with debug support. -

    - -+ -+ -+

    -+socket.gettime() -+

    -+ -+

    -+Returns the time in seconds, relative to the origin of the -+universe. You should subtract the values returned by this function -+to get meaningful values. -+

    -+ -+
    -+t = socket.gettime()
    -+-- do stuff
    -+print(socket.gettime() - t .. " seconds elapsed")
    -+
    -+ -+ -+ -+

    -+socket.headers.canonic

    -+ -+

    The socket.headers.canonic table -+is used by the HTTP and SMTP modules to translate from -+lowercase field names back into their canonic -+capitalization. When a lowercase field name exists as a key -+in this table, the associated value is substituted in -+whenever the field name is sent out. -+

    -+ -+

    -+You can obtain the headers namespace if case run-time -+modifications are required by running: -+

    -+ -+
    -+-- loads the headers module 
    -+local headers = require("headers")
    -+
    -+ - - -

    -@@ -200,6 +246,15 @@ changed status. -

    - -

    -+Note: : select can monitor a limited number -+of sockets, as defined by the constant socket._SETSIZE. This -+number may be as high as 1024 or as low as 64 by default, -+depending on the system. It is usually possible to change this -+at compile time. Invoking select with a larger -+number of sockets will raise an error. -+

    -+ -+

    - Important note: a known bug in WinSock causes select to fail - on non-blocking TCP sockets. The function may return a socket as - writable even though the socket is not ready for sending. -@@ -217,6 +272,10 @@ method or accept might block fo - it to select, it will be ignored. -

    - -+

    -+Using select with non-socket objects: Any object that implements getfd and dirty can be used with select, allowing objects from other libraries to be used within a socket.select driven loop. -+

    -+ - - -

    -@@ -288,7 +347,8 @@ Freezes the program execution during a g -

    - -

    --Time is the number of seconds to sleep for. -+Time is the number of seconds to sleep for. If -+time is negative, the function returns immediately. -

    - - -@@ -323,24 +383,17 @@ side closes the connection. - The function returns a source with the appropriate behavior. -

    - -- -+ - --

    --socket.gettime() -+

    -+socket._SETSIZE -

    - -

    --Returns the time in seconds, relative to the origin of the --universe. You should subtract the values returned by this function --to get meaningful values. -+The maximum number of sockets that the select function can handle. -

    - --
    --t = socket.gettime()
    ---- do stuff
    --print(socket.gettime() - t .. " seconds elapsed")
    --
    -- - - -

    -@@ -385,8 +438,8 @@ This constant has a string describing th -


    -
    -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -diff -up luasocket-2.0.2/doc/tcp.html.21 luasocket-2.0.2/doc/tcp.html ---- luasocket-2.0.2/doc/tcp.html.21 2007-10-15 00:21:05.000000000 -0400 -+++ luasocket-2.0.2/doc/tcp.html 2013-05-10 13:49:50.355679160 -0400 -@@ -24,8 +24,8 @@ - - -

    --home · --download · -+home · -+download · - installation · - introduction · - reference -@@ -36,16 +36,16 @@ - - - --

    TCP

    -+

    TCP

    - - - --

    -+

    - socket.tcp() -

    - -

    --Creates and returns a TCP master object. A master object can -+Creates and returns an IPv4 TCP master object. A master object can - be transformed into a server object with the method - listen (after a call to bind) or into a client object with -@@ -58,9 +58,34 @@ In case of success, a new master object - nil is returned, followed by an error message. -

    - -+ -+ -+

    -+socket.tcp6() -+

    -+ -+

    -+Creates and returns an IPv6 TCP master object. A master object can -+be transformed into a server object with the method -+listen (after a call to bind) or into a client object with -+the method connect. The only other -+method supported by a master object is the -+close method.

    -+ -+

    -+In case of success, a new master object is returned. In case of error, -+nil is returned, followed by an error message. -+

    -+ -+

    -+Note: The TCP object returned will have the option -+"ipv6-v6only" set to true. -+

    -+ - - --

    -+

    - server:accept() -

    - -@@ -87,7 +112,7 @@ might block until another clien - - - --

    -+

    - master:bind(address, port) -

    - -@@ -100,7 +125,9 @@ local host. - Port must be an integer number in the range [0..64K). - If address - is '*', the system binds to all local interfaces --using the INADDR_ANY constant. If port is 0, the system automatically -+using the INADDR_ANY constant or -+IN6ADDR_ANY_INIT, according to the family. -+If port is 0, the system automatically - chooses an ephemeral port. -

    - -@@ -116,7 +143,7 @@ is available and is a shortcut for the c - - - --

    -+

    - master:close()
    - client:close()
    - server:close() -@@ -139,7 +166,7 @@ automatically closed before destruction, - - - --

    -+

    - master:connect(address, port) -

    - -@@ -180,9 +207,18 @@ href=socket.html#select>socket.selec - established. -

    - -+

    -+Note: Starting with LuaSocket 2.1, the host name resolution -+depends on whether the socket was created by socket.tcp or socket.tcp6. Addresses from -+the appropriate family are tried in succession until the -+first success or until the last failure. -+

    -+ - - --

    -+

    - client:getpeername() -

    - -@@ -191,8 +227,9 @@ Returns information about the remote sid -

    - -

    --Returns a string with the IP address of the peer, followed by the --port number that peer is using for the connection. -+Returns a string with the IP address of the peer, the -+port number that peer is using for the connection, -+and a string with the family ("inet" or "inet6"). - In case of error, the method returns nil. -

    - -@@ -202,7 +239,7 @@ Note: It makes no sense to call this met - - - --

    -+

    - master:getsockname()
    - client:getsockname()
    - server:getsockname() -@@ -213,13 +250,15 @@ Returns the local address information as -

    - -

    --The method returns a string with local IP address and a number with --the port. In case of error, the method returns nil. -+The method returns a string with local IP address, a number with -+the local port, -+and a string with the family ("inet" or "inet6"). -+In case of error, the method returns nil. -

    - - - --

    -+

    - master:getstats()
    - client:getstats()
    - server:getstats()
    -@@ -237,7 +276,7 @@ and the age of the socket object in seco - - - --

    -+

    - master:listen(backlog) -

    - -@@ -265,7 +304,7 @@ method returns nil follo - - - --

    -+

    - client:receive([pattern [, prefix]]) -

    - -@@ -297,12 +336,12 @@ of any received data before return. - -

    - If successful, the method returns the received pattern. In case of error, --the method returns nil followed by an error message which --can be the string 'closed' in case the connection was -+the method returns nil followed by an error -+message, followed by a (possibly empty) string containing -+the partial that was received. The error message can be -+the string 'closed' in case the connection was - closed before the transmission was completed or the string - 'timeout' in case there was a timeout during the operation. --Also, after the error message, the function returns the partial result of --the transmission. -

    - -

    -@@ -316,7 +355,7 @@ too. - - - --

    -+

    - client:send(data [, i [, j]]) -

    - -@@ -354,7 +393,7 @@ instead of calling the method several ti - - - --

    -+

    - client:setoption(option [, value])
    - server:setoption(option [, value]) -

    -@@ -392,21 +431,53 @@ used in validating addresses supplied in - bind should allow reuse of local addresses; - -
  • 'tcp-nodelay': Setting this option to true --disables the Nagle's algorithm for the connection. -+disables the Nagle's algorithm for the connection; - -+
  • 'ipv6-v6only': -+Setting this option to true restricts an inet6 socket to -+sending and receiving only IPv6 packets. - - -

    --The method returns 1 in case of success, or nil otherwise. -+The method returns 1 in case of success, or nil -+followed by an error message otherwise. -

    - -

    - Note: The descriptions above come from the man pages. -

    - -+ -+ -+

    -+client:getoption(option)
    -+server:getoption(option) -+

    -+ -+

    -+Gets options for the TCP object. -+See setoption for description of the -+option names and values. -+

    -+ -+

    -+Option is a string with the option name. -+

      -+ -+
    • 'keepalive' -+
    • 'linger' -+
    • 'reuseaddr' -+
    • 'tcp-nodelay' -+
    -+ -+

    -+The method returns the option value in case of success, or -+nil followed by an error message otherwise. -+

    -+ - - --

    -+

    - master:setstats(received, sent, age)
    - client:setstats(received, sent, age)
    - server:setstats(received, sent, age)
    -@@ -429,7 +500,7 @@ The method returns 1 in case of success - - - --

    -+

    - master:settimeout(value [, mode])
    - client:settimeout(value [, mode])
    - server:settimeout(value [, mode]) -@@ -486,7 +557,7 @@ contained verbs making their imperative - - - --

    -+

    - client:shutdown(mode)
    -

    - -@@ -508,14 +579,74 @@ This is the default mode; - This function returns 1. -

    - -+ -+ -+

    -+master:dirty()
    -+client:dirty()
    -+server:dirty() -+

    -+ -+

    -+Check the read buffer status. -+

    -+ -+

    -+Returns true if there is any data in the read buffer, false otherwise. -+

    -+ -+

    -+Note: This is an internal method, any use is unlikely to be portable. -+

    -+ -+ -+ -+

    -+master:getfd()
    -+client:getfd()
    -+server:getfd() -+

    -+ -+

    -+Returns the underling socket descriptor or handle associated to the object. -+

    -+ -+

    -+The descriptor or handle. In case the object has been closed, the return will be -1. -+

    -+ -+

    -+Note: This is an internal method, any use is unlikely to be portable. -+

    -+ -+ -+ -+

    -+master:setfd(fd)
    -+client:setfd(fd)
    -+server:setfd(fd) -+

    -+ -+

    -+Sets the underling socket descriptor or handle associated to the object. The current one is simply replaced, not closed, and no other change to the object state is made. -+

    -+ -+

    -+No return value. -+

    -+ -+

    -+Note: This is an internal method, any use is unlikely to be portable. -+

    -+ - - -