From 388463b9fa865c3b2311508c41647b0f3c532031 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Thu, 21 Mar 2013 09:16:59 +0000 Subject: Import MetaPost 1.800 and LuaTeX beta-0.75.0 from LuaTeX repository r4604 git-svn-id: svn://tug.org/texlive/trunk@29453 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/texk/web2c/luatexdir/luasocket/LICENSE | 4 +- Build/source/texk/web2c/luatexdir/luasocket/NEW | 44 +- Build/source/texk/web2c/luatexdir/luasocket/README | 4 +- .../texk/web2c/luatexdir/luasocket/doc/dns.html | 69 +- .../texk/web2c/luatexdir/luasocket/doc/ftp.html | 14 +- .../texk/web2c/luatexdir/luasocket/doc/http.html | 35 +- .../texk/web2c/luatexdir/luasocket/doc/index.html | 102 +- .../luatexdir/luasocket/doc/installation.html | 86 +- .../luatexdir/luasocket/doc/introduction.html | 8 +- .../texk/web2c/luatexdir/luasocket/doc/ltn12.html | 8 +- .../texk/web2c/luatexdir/luasocket/doc/mime.html | 18 +- .../web2c/luatexdir/luasocket/doc/reference.html | 37 +- .../texk/web2c/luatexdir/luasocket/doc/smtp.html | 26 +- .../texk/web2c/luatexdir/luasocket/doc/socket.html | 93 +- .../texk/web2c/luatexdir/luasocket/doc/tcp.html | 195 +++- .../texk/web2c/luatexdir/luasocket/doc/udp.html | 169 ++- .../texk/web2c/luatexdir/luasocket/doc/url.html | 25 +- .../texk/web2c/luatexdir/luasocket/etc/b64.lua | 1 - .../web2c/luatexdir/luasocket/etc/check-links.lua | 1 - .../texk/web2c/luatexdir/luasocket/etc/dict.lua | 45 +- .../web2c/luatexdir/luasocket/etc/dispatch.lua | 3 +- .../texk/web2c/luatexdir/luasocket/etc/eol.lua | 1 - .../texk/web2c/luatexdir/luasocket/etc/get.lua | 107 +- .../texk/web2c/luatexdir/luasocket/etc/lp.lua | 9 +- .../texk/web2c/luatexdir/luasocket/etc/qp.lua | 1 - .../texk/web2c/luatexdir/luasocket/etc/tftp.lua | 69 +- .../texk/web2c/luatexdir/luasocket/luasocket.sln | 58 +- .../source/texk/web2c/luatexdir/luasocket/makefile | 77 +- .../web2c/luatexdir/luasocket/samples/cddb.lua | 2 +- .../luatexdir/luasocket/samples/daytimeclnt.lua | 1 - .../web2c/luatexdir/luasocket/samples/echoclnt.lua | 1 - .../web2c/luatexdir/luasocket/samples/echosrvr.lua | 1 - .../web2c/luatexdir/luasocket/samples/listener.lua | 1 - .../texk/web2c/luatexdir/luasocket/samples/lpr.lua | 2 +- .../web2c/luatexdir/luasocket/samples/talker.lua | 1 - .../web2c/luatexdir/luasocket/samples/tinyirc.lua | 3 +- .../texk/web2c/luatexdir/luasocket/src/auxiliar.c | 17 +- .../texk/web2c/luatexdir/luasocket/src/auxiliar.h | 5 +- .../texk/web2c/luatexdir/luasocket/src/buffer.c | 36 +- .../texk/web2c/luatexdir/luasocket/src/buffer.h | 6 +- .../texk/web2c/luatexdir/luasocket/src/except.c | 4 +- .../texk/web2c/luatexdir/luasocket/src/except.h | 2 - .../texk/web2c/luatexdir/luasocket/src/ftp.lua | 5 +- .../texk/web2c/luatexdir/luasocket/src/ftp_lua.c | 823 +++++++------- .../texk/web2c/luatexdir/luasocket/src/headers.lua | 99 ++ .../web2c/luatexdir/luasocket/src/headers_lua.c | 194 ++++ .../texk/web2c/luatexdir/luasocket/src/http.lua | 11 +- .../texk/web2c/luatexdir/luasocket/src/http_lua.c | 1163 ++++++++++---------- .../texk/web2c/luatexdir/luasocket/src/inet.c | 420 +++++-- .../texk/web2c/luatexdir/luasocket/src/inet.h | 21 +- .../source/texk/web2c/luatexdir/luasocket/src/io.c | 2 - .../source/texk/web2c/luatexdir/luasocket/src/io.h | 2 - .../texk/web2c/luatexdir/luasocket/src/ltn12.lua | 7 +- .../texk/web2c/luatexdir/luasocket/src/ltn12_lua.c | 771 +++++++------ .../web2c/luatexdir/luasocket/src/lua_preload.c | 28 +- .../texk/web2c/luatexdir/luasocket/src/luasocket.c | 6 +- .../texk/web2c/luatexdir/luasocket/src/luasocket.h | 10 +- .../texk/web2c/luatexdir/luasocket/src/mbox.lua | 88 ++ .../texk/web2c/luatexdir/luasocket/src/mbox_lua.c | 147 +++ .../texk/web2c/luatexdir/luasocket/src/mime.c | 96 +- .../texk/web2c/luatexdir/luasocket/src/mime.h | 6 +- .../texk/web2c/luatexdir/luasocket/src/mime.lua | 2 - .../texk/web2c/luatexdir/luasocket/src/mime_lua.c | 208 ++-- .../texk/web2c/luatexdir/luasocket/src/options.c | 147 ++- .../texk/web2c/luatexdir/luasocket/src/options.h | 43 +- .../texk/web2c/luatexdir/luasocket/src/select.c | 64 +- .../texk/web2c/luatexdir/luasocket/src/select.h | 2 - .../texk/web2c/luatexdir/luasocket/src/serial.c | 191 ++++ .../texk/web2c/luatexdir/luasocket/src/smtp.lua | 15 +- .../texk/web2c/luatexdir/luasocket/src/smtp_lua.c | 578 +++++----- .../texk/web2c/luatexdir/luasocket/src/socket.h | 6 +- .../texk/web2c/luatexdir/luasocket/src/socket.lua | 51 +- .../web2c/luatexdir/luasocket/src/socket_lua.c | 397 +++---- .../texk/web2c/luatexdir/luasocket/src/tcp.c | 252 ++++- .../texk/web2c/luatexdir/luasocket/src/tcp.h | 3 +- .../texk/web2c/luatexdir/luasocket/src/timeout.c | 22 +- .../texk/web2c/luatexdir/luasocket/src/timeout.h | 2 - .../texk/web2c/luatexdir/luasocket/src/tp.lua | 4 +- .../texk/web2c/luatexdir/luasocket/src/tp_lua.c | 302 +++-- .../texk/web2c/luatexdir/luasocket/src/udp.c | 262 +++-- .../texk/web2c/luatexdir/luasocket/src/udp.h | 3 +- .../texk/web2c/luatexdir/luasocket/src/unix.c | 46 +- .../texk/web2c/luatexdir/luasocket/src/unix.h | 5 +- .../texk/web2c/luatexdir/luasocket/src/url.lua | 135 +-- .../texk/web2c/luatexdir/luasocket/src/url_lua.c | 716 ++++++------ .../texk/web2c/luatexdir/luasocket/src/usocket.c | 124 ++- .../texk/web2c/luatexdir/luasocket/src/usocket.h | 7 +- .../texk/web2c/luatexdir/luasocket/src/wsocket.c | 46 +- .../texk/web2c/luatexdir/luasocket/src/wsocket.h | 13 +- .../texk/web2c/luatexdir/luasocket/test/README | 2 + .../web2c/luatexdir/luasocket/test/testclnt.lua | 190 +++- .../web2c/luatexdir/luasocket/test/testsrvr.lua | 9 +- .../web2c/luatexdir/luasocket/test/testsupport.lua | 14 +- 93 files changed, 5558 insertions(+), 3593 deletions(-) create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/headers.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/headers_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/mbox.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/mbox_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/serial.c (limited to 'Build/source/texk/web2c/luatexdir/luasocket') diff --git a/Build/source/texk/web2c/luatexdir/luasocket/LICENSE b/Build/source/texk/web2c/luatexdir/luasocket/LICENSE index 8c3cfe5bcad..5bd3478897d 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/LICENSE +++ b/Build/source/texk/web2c/luatexdir/luasocket/LICENSE @@ -1,5 +1,5 @@ -LuaSocket 2.0.2 license -Copyright © 2004-2007 Diego Nehab +LuaSocket 2.1 license +Copyright © 2004-2012 Diego Nehab Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/Build/source/texk/web2c/luatexdir/luasocket/NEW b/Build/source/texk/web2c/luatexdir/luasocket/NEW index 0191ccd500d..76b84487037 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/NEW +++ b/Build/source/texk/web2c/luatexdir/luasocket/NEW @@ -2,13 +2,37 @@ What's New This is just a bug-fix/update release. - * 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). + * Fixed: manual sample of HTTP authentication now uses correct + "authorization" header (Alexandre Ittner); + * Fixed: failure on bind() was destroying the socket (Sam Roberts); + * Fixed: receive() returns immediatelly if prefix can satisfy + bytes requested (M Joonas Pihlaja); + * Fixed: multicast didn't work on Windows, or anywhere + else for that matter (Herbert Leuwer, Adrian Sietsma); + * Fixed: select() now reports an error when called with more + sockets than FD_SETSIZE (Lorenzo Leonini); + * Fixed: manual links to home.html changed to index.html (Robert Hahn); + * Fixed: mime.unb64() would return an empty string on results that started + with a null character (Robert Raschke); + * Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray); + * Fixed: calling sleep() with negative numbers could + block forever, wasting CPU. Now it returns immediately (MPB); + * Improved: FTP commands are now sent in upper case to + help buggy servers (Anders Eurenius); + * Improved: known headers now sent in canonic + capitalization to help buggy servers (Joseph Stewart); + * Improved: Clarified tcp:receive() in the manual (MPB); + * Improved: Decent makefiles (LHF). + * Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei). + + + Yuri's bug? + Dahlberg + Sam Roberts + Thomas Harning Jr. + Sebastien Perin + remove getn in all files + ltn12.pump.all( + ltn12.source.file(io.open("original.png")), + ltn12.sink.file(io.open("copy.png", "wb")) + ) diff --git a/Build/source/texk/web2c/luatexdir/luasocket/README b/Build/source/texk/web2c/luatexdir/luasocket/README index 5d65f882fce..e9dc323bfc6 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/README +++ b/Build/source/texk/web2c/luatexdir/luasocket/README @@ -1,5 +1,5 @@ -This is the LuaSocket 2.0.1. It has been tested on WinXP, Mac OS X, -and Linux. Please use the Lua mailing list to report any bugs +This is the LuaSocket 2.1. It has been tested on --[[WinXP--]], Mac OS X, +and --[[Linux--]]. Please use the Lua mailing list to report any bugs (or "features") you encounter. Have fun, diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/dns.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/dns.html index f4c3b07d2b7..c4a0472e23e 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/dns.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/dns.html @@ -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 --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html index 9884f31339d..3f23a4a93cc 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html @@ -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 --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html index 0acac13feec..cd41c0ddb9e 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html @@ -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 client side of the HTTP 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 page informing the 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, use the generic 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 Authentication Required". 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:silva@www.example.com/private/index.html") -- 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 --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html index 57a790714ac..d8ee4a492d2 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html @@ -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: Diego Nehab

    Download

    -LuaSocket version 2.0.2 is now available for download! It is -compatible with Lua 5.1, and has +LuaSocket version 2.1-rc1 is now available for download! +It is compatible with Lua 5.1 and 5.2, and has been tested on Windows XP, Linux, and Mac OS X. Chances are it works well on most UNIX distributions and Windows flavors.

    The library can be downloaded in source code from the -LuaSocket -project page at LuaForge. -Besides the full C and Lua source code for the library, the distribution -contains several examples, this user's manual and basic test procedures. -

    - -

    -Danilo Tuler is maintaining Win32 binaries for LuaSocket, which are also -available from LuaForge. These are compatible with the -LuaBinaries, -also available from LuaForge. +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 you all!

    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 compatibility issues.

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

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

    diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html index 0288f4af31a..37c309b5d24 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html @@ -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.

    +

    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 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.

    +

    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 answered.

    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 fire the interpreter and use the 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.org, PUC-Rio

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

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

    diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/introduction.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/introduction.html index eff63676750..fd22f483deb 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/introduction.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/introduction.html @@ -25,8 +25,8 @@ Library, Support">

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


    -home · -download · +home · +download · installation · introduction · reference diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html index 001395030af..7e2f49a8c4c 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html @@ -25,8 +25,8 @@ Pump, Support, Library">

    -home · -download · +home · +download · installation · introduction · reference @@ -411,8 +411,8 @@ Creates and returns a source that produces the contents of a


    -home · -download · +home · +download · installation · introduction · reference diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html index d7faf52cbcb..ae136fd85d1 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html @@ -24,8 +24,8 @@

    -home · -download · +home · +download · installation · introduction · reference @@ -44,11 +44,11 @@ content transfer encodings, such as Base64 and Quoted-Printable. 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 --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html index b329f57f58b..e9bb5eb6fcc 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html @@ -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 --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html index 27dd4736b4b..bbbff8047b9 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html @@ -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 to anyone.

    -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 happen!

    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 --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html index ba4b7303e32..b9303cb505a 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html @@ -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 if the library was compiled 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")
    +
    +

    @@ -199,6 +245,15 @@ themselves, to simplify the test if a specific socket has 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 @@ -217,6 +272,10 @@ method or accept might block forever. 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 given amount of time.

    -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 the current LuaSocket version.


    -home · -download · +home · +download · installation · introduction · reference diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html index a16a09ed538..151a4c993c1 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html @@ -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 is returned. In case of error, 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 client shows up. -

    +

    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 creation of server sockets. -

    +

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

    +

    master:connect(address, port)

    @@ -180,9 +207,18 @@ href=socket.html#select>socket.select with the socket in the 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 side of a connected client object.

    -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 method on server objects. -

    +

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

    -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 seconds. -

    +

    master:listen(backlog)

    @@ -265,7 +304,7 @@ method returns nil followed by an error message. -

    +

    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 times. -

    +

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

    @@ -392,21 +431,53 @@ used in validating addresses supplied in a call to 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 and nil otherwise. -

    +

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

    +

    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. +

    +