aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2006-04-03 04:45:42 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2006-04-03 04:45:42 +0000
commit11282d17c8ecb6aa6fa31a3de742eae0215f4cc0 (patch)
treeaeb65849f145f06f6fb0ddd6a54f79d30912be1f
parente9d477aba3bbc084c0a7872e4eaf725e2689e4a6 (diff)
downloadluasocket-11282d17c8ecb6aa6fa31a3de742eae0215f4cc0.tar.gz
luasocket-11282d17c8ecb6aa6fa31a3de742eae0215f4cc0.tar.bz2
luasocket-11282d17c8ecb6aa6fa31a3de742eae0215f4cc0.zip
Almost done 2.0.1.
-rw-r--r--LICENSE4
-rw-r--r--NEW69
-rw-r--r--README2
-rw-r--r--config24
-rw-r--r--doc/http.html10
-rw-r--r--doc/index.html77
-rw-r--r--doc/installation.html4
-rw-r--r--makefile.dist4
-rw-r--r--src/ltn12.lua1
-rw-r--r--src/luasocket.h4
-rw-r--r--src/mime.h4
-rw-r--r--src/url.lua2
-rw-r--r--test/auth/.htaccess4
-rw-r--r--test/httptest.lua3
14 files changed, 72 insertions, 140 deletions
diff --git a/LICENSE b/LICENSE
index 90d88e7..67f0f85 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
1LuaSocket 2.0 license 1LuaSocket 2.0.1 license
2Copyright © 2004-2005 Diego Nehab 2Copyright © 2004-2006 Diego Nehab
3 3
4Permission is hereby granted, free of charge, to any person obtaining a 4Permission is hereby granted, free of charge, to any person obtaining a
5copy of this software and associated documentation files (the "Software"), 5copy 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 @@
1What's New 1What's New
2 2
3There is no big change for the 2.0 (final) release. It is 3This is just a bug-fix/update release.
4basically a bug fix release. The main improvement is in the
5non-blocking support.
6 4
7 * New: sample module dispatch.lua implements a coroutine 5 * Updated: now using compat-5.1r5;
8 based dispatcher; 6
9 * New: sample check-links.lua works both in blocking and 7 * Improved: http.request is more robust to malformed
10 non-blocking mode using coroutines (using the new 8 URLs (Adrian Sietsma);
11 dispatcher); 9
12 * New: sample forward.lua implements a coroutine based 10 * Improved: the simple http.request interface sends a
13 forward server (using the new dispatcher); 11 "Content-type: application/x-www-form-urlencoded" header
14 * Improved: tcp:send(data, i, j) to return (i+sent-1). This 12 (William Trenker);
15 is great for non-blocking I/O, but might break some code; 13
16 * Improved: HTTP, SMTP, and FTP functions to accept a new 14 * Improved: http.request is robust to evil servers that
17 field create that overrides the function used to create 15 send inappropriate 100-continue messages (David Burgess);
18 socket objects; 16
19 * Improved: smtp.message now supports multipart/alternative 17 * Fixed: sample unix.c had fallen through the cracks
20 (for the HTML messages we all love so much); 18 during development (Matthew Percival);
21 * Fixed: smtp.send was hanging on errors returned by LTN12 19
22 sources; 20 * Fixed: error code was not being propagated correctly
23 * Fixed: url.absolute() to work when base_url is in parsed 21 in ftp.lua (David Burgess).
24 form;
25 * Fixed: http.request() not to redirect when the location
26 header is empty (naughty servers...);
27 * Fixed: tcp{client}:shutdown() to check for class instead
28 of group;
29 * Fixed: The manual to stop using socket.try() in place of
30 assert(), since it can't;
31 * Improved: Got rid of package.loaded.base = _G kludge;
32 * Fixed: Parts of the manual referred to require("http")
33 instead of require("socket.http");
34 * Improved: Socket and MIME binaries are called 'core' each
35 inside their directory (ex. "socket/core.dll"). The 'l'
36 prefix was just a bad idea;
37 * Improved: Using bundles in Mac OS X, instead of dylibs;
38 * Fixed: luasocket.h to export luaopen_socket_core;
39 * Fixed: udp:setpeername() so you can "disconnect" an UDP
40 socket;
41 * Fixed: A weird bug in HTTP support that caused some
42 requests to fail (Florian Berger);
43 * Fixed: Bug in socket.select() that caused sockets with
44 descriptor 0 to be ignored (Renato Maia);
45 * Fixed: "Bug" that caused dns.toip() to crash under uLinux
46 (William Trenker);
47 * Fixed: "Bug" that caused gethostbyname to crash under VMS
48 (Renato Maia);
49 * Fixed: tcp:send("") to return 0 bytes sent (Alexander
50 Marinov);
51 * Improved: socket.DEBUG and socket.VERSION became
52 socket._DEBUGs and socket._VERSION for uniformity with other
53 libraries;
54 * Improved: socket.select now works on empty sets on Windows.
diff --git a/README b/README
index acb4dfe..5d65f88 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
1This is the LuaSocket 2.0. It has been tested on WinXP, Mac OS X, 1This is the LuaSocket 2.0.1. It has been tested on WinXP, Mac OS X,
2and Linux. Please use the Lua mailing list to report any bugs 2and Linux. Please use the Lua mailing list to report any bugs
3(or "features") you encounter. 3(or "features") you encounter.
4 4
diff --git a/config b/config
index 3954974..b529c1a 100644
--- a/config
+++ b/config
@@ -6,8 +6,8 @@
6# Output file names 6# Output file names
7# 7#
8EXT=so 8EXT=so
9SOCKET_V=2.0.0 9SOCKET_V=2.0.1
10MIME_V=1.0.0 10MIME_V=1.0.1
11SOCKET_SO=socket.$(EXT).$(SOCKET_V) 11SOCKET_SO=socket.$(EXT).$(SOCKET_V)
12MIME_SO=mime.$(EXT).$(MIME_V) 12MIME_SO=mime.$(EXT).$(MIME_V)
13UNIX_SO=unix.$(EXT) 13UNIX_SO=unix.$(EXT)
@@ -37,20 +37,20 @@ INSTALL_EXEC=cp
37# Compiler and linker settings 37# Compiler and linker settings
38# for Mac OS X 38# for Mac OS X
39# 39#
40#CC=gcc 40CC=gcc
41#DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN 41DEF=-DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN
42#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common 42CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common
43#LDFLAGS=-bundle -undefined dynamic_lookup 43LDFLAGS=-bundle -undefined dynamic_lookup
44#LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc 44LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc
45 45
46#------ 46#------
47# Compiler and linker settings 47# Compiler and linker settings
48# for Linux 48# for Linux
49CC=gcc 49#CC=gcc
50DEF=-DLUASOCKET_DEBUG 50#DEF=-DLUASOCKET_DEBUG
51CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic 51#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic
52LDFLAGS=-O -shared 52#LDFLAGS=-O -shared
53LD=gcc 53#LD=gcc
54 54
55#------ 55#------
56# End of makefile configuration 56# 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;
188In case of failure, the function returns <tt><b>nil</b></tt> followed by an 188In case of failure, the function returns <tt><b>nil</b></tt> followed by an
189error message. If successful, the simple form returns the response 189error message. If successful, the simple form returns the response
190body as a string, followed by the response status code, the response 190body as a string, followed by the response status code, the response
191headers and the response status line. The complex function returns the same 191headers and the response status line. The generic function returns the same
192information, except the first return value is just the number 1 (the body 192information, except the first return value is just the number 1 (the body
193goes to the <tt>sink</tt>). 193goes to the <tt>sink</tt>).
194</p> 194</p>
@@ -259,6 +259,14 @@ r, c, h = http.request {
259-- } 259-- }
260</pre> 260</pre>
261 261
262<p class=note id=post>
263Note: When sending a POST request, simple interface adds a
264"<tt>Content-type: application/x-www-form-urlencoded</tt>"
265header to the request. This is the type used by
266HTML forms. If you need another type, use the generic
267interface.
268</p>
269
262<p class=note id=authentication> 270<p class=note id=authentication>
263Note: Some URLs are protected by their 271Note: Some URLs are protected by their
264servers from anonymous download. For those URLs, the server must receive 272servers 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.
78</p> 78</p>
79 79
80<p> 80<p>
81Copyright &copy; 2004-2005 Diego Nehab. All rights reserved. <br> 81Copyright &copy; 2004-2006 Diego Nehab. All rights reserved. <br>
82Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a> 82Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a>
83</p> 83</p>
84 84
@@ -87,8 +87,8 @@ Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a>
87<h2 id=download>Download</h2> 87<h2 id=download>Download</h2>
88 88
89<p> 89<p>
90LuaSocket version 2.0 (final) is now available for download! It is 90LuaSocket version 2.0.1 is now available for download! It is
91compatible with Lua&nbsp;5.0 and has been tested on 91compatible with Lua&nbsp;5.0 and has been tested on
92Windows&nbsp;XP, Linux, and Mac OS X. 92Windows&nbsp;XP, Linux, and Mac OS X.
93</p> 93</p>
94 94
@@ -159,65 +159,24 @@ has been helping a lot too! Thanks to you all!
159<h2 id=new>What's New</h2> 159<h2 id=new>What's New</h2>
160 160
161<p> 161<p>
162There is no big change for the 2.0 (final) release. It is basically a 162This is just a bug-fix/update release.
163bug fix release. The only improvement is in the non-blocking
164support.
165</p> 163</p>
166 164
167<ul> 165<ul>
168<li> New: sample module <tt>dispatch.lua</tt> implements a 166<li> Updated: now using <tt>compat-5.1r5</tt>;
169coroutine based dispatcher; 167<li> Improved: <tt>http.request</tt> is more robust to
170<li> New: sample <tt>check-links.lua</tt> works 168malformed URLs (Adrian Sietsma);
171both in blocking and non-blocking mode using coroutines 169<li> Improved: the simple <tt>http.request</tt> interface sends a
172(using the new dispatcher); 170"<tt>Content-type: application/x-www-form-urlencoded</tt>"
173<li> New: sample <tt>forward.lua</tt> implements a coroutine 171header (William Trenker);
174based forward server (using the new dispatcher); 172<li> Improved: <tt>http.request</tt> is robust to evil
175<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; 173servers that send inappropriate 100-continue messages
176<li> Improved: HTTP, SMTP, and FTP functions to accept a new field 174(David Burgess);
177<tt>create</tt> that overrides the function used to create socket objects; 175<li> Fixed: sample <tt>unix.c</tt> had fallen through the
178<li> Improved: <tt>smtp.message</tt> now supports multipart/alternative 176cracks during development (Matthew Percival);
179(for the HTML messages we all love so much); 177<li> Fixed: error code was not being propagated correctly in
180<li> Fixed: <tt>smtp.send</tt> was hanging on errors returned by LTN12 sources; 178ftp.lua (David Burgess).
181<li> Fixed: <tt>url.absolute()</tt> to work when <tt>base_url</tt> is in 179<li>
182parsed form;
183<li> Fixed: <tt>http.request()</tt> not to redirect when the location
184header is empty (naughty servers...);
185<li> Fixed: <tt>tcp{client}:shutdown()</tt> to check for class instead of
186group;
187<li> Fixed: The manual to stop using <tt>socket.try()</tt> in place of
188<tt>assert()</tt>, since it can't;
189<li> Improved: Got rid of <tt>package.loaded.base = _G</tt> kludge;
190<li> Fixed: Parts of the manual referred to <tt>require("http")</tt> instead of
191<tt>require("socket.http")</tt>;
192<li> Improved: Socket and MIME binaries are called 'core' each inside their
193directory (ex. "socket/core.dll"). The 'l' prefix was just a bad idea;
194<li> Improved: Using bundles in Mac OS X, instead of dylibs;
195<li> Fixed: <tt>luasocket.h</tt> to export <tt>luaopen_socket_core</tt>;
196<li> Fixed: <tt>udp:setpeername()</tt> so you can "disconnect" an
197<tt>UDP</tt> socket;
198<li> Fixed: A weird bug in HTTP support that caused some requests to
199fail (Florian Berger);
200<li> Fixed: Bug in <tt>socket.select()</tt> that caused sockets
201with descriptor 0 to be ignored (Renato Maia);
202<li> Fixed: "Bug" that caused <tt>dns.toip()</tt> to crash under uLinux
203(William Trenker);
204<li> Fixed: "Bug" that caused <tt>gethostbyname</tt> to crash under VMS
205(Renato Maia);
206<li> Fixed: <tt>tcp:send("")</tt> to return 0 bytes sent (Alexander Marinov);
207<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;
208<li> Improved: <tt>socket.select</tt> now works on empty sets on Windows.
209</ul>
210
211<!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
212
213<h3 id=incompatible>Incompatibilities with previous versions</h3>
214
215<ul>
216<li> If you use the return value of <tt>tcp:send()</tt> <em>and</em> you
217use the extra parameters to select only part of the string to be sent, your
218code is now broken, but when you fix it, it will be much simpler;
219<li> If you check <tt>socket.DEBUG</tt> or <tt>socket.VERSION</tt>,
220change it to <tt>socket._DEBUG</tt> or <tt>socket._VERSION</tt>.
221</ul> 180</ul>
222 181
223<!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 182<!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
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">
39 39
40<h2>Installation</h2> 40<h2>Installation</h2>
41 41
42<p> LuaSocket 2.0 uses the new package proposal for Lua 5.1. 42<p> LuaSocket 2.0.1 uses the new package proposal for Lua 5.1.
43All Lua library developers are encouraged to update their libraries so that 43All Lua library developers are encouraged to update their libraries so that
44all libraries can coexist peacefully and users can benefit from the 44all libraries can coexist peacefully and users can benefit from the
45standardization and flexibility of the standard. 45standardization and flexibility of the standard.
@@ -123,7 +123,7 @@ it should be easy to use LuaSocket. Just fire the interpreter and use the
123Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio 123Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
124&gt; socket = require("socket") 124&gt; socket = require("socket")
125&gt; print(socket._VERSION) 125&gt; print(socket._VERSION)
126--&gt; LuaSocket 2.0 126--&gt; LuaSocket 2.0.1
127</pre> 127</pre>
128 128
129<p> Each module loads their dependencies automatically, so you only need to 129<p> 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 @@
1#-------------------------------------------------------------------------- 1#--------------------------------------------------------------------------
2# Distribution makefile 2# Distribution makefile
3#-------------------------------------------------------------------------- 3#--------------------------------------------------------------------------
4DIST = luasocket-2.0 4DIST = luasocket-2.0.1
5 5
6COMPAT = src/compat-5.1r4 6COMPAT = src/compat-5.1r5
7 7
8TEST = \ 8TEST = \
9 test/README \ 9 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 = {}
20 20
21-- 2048 seems to be better in windows... 21-- 2048 seems to be better in windows...
22BLOCKSIZE = 2048 22BLOCKSIZE = 2048
23_VERSION = "LTN12 1.0.1"
23 24
24----------------------------------------------------------------------------- 25-----------------------------------------------------------------------------
25-- Filter stuff 26-- 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 @@
13/*-------------------------------------------------------------------------*\ 13/*-------------------------------------------------------------------------*\
14* Current socket library version 14* Current socket library version
15\*-------------------------------------------------------------------------*/ 15\*-------------------------------------------------------------------------*/
16#define LUASOCKET_VERSION "LuaSocket 2.0" 16#define LUASOCKET_VERSION "LuaSocket 2.0.1"
17#define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2005 Diego Nehab" 17#define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2006 Diego Nehab"
18#define LUASOCKET_AUTHORS "Diego Nehab" 18#define LUASOCKET_AUTHORS "Diego Nehab"
19 19
20/*-------------------------------------------------------------------------*\ 20/*-------------------------------------------------------------------------*\
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 @@
15/*-------------------------------------------------------------------------*\ 15/*-------------------------------------------------------------------------*\
16* Current MIME library version 16* Current MIME library version
17\*-------------------------------------------------------------------------*/ 17\*-------------------------------------------------------------------------*/
18#define MIME_VERSION "MIME 1.0" 18#define MIME_VERSION "MIME 1.0.1"
19#define MIME_COPYRIGHT "Copyright (C) 2004-2005 Diego Nehab" 19#define MIME_COPYRIGHT "Copyright (C) 2004-2006 Diego Nehab"
20#define MIME_AUTHORS "Diego Nehab" 20#define MIME_AUTHORS "Diego Nehab"
21 21
22/*-------------------------------------------------------------------------*\ 22/*-------------------------------------------------------------------------*\
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")
16----------------------------------------------------------------------------- 16-----------------------------------------------------------------------------
17-- Module version 17-- Module version
18----------------------------------------------------------------------------- 18-----------------------------------------------------------------------------
19_VERSION = "URL 1.0" 19_VERSION = "URL 1.0.1"
20 20
21----------------------------------------------------------------------------- 21-----------------------------------------------------------------------------
22-- Encodes a string into its escaped hexadecimal representation 22-- 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 @@
1AuthName "Test Realm"
2AuthType Basic
3AuthUserFile /home/diego/tec/luasocket/test/auth/.htpasswd
4require 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
23local t = socket.gettime() 23local t = socket.gettime()
24 24
25--host = host or "diego.student.princeton.edu" 25--host = host or "diego.student.princeton.edu"
26host = host or "dell-diego" 26--host = host or "diego.student.princeton.edu"
27host = host or "localhost"
27proxy = proxy or "http://localhost:3128" 28proxy = proxy or "http://localhost:3128"
28prefix = prefix or "/luasocket-test" 29prefix = prefix or "/luasocket-test"
29cgiprefix = cgiprefix or "/luasocket-test-cgi" 30cgiprefix = cgiprefix or "/luasocket-test-cgi"