aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2005-06-14 04:29:23 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2005-06-14 04:29:23 +0000
commit65c35845c54c7f84b1cf5b0e3d4c7bbdaf1014e3 (patch)
treef6e3f1a31451281ac2a347c3080e9749456dac29
parent8b114f3bf4ccea3b065551fa94649a9e45935b5b (diff)
downloadluasocket-65c35845c54c7f84b1cf5b0e3d4c7bbdaf1014e3.tar.gz
luasocket-65c35845c54c7f84b1cf5b0e3d4c7bbdaf1014e3.tar.bz2
luasocket-65c35845c54c7f84b1cf5b0e3d4c7bbdaf1014e3.zip
Working on the manual.
-rw-r--r--FIX15
-rw-r--r--TODO3
-rw-r--r--doc/index.html94
-rw-r--r--doc/reference.html4
-rw-r--r--doc/socket.html8
-rw-r--r--etc/dict.lua2
-rw-r--r--etc/lp.lua2
-rw-r--r--etc/tftp.lua2
-rw-r--r--src/ftp.lua2
-rw-r--r--src/http.lua4
-rw-r--r--src/inet.c24
-rw-r--r--src/ltn12.lua2
-rw-r--r--src/luasocket.c4
-rw-r--r--src/mime.lua3
-rw-r--r--src/smtp.lua4
-rw-r--r--src/socket.lua3
-rw-r--r--src/tp.lua2
-rw-r--r--src/url.lua2
-rw-r--r--test/testclnt.lua2
19 files changed, 91 insertions, 91 deletions
diff --git a/FIX b/FIX
index a811ec0..0ec76a1 100644
--- a/FIX
+++ b/FIX
@@ -1,13 +1,16 @@
1url.absolute was not working when base_url was already parsed 1url.absolute was not working when base_url was already parsed
2http.request was redirecting even when the location header is empty 2http.request was redirecting even when the location header was empty
3tcp{client}:shutdown() was checking for group instead of class. 3tcp{client}:shutdown() was checking for group instead of class.
4tcp{client}:send() now returns i+sent-1... 4tcp{client}:send() now returns i+sent-1...
5get rid of a = socket.try() in the manual, except for protected cases. 5get rid of a = socket.try() in the manual, except for protected cases. replace it with assert.
6 replace it with assert. 6get rid of "base." kludge in package.loaded
7get rid of "base." kludge
8check all "require("http")" etc in the manual. 7check all "require("http")" etc in the manual.
9make sure sock_gethostname.* only return success if the hp is not null! 8make sure sock_gethostname.* only return success if the hp is not null!
10change 'l' prefix in C libraries to 'c' 9change 'l' prefix in C libraries to 'c' to avoid clash with LHF libraries
11 don't forget the declarations in luasocket.h and mime.h!!! 10 don't forget the declarations in luasocket.h and mime.h!!!
12setpeername was using udp{unconnected} 11setpeername was using udp{unconnected}
13fixed a bug in http.lua that caused some requests to fail 12fixed a bug in http.lua that caused some requests to fail (Florian Berger)
13fixed a bug in select.c that prevented sockets with descriptor 0 from working (Renato Maia)
14fixed a "bug" that caused dns.toip to crash under uLinux
15fixed a "bug" that caused a crash in gethostbyname under VMS
16DEBUG and VERSION became _DEBUG and _VERSION
diff --git a/TODO b/TODO
index 460165f..8749ea8 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
1
2talk about the non-blocking connect in the manual 1talk about the non-blocking connect in the manual
3test it on Windows!!! 2test it on Windows!!!
4 3
@@ -13,7 +12,6 @@ functions for non-blocking so they can be used in the context of the
13dispatcher! 12dispatcher!
14 13
15adjust manual for new sock:send returns. 14adjust manual for new sock:send returns.
16_VERSION, _DEBUG, etc.
17 15
18leave code for losers that don't have nanosleep 16leave code for losers that don't have nanosleep
19 17
@@ -42,3 +40,4 @@ testar os options!
42eliminate globals from namespaces created by module(). 40eliminate globals from namespaces created by module().
43 41
44* BUG NO SET DO TINYIRC!!! SINISTRO. 42* BUG NO SET DO TINYIRC!!! SINISTRO.
43* _VERSION, _DEBUG, etc.
diff --git a/doc/index.html b/doc/index.html
index cfd3548..ee97e02 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -93,38 +93,24 @@ Windows&nbsp;XP, Linux, and Mac OS X.
93</p> 93</p>
94 94
95<p> 95<p>
96The library can be downloaded in source code from the following links: 96The library can be downloaded in source code from the
97</p> 97<a href=http://luaforge.net/projects/luasocket/>LuaSocket
98 98project page</a> at LuaForge.
99<blockquote>
100<p>
101<a href="luasocket-2.0.tar.gz">luasocket-2.0.tar.gz</a> <br>
102<a href="luasocket-2.0.zip">luasocket-2.0.zip</a>
103</p>
104</blockquote>
105
106<p>
107Besides the full C and Lua source code for the library, the distribution 99Besides the full C and Lua source code for the library, the distribution
108contains several examples, this user's manual and basic test procedures. 100contains several examples, this user's manual and basic test procedures.
109</p> 101</p>
110 102
111<p> 103<p>
112I am also providing PC Win32 binaries for those that want to give 104Danilo Tuler is mantaining Win32 binaries for LuaSocket, which are also
113LuaSocket a try (those on Unix or Mac OS X can just type <tt>make</tt>). 105available from LuaForge. These are compatible with the
114These are compatible with the
115<a href=http://luaforge.net/projects/luabinaries>LuaBinaries</a> 106<a href=http://luaforge.net/projects/luabinaries>LuaBinaries</a>
116available from LuaForge. 107available from LuaForge.
117</p> 108</p>
118 109
119<blockquote>
120<p> 110<p>
121<a href="luasocket-2.0-win32.zip">luasocket-2.0-win32.zip</a> 111For those that want to give LuaSocket a quick try, download the
122</p> 112stand-alone archive and unpack everything into
123</blockquote> 113a directory, say <tt>c:\luasocket</tt>. Then set <tt>LUA_INIT</tt> to load
124
125<p>
126The quick and dirty way to use these binaries is to unpack everything into
127a directory, say <tt>c:\luasocket</tt>, then set <tt>LUA_INIT</tt> to load
128the <tt>compat-5.1.lua</tt> and set <tt>LUA_PATH</tt> and 114the <tt>compat-5.1.lua</tt> and set <tt>LUA_PATH</tt> and
129<tt>LUA_CPATH</tt> to look for files in the current directory: 115<tt>LUA_CPATH</tt> to look for files in the current directory:
130</p> 116</p>
@@ -142,10 +128,10 @@ do the following:
142</p> 128</p>
143 129
144<pre class=example> 130<pre class=example>
145c:\luasocket\&gt; lua 131c:\luasocket\&gt; lua50
146Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio 132Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
147&gt; http = require"socket.http" 133&gt; http = require"socket.http"
148&gt; print(http.request"http://www.tecgraf.puc-rio.br/luasocket/") 134&gt; print(http.request"http://www.cs.princeton.edu/~diego/professional/luasocket/")
149--&gt; the source to this web page gets dumped to terminal 135--&gt; the source to this web page gets dumped to terminal
150</pre> 136</pre>
151 137
@@ -173,31 +159,39 @@ has been helping a lot too! Thanks to you all!
173<h2 id=new>What's New</h2> 159<h2 id=new>What's New</h2>
174 160
175<p> 161<p>
176The big change for the 2.0 (beta3) release was the adoption of the Lua 5.1 162There is no big change for the 2.0 (final) release. It is basically a
177package proposal. Naturally, there were a few bug fixes (a beta is a 163bug fix release. The only improvement is in the non-blocking
178beta, is a beta). 164support.
179</p> 165</p>
180 166
181<ul> 167<ul>
182<li> New compat-5.1 distribution: 168<li> Improved: <tt>tcp{client}:send(data, i)</tt> now returns <tt>(i+sent-1)</tt>. This is great for non-blocking I/O, but might break some code;
183<ul> 169<li> Improved: HTTP, SMTP, and FTP functions accept a new field
184<li> Installation uses new directory structure; 170<tt>connect</tt> that can be used to replace the function invoked to
185<li> Namespace hierarchy is in now back in use (ex. <tt>socket.url</tt> 171create and connect the sockets used internally;
186 instead of <tt>url</tt>); 172<li> Fixed: <tt>url.absolute()</tt> was not working when <tt>base_url</tt> was
187<li> All modules call <tt>require</tt> even for standard libraries; 173already parsed;
188</ul> 174<li> Fixed: <tt>http.request()</tt> was redirecting even when the location
189<li> <tt>socket.select</tt> wasn't calling <tt>tm_markstart</tt>; 175header was empty (well, it shouldn't be empty);
190<li> LTN12 avoids coroutines (so you can go wild on the C side); 176<li> Fixed: <tt>tcp{client}:shutdown()</tt> was checking for group instead of class;
191<li> Kludge on wsocket.c:sock_send for windows timeout issue 177<li> Fixed: <tt>socket.try()</tt> can't be used in place of <tt>assert()</tt>. The manual and examples don't do it anymore;
192 moved to buffer.c:sendraw so it's not a kludge anymore; 178<li> Improved: Get rid of <tt>require("base")</tt> kludge in <tt>package.loaded</tt>;
193<li> <tt>socket.protect </tt>only catches errors thrown by <tt>socket.try</tt>; 179<li> Fixedd: Parts of the manual referred to <tt>require("http")</tt> instead of
194<li> Fixed <tt>udp:sendto</tt> to call <tt>sock_sendto</tt> instead of 180<tt>require("socket.http")</tt>;
195 <tt>sock_send</tt>; 181<li> Improved: Changed 'l' prefix in C libraries to 'c' to avoid clash with LHF
196<li> <tt>close</tt> wasn't returning 1! 182libraries;
197<li> <tt>socket.gettime</tt> returns time since Unix Epoch 1/1/1970 (UTC); 183<li> Improved: Using bundles in Mac OS X;
198<li> <tt>socket.sleep</tt> is robust to interrupts; 184<li> Fixed: <tt>luasocket.h</tt> was exporting <tt>luaopen_socket</tt>
199<li> <tt>http.PROXY</tt> wasn't working; 185instead of <tt>luaopen_csocket</tt>;
200<li> <tt>url.escape</tt> escapes only dangerous characters. 186<li> Fixed: <tt>udp:setpeername()</tt> only worked for
187<tt>udp{unconnected}</tt>. Now you can "disconnect" an <tt>UDP</tt> socket;
188<li> Fixed: bug in http.lua that caused some requests to fail (Florian
189Berger);
190<li> Fixed: bug in <tt>select.c</tt> that prevented sockets with descriptor 0 from working (Renato Maia);
191<li> Fixed: "bug" that caused <tt>dns.toip</tt> to crash under uLinux;
192<li> Fixed: "bug" that caused a crash in <tt>gethostbyname</tt> under VMS
193(Renato Maia);
194<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.
201</ul> 195</ul>
202 196
203<!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 197<!-- incompatible +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -205,9 +199,11 @@ beta, is a beta).
205<h3 id=incompatible>Incompatibilities with previous versions</h3> 199<h3 id=incompatible>Incompatibilities with previous versions</h3>
206 200
207<ul> 201<ul>
208<li> Namespaces are hierarchical again. This means that whoever used to 202<li> If you use the return value of <tt>tcp:send()</tt> <em>and</em> you
209call <tt>require("url")</tt> should update their code to 203use the extra parameters to select only part of the string to be sent, your
210<tt>require("socket.url")</tt>. 204code is now broken, but when you fix it, it will be much simpler;
205<li> If you check <tt>socket.DEBUG</tt> or <tt>socket.VERSION</tt>,
206change it to <tt>socket._DEBUG</tt> or <tt>socket._VERSION</tt>.
211</ul> 207</ul>
212 208
213<!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 209<!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
diff --git a/doc/reference.html b/doc/reference.html
index b2e31d5..fd5140b 100644
--- a/doc/reference.html
+++ b/doc/reference.html
@@ -142,7 +142,7 @@ Support, Manual">
142<blockquote> 142<blockquote>
143<a href="socket.html">Socket</a> 143<a href="socket.html">Socket</a>
144<blockquote> 144<blockquote>
145<a href="socket.html#debug">DEBUG</a>, 145<a href="socket.html#_debug">_DEBUG</a>,
146<a href="dns.html#dns">dns</a>, 146<a href="dns.html#dns">dns</a>,
147<a href="socket.html#gettime">gettime</a>, 147<a href="socket.html#gettime">gettime</a>,
148<a href="socket.html#newtry">newtry</a>, 148<a href="socket.html#newtry">newtry</a>,
@@ -155,7 +155,7 @@ Support, Manual">
155<a href="tcp.html#tcp">tcp</a>, 155<a href="tcp.html#tcp">tcp</a>,
156<a href="socket.html#try">try</a>, 156<a href="socket.html#try">try</a>,
157<a href="udp.html#udp">udp</a>, 157<a href="udp.html#udp">udp</a>,
158<a href="socket.html#version">VERSION</a>. 158<a href="socket.html#_version">_VERSION</a>.
159</blockquote> 159</blockquote>
160</blockquote> 160</blockquote>
161 161
diff --git a/doc/socket.html b/doc/socket.html
index 18c71d1..5cc7157 100644
--- a/doc/socket.html
+++ b/doc/socket.html
@@ -85,8 +85,8 @@ the user can also specify the local address and port to bind
85 85
86<!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 86<!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
87 87
88<p class=name id=debug> 88<p class=name id=_debug>
89socket.<b>DEBUG</b> 89socket.<b>_DEBUG</b>
90</p> 90</p>
91 91
92<p class=description> 92<p class=description>
@@ -372,8 +372,8 @@ c = socket.try(socket.connect("localhost", 80))
372 372
373<!-- version ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> 373<!-- version ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
374 374
375<p class=name id=version> 375<p class=name id=_version>
376socket.<b>VERSION</b> 376socket.<b>_VERSION</b>
377</p> 377</p>
378 378
379<p class=description> 379<p class=description>
diff --git a/etc/dict.lua b/etc/dict.lua
index a52b977..76b254a 100644
--- a/etc/dict.lua
+++ b/etc/dict.lua
@@ -8,7 +8,7 @@
8----------------------------------------------------------------------------- 8-----------------------------------------------------------------------------
9-- Load required modules 9-- Load required modules
10----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
11local base = require("base") 11local base = _G
12local string = require("string") 12local string = require("string")
13local table = require("table") 13local table = require("table")
14local socket = require("socket") 14local socket = require("socket")
diff --git a/etc/lp.lua b/etc/lp.lua
index 7637d16..2ba7954 100644
--- a/etc/lp.lua
+++ b/etc/lp.lua
@@ -10,7 +10,7 @@
10]] 10]]
11-- make sure LuaSocket is loaded 11-- make sure LuaSocket is loaded
12local io = require("io") 12local io = require("io")
13local base = require("base") 13local base = _G
14local string = require("string") 14local string = require("string")
15local socket = require("socket") 15local socket = require("socket")
16local ltn12 = require("ltn12") 16local ltn12 = require("ltn12")
diff --git a/etc/tftp.lua b/etc/tftp.lua
index ba21a43..60658f7 100644
--- a/etc/tftp.lua
+++ b/etc/tftp.lua
@@ -8,7 +8,7 @@
8----------------------------------------------------------------------------- 8-----------------------------------------------------------------------------
9-- Load required files 9-- Load required files
10----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
11local base = require("base") 11local base = _G
12local table = require("table") 12local table = require("table")
13local math = require("math") 13local math = require("math")
14local string = require("string") 14local string = require("string")
diff --git a/src/ftp.lua b/src/ftp.lua
index a793298..841df5f 100644
--- a/src/ftp.lua
+++ b/src/ftp.lua
@@ -8,7 +8,7 @@
8----------------------------------------------------------------------------- 8-----------------------------------------------------------------------------
9-- Declare module and import dependencies 9-- Declare module and import dependencies
10----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
11local base = require("base") 11local base = _G
12local table = require("table") 12local table = require("table")
13local string = require("string") 13local string = require("string")
14local math = require("math") 14local math = require("math")
diff --git a/src/http.lua b/src/http.lua
index 669f54d..1a7b101 100644
--- a/src/http.lua
+++ b/src/http.lua
@@ -13,7 +13,7 @@ local url = require("socket.url")
13local ltn12 = require("ltn12") 13local ltn12 = require("ltn12")
14local mime = require("mime") 14local mime = require("mime")
15local string = require("string") 15local string = require("string")
16local base = require("base") 16local base = _G
17local table = require("table") 17local table = require("table")
18module("socket.http") 18module("socket.http")
19 19
@@ -25,7 +25,7 @@ TIMEOUT = 60
25-- default port for document retrieval 25-- default port for document retrieval
26PORT = 80 26PORT = 80
27-- user agent field sent in request 27-- user agent field sent in request
28USERAGENT = socket.VERSION 28USERAGENT = socket._VERSION
29 29
30----------------------------------------------------------------------------- 30-----------------------------------------------------------------------------
31-- Extra sources and sinks 31-- Extra sources and sinks
diff --git a/src/inet.c b/src/inet.c
index d713643..d102060 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -172,21 +172,25 @@ static void inet_pushresolved(lua_State *L, struct hostent *hp)
172 i = 1; 172 i = 1;
173 alias = hp->h_aliases; 173 alias = hp->h_aliases;
174 lua_newtable(L); 174 lua_newtable(L);
175 while (*alias) { 175 if (alias) {
176 lua_pushnumber(L, i); 176 while (*alias) {
177 lua_pushstring(L, *alias); 177 lua_pushnumber(L, i);
178 lua_settable(L, -3); 178 lua_pushstring(L, *alias);
179 i++; alias++; 179 lua_settable(L, -3);
180 i++; alias++;
181 }
180 } 182 }
181 lua_settable(L, resolved); 183 lua_settable(L, resolved);
182 i = 1; 184 i = 1;
183 lua_newtable(L); 185 lua_newtable(L);
184 addr = (struct in_addr **) hp->h_addr_list; 186 addr = (struct in_addr **) hp->h_addr_list;
185 while (*addr) { 187 if (addr) {
186 lua_pushnumber(L, i); 188 while (*addr) {
187 lua_pushstring(L, inet_ntoa(**addr)); 189 lua_pushnumber(L, i);
188 lua_settable(L, -3); 190 lua_pushstring(L, inet_ntoa(**addr));
189 i++; addr++; 191 lua_settable(L, -3);
192 i++; addr++;
193 }
190 } 194 }
191 lua_settable(L, resolved); 195 lua_settable(L, resolved);
192} 196}
diff --git a/src/ltn12.lua b/src/ltn12.lua
index 1acb9b1..fbc9dce 100644
--- a/src/ltn12.lua
+++ b/src/ltn12.lua
@@ -10,7 +10,7 @@
10----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
11local string = require("string") 11local string = require("string")
12local table = require("table") 12local table = require("table")
13local base = require("base") 13local base = _G
14module("ltn12") 14module("ltn12")
15 15
16filter = {} 16filter = {}
diff --git a/src/luasocket.c b/src/luasocket.c
index 8f13dbc..2c3b526 100644
--- a/src/luasocket.c
+++ b/src/luasocket.c
@@ -89,12 +89,12 @@ static int base_open(lua_State *L) {
89 /* export functions (and leave namespace table on top of stack) */ 89 /* export functions (and leave namespace table on top of stack) */
90 luaL_openlib(L, "socket", func, 0); 90 luaL_openlib(L, "socket", func, 0);
91#ifdef LUASOCKET_DEBUG 91#ifdef LUASOCKET_DEBUG
92 lua_pushstring(L, "DEBUG"); 92 lua_pushstring(L, "_DEBUG");
93 lua_pushboolean(L, 1); 93 lua_pushboolean(L, 1);
94 lua_rawset(L, -3); 94 lua_rawset(L, -3);
95#endif 95#endif
96 /* make version string available to scripts */ 96 /* make version string available to scripts */
97 lua_pushstring(L, "VERSION"); 97 lua_pushstring(L, "_VERSION");
98 lua_pushstring(L, LUASOCKET_VERSION); 98 lua_pushstring(L, LUASOCKET_VERSION);
99 lua_rawset(L, -3); 99 lua_rawset(L, -3);
100 return 1; 100 return 1;
diff --git a/src/mime.lua b/src/mime.lua
index 6ef82b8..f6509a0 100644
--- a/src/mime.lua
+++ b/src/mime.lua
@@ -8,8 +8,7 @@
8----------------------------------------------------------------------------- 8-----------------------------------------------------------------------------
9-- Declare module and import dependencies 9-- Declare module and import dependencies
10----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
11package.loaded.base = _G 11local base = _G
12local base = require("base")
13local ltn12 = require("ltn12") 12local ltn12 = require("ltn12")
14local mime = require("cmime") 13local mime = require("cmime")
15module("mime") 14module("mime")
diff --git a/src/smtp.lua b/src/smtp.lua
index 944a40f..6850f7f 100644
--- a/src/smtp.lua
+++ b/src/smtp.lua
@@ -8,7 +8,7 @@
8----------------------------------------------------------------------------- 8-----------------------------------------------------------------------------
9-- Declare module and import dependencies 9-- Declare module and import dependencies
10----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
11local base = require("base") 11local base = _G
12local coroutine = require("coroutine") 12local coroutine = require("coroutine")
13local string = require("string") 13local string = require("string")
14local math = require("math") 14local math = require("math")
@@ -216,7 +216,7 @@ local function adjust_headers(mesgt)
216 end 216 end
217 lower["date"] = lower["date"] or 217 lower["date"] = lower["date"] or
218 os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or ZONE) 218 os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or ZONE)
219 lower["x-mailer"] = lower["x-mailer"] or socket.VERSION 219 lower["x-mailer"] = lower["x-mailer"] or socket._VERSION
220 -- this can't be overriden 220 -- this can't be overriden
221 lower["mime-version"] = "1.0" 221 lower["mime-version"] = "1.0"
222 mesgt.headers = lower 222 mesgt.headers = lower
diff --git a/src/socket.lua b/src/socket.lua
index 9a523fe..d1c7846 100644
--- a/src/socket.lua
+++ b/src/socket.lua
@@ -7,8 +7,7 @@
7----------------------------------------------------------------------------- 7-----------------------------------------------------------------------------
8-- Declare module and import dependencies 8-- Declare module and import dependencies
9----------------------------------------------------------------------------- 9-----------------------------------------------------------------------------
10package.loaded.base = _G 10local base = _G
11local base = require("base")
12local string = require("string") 11local string = require("string")
13local math = require("math") 12local math = require("math")
14local socket = require("csocket") 13local socket = require("csocket")
diff --git a/src/tp.lua b/src/tp.lua
index 1adc656..c51d123 100644
--- a/src/tp.lua
+++ b/src/tp.lua
@@ -8,7 +8,7 @@
8----------------------------------------------------------------------------- 8-----------------------------------------------------------------------------
9-- Declare module and import dependencies 9-- Declare module and import dependencies
10----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
11local base = require("base") 11local base = _G
12local string = require("string") 12local string = require("string")
13local socket = require("socket") 13local socket = require("socket")
14local ltn12 = require("ltn12") 14local ltn12 = require("ltn12")
diff --git a/src/url.lua b/src/url.lua
index f29ecc8..0db111b 100644
--- a/src/url.lua
+++ b/src/url.lua
@@ -9,7 +9,7 @@
9-- Declare module 9-- Declare module
10----------------------------------------------------------------------------- 10-----------------------------------------------------------------------------
11local string = require("string") 11local string = require("string")
12local base = require("base") 12local base = _G
13local table = require("table") 13local table = require("table")
14module("socket.url") 14module("socket.url")
15 15
diff --git a/test/testclnt.lua b/test/testclnt.lua
index e3f2b94..83f925b 100644
--- a/test/testclnt.lua
+++ b/test/testclnt.lua
@@ -69,7 +69,7 @@ function check_timeout(tm, sl, elapsed, err, opp, mode, alldone)
69 end 69 end
70end 70end
71 71
72if not socket.DEBUG then 72if not socket._DEBUG then
73 fail("Please define LUASOCKET_DEBUG and recompile LuaSocket") 73 fail("Please define LUASOCKET_DEBUG and recompile LuaSocket")
74end 74end
75 75