From 11282d17c8ecb6aa6fa31a3de742eae0215f4cc0 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Mon, 3 Apr 2006 04:45:42 +0000 Subject: Almost done 2.0.1. --- LICENSE | 4 +-- NEW | 69 ++++++++++++--------------------------------- README | 2 +- config | 24 ++++++++-------- doc/http.html | 10 ++++++- doc/index.html | 77 ++++++++++++--------------------------------------- doc/installation.html | 4 +-- makefile.dist | 4 +-- src/ltn12.lua | 1 + src/luasocket.h | 4 +-- src/mime.h | 4 +-- src/url.lua | 2 +- test/auth/.htaccess | 4 --- test/httptest.lua | 3 +- 14 files changed, 72 insertions(+), 140 deletions(-) delete mode 100644 test/auth/.htaccess diff --git a/LICENSE b/LICENSE index 90d88e7..67f0f85 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ -LuaSocket 2.0 license -Copyright © 2004-2005 Diego Nehab +LuaSocket 2.0.1 license +Copyright © 2004-2006 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/NEW b/NEW index 7c94368..f6210b2 100644 --- a/NEW +++ b/NEW @@ -1,54 +1,21 @@ What's New -There is no big change for the 2.0 (final) release. It is -basically a bug fix release. The main improvement is in the -non-blocking support. +This is just a bug-fix/update release. - * New: sample module dispatch.lua implements a coroutine - based dispatcher; - * New: sample check-links.lua works both in blocking and - non-blocking mode using coroutines (using the new - dispatcher); - * New: sample forward.lua implements a coroutine based - forward server (using the new dispatcher); - * Improved: tcp:send(data, i, j) to return (i+sent-1). This - is great for non-blocking I/O, but might break some code; - * Improved: HTTP, SMTP, and FTP functions to accept a new - field create that overrides the function used to create - socket objects; - * Improved: smtp.message now supports multipart/alternative - (for the HTML messages we all love so much); - * Fixed: smtp.send was hanging on errors returned by LTN12 - sources; - * Fixed: url.absolute() to work when base_url is in parsed - form; - * Fixed: http.request() not to redirect when the location - header is empty (naughty servers...); - * Fixed: tcp{client}:shutdown() to check for class instead - of group; - * Fixed: The manual to stop using socket.try() in place of - assert(), since it can't; - * Improved: Got rid of package.loaded.base = _G kludge; - * Fixed: Parts of the manual referred to require("http") - instead of require("socket.http"); - * Improved: Socket and MIME binaries are called 'core' each - inside their directory (ex. "socket/core.dll"). The 'l' - prefix was just a bad idea; - * Improved: Using bundles in Mac OS X, instead of dylibs; - * Fixed: luasocket.h to export luaopen_socket_core; - * Fixed: udp:setpeername() so you can "disconnect" an UDP - socket; - * Fixed: A weird bug in HTTP support that caused some - requests to fail (Florian Berger); - * Fixed: Bug in socket.select() that caused sockets with - descriptor 0 to be ignored (Renato Maia); - * Fixed: "Bug" that caused dns.toip() to crash under uLinux - (William Trenker); - * Fixed: "Bug" that caused gethostbyname to crash under VMS - (Renato Maia); - * Fixed: tcp:send("") to return 0 bytes sent (Alexander - Marinov); - * Improved: socket.DEBUG and socket.VERSION became - socket._DEBUGs and socket._VERSION for uniformity with other - libraries; - * Improved: socket.select now works on empty sets on Windows. + * 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: 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). diff --git a/README b/README index acb4dfe..5d65f88 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -This is the LuaSocket 2.0. It has been tested on WinXP, Mac OS X, +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 (or "features") you encounter. diff --git a/config b/config index 3954974..b529c1a 100644 --- a/config +++ b/config @@ -6,8 +6,8 @@ # Output file names # EXT=so -SOCKET_V=2.0.0 -MIME_V=1.0.0 +SOCKET_V=2.0.1 +MIME_V=1.0.1 SOCKET_SO=socket.$(EXT).$(SOCKET_V) MIME_SO=mime.$(EXT).$(MIME_V) UNIX_SO=unix.$(EXT) @@ -37,20 +37,20 @@ INSTALL_EXEC=cp # Compiler and linker settings # for Mac OS X # -#CC=gcc -#DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN -#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common -#LDFLAGS=-bundle -undefined dynamic_lookup -#LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc +CC=gcc +DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN +CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common +LDFLAGS=-bundle -undefined dynamic_lookup +LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc #------ # Compiler and linker settings # for Linux -CC=gcc -DEF=-DLUASOCKET_DEBUG -CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic -LDFLAGS=-O -shared -LD=gcc +#CC=gcc +#DEF=-DLUASOCKET_DEBUG +#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic +#LDFLAGS=-O -shared +#LD=gcc #------ # End of makefile configuration diff --git a/doc/http.html b/doc/http.html index a60ed25..992ac7a 100644 --- a/doc/http.html +++ b/doc/http.html @@ -188,7 +188,7 @@ function from automatically following 301 or 302 server redirect messages; In case of failure, the function returns nil followed by an error message. If successful, the simple form returns the response body as a string, followed by the response status code, the response -headers and the response status line. The complex function returns the same +headers and the response status line. The generic function returns the same information, except the first return value is just the number 1 (the body goes to the sink).

