Almost done 2.0.1.

master
Diego Nehab 2006-04-03 04:45:42 +00:00
parent e9d477aba3
commit 11282d17c8
14 changed files with 72 additions and 140 deletions

View File

@ -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"),

69
NEW
View File

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

2
README
View File

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

24
config
View File

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

View File

@ -188,7 +188,7 @@ function from automatically following 301 or 302 server redirect messages;
In case of failure, the function returns <tt><b>nil</b></tt> 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 <tt>sink</tt>).
</p>
@ -259,6 +259,14 @@ r, c, h = http.request {
-- }
</pre>
<p class=note id=post>
Note: When sending a POST request, simple interface adds a
"<tt>Content-type: application/x-www-form-urlencoded</tt>"
header to the request. This is the type used by
HTML forms. If you need another type, use the generic
interface.
</p>
<p class=note id=authentication>
Note: Some URLs are protected by their
servers from anonymous download. For those URLs, the server must receive

View File

@ -78,7 +78,7 @@ LuaSocket.
</p>
<p>
Copyright &copy; 2004-2005 Diego Nehab. All rights reserved. <br>
Copyright &copy; 2004-2006 Diego Nehab. All rights reserved. <br>
Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a>
</p>
@ -87,8 +87,8 @@ Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a>
<h2 id=download>Download</h2>
<p>
LuaSocket version 2.0 (final) is now available for download! It is
compatible with Lua&nbsp;5.0 and has been tested on
LuaSocket version 2.0.1 is now available for download! It is
compatible with Lua&nbsp;5.0 and has been tested on
Windows&nbsp;XP, Linux, and Mac OS X.
</p>
@ -159,65 +159,24 @@ has been helping a lot too! Thanks to you all!
<h2 id=new>What's New</h2>
<p>
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.
</p>
<ul>
<li> New: sample module <tt>dispatch.lua</tt> implements a
coroutine based dispatcher;
<li> New: sample <tt>check-links.lua</tt> works
both in blocking and non-blocking mode using coroutines
(using the new dispatcher);
<li> New: sample <tt>forward.lua</tt> implements a coroutine
based forward server (using the new dispatcher);
<li> Improved: <tt>tcp:send(data, i, j)</tt> to return <tt>(i+sent-1)</tt>. This is great for non-blocking I/O, but might break some code;
<li> Improved: HTTP, SMTP, and FTP functions to accept a new field
<tt>create</tt> that overrides the function used to create socket objects;
<li> Improved: <tt>smtp.message</tt> now supports multipart/alternative
(for the HTML messages we all love so much);
<li> Fixed: <tt>smtp.send</tt> was hanging on errors returned by LTN12 sources;
<li> Fixed: <tt>url.absolute()</tt> to work when <tt>base_url</tt> is in
parsed form;
<li> Fixed: <tt>http.request()</tt> not to redirect when the location
header is empty (naughty servers...);
<li> Fixed: <tt>tcp{client}:shutdown()</tt> to check for class instead of
group;
<li> Fixed: The manual to stop using <tt>socket.try()</tt> in place of
<tt>assert()</tt>, since it can't;
<li> Improved: Got rid of <tt>package.loaded.base = _G</tt> kludge;
<li> Fixed: Parts of the manual referred to <tt>require("http")</tt> instead of
<tt>require("socket.http")</tt>;
<li> Improved: Socket and MIME binaries are called 'core' each inside their
directory (ex. "socket/core.dll"). The 'l' prefix was just a bad idea;
<li> Improved: Using bundles in Mac OS X, instead of dylibs;
<li> Fixed: <tt>luasocket.h</tt> to export <tt>luaopen_socket_core</tt>;
<li> Fixed: <tt>udp:setpeername()</tt> so you can "disconnect" an
<tt>UDP</tt> socket;
<li> Fixed: A weird bug in HTTP support that caused some requests to
fail (Florian Berger);
<li> Fixed: Bug in <tt>socket.select()</tt> that caused sockets
with descriptor 0 to be ignored (Renato Maia);
<li> Fixed: "Bug" that caused <tt>dns.toip()</tt> to crash under uLinux
(William Trenker);
<li> Fixed: "Bug" that caused <tt>gethostbyname</tt> to crash under VMS
(Renato Maia);
<li> Fixed: <tt>tcp:send("")</tt> to return 0 bytes sent (Alexander Marinov);
<li> Improved: <tt>socket.DEBUG</tt> and <tt>socket.VERSION</tt> became <tt>socket._DEBUGs</tt> and <tt>socket._VERSION</tt> for uniformity with other libraries;
<li> Improved: <tt>socket.select</tt> now works on empty sets on Windows.
</ul>
<!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h3 id=incompatible>Incompatibilities with previous versions</h3>
<ul>
<li> If you use the return value of <tt>tcp:send()</tt> <em>and</em> you
use the extra parameters to select only part of the string to be sent, your
code is now broken, but when you fix it, it will be much simpler;
<li> If you check <tt>socket.DEBUG</tt> or <tt>socket.VERSION</tt>,
change it to <tt>socket._DEBUG</tt> or <tt>socket._VERSION</tt>.
<li> Updated: now using <tt>compat-5.1r5</tt>;
<li> Improved: <tt>http.request</tt> is more robust to
malformed URLs (Adrian Sietsma);
<li> Improved: the simple <tt>http.request</tt> interface sends a
"<tt>Content-type: application/x-www-form-urlencoded</tt>"
header (William Trenker);
<li> Improved: <tt>http.request</tt> is robust to evil
servers that send inappropriate 100-continue messages
(David Burgess);
<li> Fixed: sample <tt>unix.c</tt> had fallen through the
cracks during development (Matthew Percival);
<li> Fixed: error code was not being propagated correctly in
ftp.lua (David Burgess).
<li>
</ul>
<!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

View File

@ -39,7 +39,7 @@ Installation">
<h2>Installation</h2>
<p> LuaSocket 2.0 uses the new package proposal for Lua 5.1.
<p> 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
&gt; socket = require("socket")
&gt; print(socket._VERSION)
--&gt; LuaSocket 2.0
--&gt; LuaSocket 2.0.1
</pre>
<p> Each module loads their dependencies automatically, so you only need to

View File

@ -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 \

View File

@ -20,6 +20,7 @@ pump = {}
-- 2048 seems to be better in windows...
BLOCKSIZE = 2048
_VERSION = "LTN12 1.0.1"
-----------------------------------------------------------------------------
-- Filter stuff

View File

@ -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"
/*-------------------------------------------------------------------------*\

View File

@ -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"
/*-------------------------------------------------------------------------*\

View File

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

View File

@ -1,4 +0,0 @@
AuthName "Test Realm"
AuthType Basic
AuthUserFile /home/diego/tec/luasocket/test/auth/.htpasswd
require valid-user

View File

@ -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"