From 3a8ba90dfb0c2eb224f317dd692ede426691e72a Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Wed, 25 May 2011 20:57:22 +0000 Subject: [PATCH] Saving before big changes to support IPv6. --- FIX | 13 +- NEW | 46 +++- doc/ftp.html | 6 +- doc/http.html | 13 +- doc/index.html | 16 +- doc/mime.html | 10 +- doc/smtp.html | 13 +- doc/url.html | 5 +- etc/dict.lua | 44 +-- etc/get.lua | 106 ++++---- etc/lp.lua | 8 +- etc/tftp.lua | 68 ++--- makefile | 16 +- src/buffer.c | 14 +- src/buffer.h | 4 +- src/ftp.lua | 4 +- src/inet.c | 3 +- src/makefile | 173 +++++++----- src/mbox.lua | 40 +-- src/tp.lua | 2 +- src/url.lua | 122 +++++---- src/usocket.c | 6 +- src/wsocket.c | 8 +- test/ftptest.lua | 8 +- test/httptest.lua | 188 ++++++------- test/smtptest.lua | 104 ++++---- test/testclnt.lua | 122 +++++---- test/testsupport.lua | 14 +- test/urltest.lua | 620 +++++++++++++++++++++---------------------- test/utestclnt.lua | 2 +- 30 files changed, 948 insertions(+), 850 deletions(-) diff --git a/FIX b/FIX index a688ba0..40f30a1 100644 --- a/FIX +++ b/FIX @@ -1,15 +1,14 @@ + + + + + + http was preserving old host header during redirects fix smtp.send hang on source error add create field to FTP and SMTP and fix HTTP ugliness clean timeout argument to open functions in SMTP, HTTP and FTP eliminate globals from namespaces created by module(). - - - - - - - url.absolute was not working when base_url was already parsed http.request was redirecting even when the location header was empty tcp{client}:shutdown() was checking for group instead of class. diff --git a/NEW b/NEW index 6c6b095..76b8448 100644 --- a/NEW +++ b/NEW @@ -2,19 +2,37 @@ What's New This is just a bug-fix/update release. - * Fixed: manual links to home.html changed to index.html (Robert Hahn) - * Fixed: mime.unb64() returns empty string on results that start - with a null character (Robert Raschke) - * Fixed: HTTP now automatically redirecting on 303 and 307 (Jonathan Gray) - * Fixed: sleep(-1) could sleep forever wasting CPU. Now it - returns immediately (MPB); + * 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). - * 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); - * Fixed: multicast didn't work on Windows (Herbert Leuwer, Adrian Sietsma) - * Fixed: select() reports an error when called with more - sockets than FD_SETSIZE (Lorenzo Leonini) + 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/doc/ftp.html b/doc/ftp.html index 1f6335e..3f23a4a 100644 --- a/doc/ftp.html +++ b/doc/ftp.html @@ -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:

diff --git a/doc/http.html b/doc/http.html index a274aef..66282a4 100644 --- a/doc/http.html +++ b/doc/http.html @@ -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:

@@ -199,8 +197,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.

@@ -278,7 +275,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 +301,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")) } } diff --git a/doc/index.html b/doc/index.html index 5b54c59..665b97b 100644 --- a/doc/index.html +++ b/doc/index.html @@ -138,18 +138,22 @@ all!