@@ -259,6 +259,14 @@ 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 +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 diff --git a/doc/index.html b/doc/index.html index f740d91..d5a1f30 100644 --- a/doc/index.html +++ b/doc/index.html @@ -78,7 +78,7 @@ LuaSocket.

-Copyright © 2004-2005 Diego Nehab. All rights reserved.
+Copyright © 2004-2006 Diego Nehab. All rights reserved.
Author: Diego Nehab

@@ -87,8 +87,8 @@ Author: Diego Nehab

Download

-LuaSocket version 2.0 (final) is now available for download! It is -compatible with Lua 5.0 and has been tested on +LuaSocket version 2.0.1 is now available for download! It is +compatible with Lua 5.0 and has been tested on Windows XP, Linux, and Mac OS X.

@@ -159,65 +159,24 @@ has been helping a lot too! Thanks to you all!

What's New

-There is no big change for the 2.0 (final) release. It is basically a -bug fix release. The only improvement is in the non-blocking -support. +This is just a bug-fix/update release.

- - - -

Incompatibilities with previous versions

- - diff --git a/doc/installation.html b/doc/installation.html index fa1d96f..725db42 100644 --- a/doc/installation.html +++ b/doc/installation.html @@ -39,7 +39,7 @@ Installation">

Installation

-

LuaSocket 2.0 uses the new package proposal for Lua 5.1. +

LuaSocket 2.0.1 uses the new package proposal 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. @@ -123,7 +123,7 @@ it should be easy to use LuaSocket. Just fire the interpreter and use the Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio > socket = require("socket") > print(socket._VERSION) ---> LuaSocket 2.0 +--> LuaSocket 2.0.1

Each module loads their dependencies automatically, so you only need to diff --git a/makefile.dist b/makefile.dist index aefb41c..e3b0e5c 100644 --- a/makefile.dist +++ b/makefile.dist @@ -1,9 +1,9 @@ #-------------------------------------------------------------------------- # Distribution makefile #-------------------------------------------------------------------------- -DIST = luasocket-2.0 +DIST = luasocket-2.0.1 -COMPAT = src/compat-5.1r4 +COMPAT = src/compat-5.1r5 TEST = \ test/README \ diff --git a/src/ltn12.lua b/src/ltn12.lua index c49d130..f10ad18 100644 --- a/src/ltn12.lua +++ b/src/ltn12.lua @@ -20,6 +20,7 @@ pump = {} -- 2048 seems to be better in windows... BLOCKSIZE = 2048 +_VERSION = "LTN12 1.0.1" ----------------------------------------------------------------------------- -- Filter stuff diff --git a/src/luasocket.h b/src/luasocket.h index 0143fa7..46b5d06 100644 --- a/src/luasocket.h +++ b/src/luasocket.h @@ -13,8 +13,8 @@ /*-------------------------------------------------------------------------*\ * Current socket library version \*-------------------------------------------------------------------------*/ -#define LUASOCKET_VERSION "LuaSocket 2.0" -#define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2005 Diego Nehab" +#define LUASOCKET_VERSION "LuaSocket 2.0.1" +#define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2006 Diego Nehab" #define LUASOCKET_AUTHORS "Diego Nehab" /*-------------------------------------------------------------------------*\ diff --git a/src/mime.h b/src/mime.h index a56751c..166cf5b 100644 --- a/src/mime.h +++ b/src/mime.h @@ -15,8 +15,8 @@ /*-------------------------------------------------------------------------*\ * Current MIME library version \*-------------------------------------------------------------------------*/ -#define MIME_VERSION "MIME 1.0" -#define MIME_COPYRIGHT "Copyright (C) 2004-2005 Diego Nehab" +#define MIME_VERSION "MIME 1.0.1" +#define MIME_COPYRIGHT "Copyright (C) 2004-2006 Diego Nehab" #define MIME_AUTHORS "Diego Nehab" /*-------------------------------------------------------------------------*\ diff --git a/src/url.lua b/src/url.lua index c700f90..18e5ab2 100644 --- a/src/url.lua +++ b/src/url.lua @@ -16,7 +16,7 @@ module("socket.url") ----------------------------------------------------------------------------- -- Module version ----------------------------------------------------------------------------- -_VERSION = "URL 1.0" +_VERSION = "URL 1.0.1" ----------------------------------------------------------------------------- -- Encodes a string into its escaped hexadecimal representation diff --git a/test/auth/.htaccess b/test/auth/.htaccess deleted file mode 100644 index b9f100e..0000000 --- a/test/auth/.htaccess +++ /dev/null @@ -1,4 +0,0 @@ -AuthName "Test Realm" -AuthType Basic -AuthUserFile /home/diego/tec/luasocket/test/auth/.htpasswd -require valid-user diff --git a/test/httptest.lua b/test/httptest.lua index 92528b2..ac60787 100644 --- a/test/httptest.lua +++ b/test/httptest.lua @@ -23,7 +23,8 @@ http.TIMEOUT = 10 local t = socket.gettime() --host = host or "diego.student.princeton.edu" -host = host or "dell-diego" +--host = host or "diego.student.princeton.edu" +host = host or "localhost" proxy = proxy or "http://localhost:3128" prefix = prefix or "/luasocket-test" cgiprefix = cgiprefix or "/luasocket-test-cgi" -- cgit v1.2.3-55-g6feb