diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-02 22:44:00 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-02 22:44:00 +0000 |
| commit | 97b26e0b66c840a446a0179200c7df23565330d1 (patch) | |
| tree | 272f9ea0451f13b563451fb8df21a03669e90d09 | |
| parent | a8254e94f8c14ac15b02be53a1cc69ba80899230 (diff) | |
| download | luasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.gz luasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.bz2 luasocket-97b26e0b66c840a446a0179200c7df23565330d1.zip | |
Almost ready to release beta3
| -rw-r--r-- | etc/README | 5 | ||||
| -rw-r--r-- | etc/dict.lua | 2 | ||||
| -rw-r--r-- | etc/lp.lua | 2 | ||||
| -rw-r--r-- | etc/tftp.lua | 2 | ||||
| -rw-r--r-- | luasocket.vcproj | 6 | ||||
| -rw-r--r-- | makefile.dist | 10 | ||||
| -rw-r--r-- | mime.vcproj | 6 | ||||
| -rw-r--r-- | samples/README | 2 | ||||
| -rw-r--r-- | samples/echoclnt.lua | 10 | ||||
| -rw-r--r-- | samples/echosrvr.lua | 9 | ||||
| -rw-r--r-- | samples/listener.lua | 7 | ||||
| -rw-r--r-- | samples/talker.lua | 4 | ||||
| -rw-r--r-- | samples/tinyirc.lua | 4 | ||||
| -rw-r--r-- | src/ftp.lua | 2 | ||||
| -rw-r--r-- | src/http.lua | 2 | ||||
| -rw-r--r-- | src/ltn12.lua | 22 | ||||
| -rw-r--r-- | src/luasocket.h | 4 | ||||
| -rw-r--r-- | src/mime.lua | 2 | ||||
| -rw-r--r-- | src/smtp.lua | 2 | ||||
| -rw-r--r-- | src/socket.lua | 2 | ||||
| -rw-r--r-- | src/tp.lua | 2 | ||||
| -rw-r--r-- | src/url.lua | 2 | ||||
| -rw-r--r-- | test/httptest.lua | 3 |
23 files changed, 53 insertions, 59 deletions
| @@ -1,11 +1,6 @@ | |||
| 1 | This directory contains code that is more useful than the examples. This code | 1 | This directory contains code that is more useful than the examples. This code |
| 2 | *is* supported. | 2 | *is* supported. |
| 3 | 3 | ||
| 4 | lua.lua -- new require and requirelib implementations | ||
| 5 | |||
| 6 | This is to support dynamic loading of LuaSocket. Check the INSTALL | ||
| 7 | file for more information. | ||
| 8 | |||
| 9 | tftp.lua -- Trivial FTP client | 4 | tftp.lua -- Trivial FTP client |
| 10 | 5 | ||
| 11 | This module implements file retrieval by the TFTP protocol. Its main use | 6 | This module implements file retrieval by the TFTP protocol. Its main use |
diff --git a/etc/dict.lua b/etc/dict.lua index 6c40a32..a52b977 100644 --- a/etc/dict.lua +++ b/etc/dict.lua | |||
| @@ -151,4 +151,4 @@ get = socket.protect(function(gett) | |||
| 151 | else return tget(gett) end | 151 | else return tget(gett) end |
| 152 | end) | 152 | end) |
| 153 | 153 | ||
| 154 | getmetatable(_M).__index = nil | 154 | --getmetatable(_M).__index = nil |
| @@ -318,4 +318,4 @@ query = socket.protect(function(p) | |||
| 318 | return data | 318 | return data |
| 319 | end) | 319 | end) |
| 320 | 320 | ||
| 321 | getmetatable(_M).__index = nil | 321 | --getmetatable(_M).__index = nil |
diff --git a/etc/tftp.lua b/etc/tftp.lua index 91b26c9..ba21a43 100644 --- a/etc/tftp.lua +++ b/etc/tftp.lua | |||
| @@ -153,4 +153,4 @@ get = socket.protect(function(gett) | |||
| 153 | else return tget(gett) end | 153 | else return tget(gett) end |
| 154 | end) | 154 | end) |
| 155 | 155 | ||
| 156 | getmetatable(_M).__index = nil | 156 | --getmetatable(_M).__index = nil |
diff --git a/luasocket.vcproj b/luasocket.vcproj index 4699498..14cbebf 100644 --- a/luasocket.vcproj +++ b/luasocket.vcproj | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | <Tool | 19 | <Tool |
| 20 | Name="VCCLCompilerTool" | 20 | Name="VCCLCompilerTool" |
| 21 | Optimization="0" | 21 | Optimization="0" |
| 22 | AdditionalIncludeDirectories="h:\include" | 22 | AdditionalIncludeDirectories="..\..\include, compat-5.1r2" |
| 23 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LUASOCKET_EXPORTS;LUASOCKET_API=__declspec(dllexport)" | 23 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LUASOCKET_EXPORTS;LUASOCKET_API=__declspec(dllexport)" |
| 24 | MinimalRebuild="TRUE" | 24 | MinimalRebuild="TRUE" |
| 25 | BasicRuntimeChecks="3" | 25 | BasicRuntimeChecks="3" |
| @@ -69,7 +69,7 @@ | |||
| 69 | CharacterSet="2"> | 69 | CharacterSet="2"> |
| 70 | <Tool | 70 | <Tool |
| 71 | Name="VCCLCompilerTool" | 71 | Name="VCCLCompilerTool" |
| 72 | AdditionalIncludeDirectories="../../include" | 72 | AdditionalIncludeDirectories="../../include, compat-5.1r2" |
| 73 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LUASOCKET_EXPORTS;LUASOCKET_API=__declspec(dllexport); LUASOCKET_DEBUG" | 73 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LUASOCKET_EXPORTS;LUASOCKET_API=__declspec(dllexport); LUASOCKET_DEBUG" |
| 74 | RuntimeLibrary="4" | 74 | RuntimeLibrary="4" |
| 75 | UsePrecompiledHeader="0" | 75 | UsePrecompiledHeader="0" |
| @@ -125,7 +125,7 @@ | |||
| 125 | RelativePath=".\buffer.c"> | 125 | RelativePath=".\buffer.c"> |
| 126 | </File> | 126 | </File> |
| 127 | <File | 127 | <File |
| 128 | RelativePath=".\compat-5.1.c"> | 128 | RelativePath=".\compat-5.1r2\compat-5.1.c"> |
| 129 | </File> | 129 | </File> |
| 130 | <File | 130 | <File |
| 131 | RelativePath=".\except.c"> | 131 | RelativePath=".\except.c"> |
diff --git a/makefile.dist b/makefile.dist index a31a9a5..b1ac1fa 100644 --- a/makefile.dist +++ b/makefile.dist | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | DIST = luasocket-2.0-beta3 | 5 | DIST = luasocket-2.0-beta3 |
| 6 | 6 | ||
| 7 | COMPAT = compat-5.1r2 | ||
| 8 | |||
| 7 | LUA = \ | 9 | LUA = \ |
| 8 | ftp.lua \ | 10 | ftp.lua \ |
| 9 | http.lua \ | 11 | http.lua \ |
| @@ -11,7 +13,6 @@ LUA = \ | |||
| 11 | mime.lua \ | 13 | mime.lua \ |
| 12 | smtp.lua \ | 14 | smtp.lua \ |
| 13 | socket.lua \ | 15 | socket.lua \ |
| 14 | compat-5.1.lua \ | ||
| 15 | tp.lua \ | 16 | tp.lua \ |
| 16 | url.lua | 17 | url.lua |
| 17 | 18 | ||
| @@ -72,9 +73,7 @@ CORE = \ | |||
| 72 | usocket.c \ | 73 | usocket.c \ |
| 73 | usocket.h \ | 74 | usocket.h \ |
| 74 | wsocket.c \ | 75 | wsocket.c \ |
| 75 | wsocket.h \ | 76 | wsocket.h |
| 76 | compat-5.1.c \ | ||
| 77 | compat-5.1.h | ||
| 78 | 77 | ||
| 79 | MAKE = \ | 78 | MAKE = \ |
| 80 | makefile.Darwin \ | 79 | makefile.Darwin \ |
| @@ -92,7 +91,7 @@ MANUAL = \ | |||
| 92 | manual/ltn12.html \ | 91 | manual/ltn12.html \ |
| 93 | manual/luasocket.png \ | 92 | manual/luasocket.png \ |
| 94 | manual/mime.html \ | 93 | manual/mime.html \ |
| 95 | manual/instalation.html \ | 94 | manual/installation.html \ |
| 96 | manual/reference.css \ | 95 | manual/reference.css \ |
| 97 | manual/reference.html \ | 96 | manual/reference.html \ |
| 98 | manual/smtp.html \ | 97 | manual/smtp.html \ |
| @@ -107,6 +106,7 @@ dist: | |||
| 107 | mkdir -p $(DIST)/etc | 106 | mkdir -p $(DIST)/etc |
| 108 | mkdir -p $(DIST)/lua | 107 | mkdir -p $(DIST)/lua |
| 109 | mkdir -p $(DIST)/manual | 108 | mkdir -p $(DIST)/manual |
| 109 | cp -vfr $(COMPAT) $(DIST) | ||
| 110 | cp -vf TODO $(DIST) | 110 | cp -vf TODO $(DIST) |
| 111 | cp -vf $(CORE) $(DIST) | 111 | cp -vf $(CORE) $(DIST) |
| 112 | cp -vf README $(DIST) | 112 | cp -vf README $(DIST) |
diff --git a/mime.vcproj b/mime.vcproj index 9fe7aa8..9e73f7b 100644 --- a/mime.vcproj +++ b/mime.vcproj | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | <Tool | 19 | <Tool |
| 20 | Name="VCCLCompilerTool" | 20 | Name="VCCLCompilerTool" |
| 21 | Optimization="0" | 21 | Optimization="0" |
| 22 | AdditionalIncludeDirectories="h:\include" | 22 | AdditionalIncludeDirectories="..\..\include, compat-5.1r2" |
| 23 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MIME_EXPORTS;MIME_API=__declspec(dllexport)" | 23 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MIME_EXPORTS;MIME_API=__declspec(dllexport)" |
| 24 | MinimalRebuild="TRUE" | 24 | MinimalRebuild="TRUE" |
| 25 | BasicRuntimeChecks="3" | 25 | BasicRuntimeChecks="3" |
| @@ -68,7 +68,7 @@ | |||
| 68 | CharacterSet="2"> | 68 | CharacterSet="2"> |
| 69 | <Tool | 69 | <Tool |
| 70 | Name="VCCLCompilerTool" | 70 | Name="VCCLCompilerTool" |
| 71 | AdditionalIncludeDirectories="../../include" | 71 | AdditionalIncludeDirectories="../../include, compat-5.1r2" |
| 72 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MIME_EXPORTS; MIME_API=__declspec(dllexport)" | 72 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MIME_EXPORTS; MIME_API=__declspec(dllexport)" |
| 73 | RuntimeLibrary="4" | 73 | RuntimeLibrary="4" |
| 74 | UsePrecompiledHeader="0" | 74 | UsePrecompiledHeader="0" |
| @@ -117,7 +117,7 @@ | |||
| 117 | Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" | 117 | Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" |
| 118 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> | 118 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> |
| 119 | <File | 119 | <File |
| 120 | RelativePath=".\compat-5.1.c"> | 120 | RelativePath=".\compat-5.1r2\compat-5.1.c"> |
| 121 | </File> | 121 | </File> |
| 122 | <File | 122 | <File |
| 123 | RelativePath=".\mime.c"> | 123 | RelativePath=".\mime.c"> |
diff --git a/samples/README b/samples/README index 3ce4067..0100a4a 100644 --- a/samples/README +++ b/samples/README | |||
| @@ -7,7 +7,7 @@ is not supported. | |||
| 7 | listener.lua and talker.lua are about the simplest applications you can | 7 | listener.lua and talker.lua are about the simplest applications you can |
| 8 | write using LuaSocket. Run | 8 | write using LuaSocket. Run |
| 9 | 9 | ||
| 10 | 'lua listen.lua' and 'lua talk.lua' | 10 | 'lua listener.lua' and 'lua talker.lua' |
| 11 | 11 | ||
| 12 | on different terminals. Whatever you type on talk.lua will be | 12 | on different terminals. Whatever you type on talk.lua will be |
| 13 | printed by listen.lua. | 13 | printed by listen.lua. |
diff --git a/samples/echoclnt.lua b/samples/echoclnt.lua index 038061d..764e433 100644 --- a/samples/echoclnt.lua +++ b/samples/echoclnt.lua | |||
| @@ -12,13 +12,13 @@ if arg then | |||
| 12 | port = arg[2] or port | 12 | port = arg[2] or port |
| 13 | end | 13 | end |
| 14 | host = socket.dns.toip(host) | 14 | host = socket.dns.toip(host) |
| 15 | udp = socket.try(socket.udp()) | 15 | udp = assert(socket.udp()) |
| 16 | socket.try(udp:setpeername(host, port)) | 16 | assert(udp:setpeername(host, port)) |
| 17 | print("Using remote host '" ..host.. "' and port " .. port .. "...") | 17 | print("Using remote host '" ..host.. "' and port " .. port .. "...") |
| 18 | while 1 do | 18 | while 1 do |
| 19 | line = io.read() | 19 | line = io.read() |
| 20 | if not line then os.exit() end | 20 | if not line or line == "" then os.exit() end |
| 21 | socket.try(udp:send(line)) | 21 | assert(udp:send(line)) |
| 22 | dgram = socket.try(udp:receive()) | 22 | dgram = assert(udp:receive()) |
| 23 | print(dgram) | 23 | print(dgram) |
| 24 | end | 24 | end |
diff --git a/samples/echosrvr.lua b/samples/echosrvr.lua index 3ebbe85..d4449e5 100644 --- a/samples/echosrvr.lua +++ b/samples/echosrvr.lua | |||
| @@ -12,10 +12,11 @@ if arg then | |||
| 12 | port = arg[2] or port | 12 | port = arg[2] or port |
| 13 | end | 13 | end |
| 14 | print("Binding to host '" ..host.. "' and port " ..port.. "...") | 14 | print("Binding to host '" ..host.. "' and port " ..port.. "...") |
| 15 | udp = socket.try(socket.udp()) | 15 | udp = assert(socket.udp()) |
| 16 | socket.try(udp:setsockname(host, port)) | 16 | assert(udp:setsockname(host, port)) |
| 17 | socket.try(udp:settimeout(5)) | 17 | assert(udp:settimeout(5)) |
| 18 | ip, port = socket.try(udp:getsockname()) | 18 | ip, port = udp:getsockname() |
| 19 | assert(ip, port) | ||
| 19 | print("Waiting packets on " .. ip .. ":" .. port .. "...") | 20 | print("Waiting packets on " .. ip .. ":" .. port .. "...") |
| 20 | while 1 do | 21 | while 1 do |
| 21 | dgram, ip, port = udp:receivefrom() | 22 | dgram, ip, port = udp:receivefrom() |
diff --git a/samples/listener.lua b/samples/listener.lua index 65c6501..4d4c3b6 100644 --- a/samples/listener.lua +++ b/samples/listener.lua | |||
| @@ -12,10 +12,11 @@ if arg then | |||
| 12 | port = arg[2] or port | 12 | port = arg[2] or port |
| 13 | end | 13 | end |
| 14 | print("Binding to host '" ..host.. "' and port " ..port.. "...") | 14 | print("Binding to host '" ..host.. "' and port " ..port.. "...") |
| 15 | s = socket.try(socket.bind(host, port)) | 15 | s = assert(socket.bind(host, port)) |
| 16 | i, p = socket.try(s:getsockname()) | 16 | i, p = s:getsockname() |
| 17 | assert(i, p) | ||
| 17 | print("Waiting connection from talker on " .. i .. ":" .. p .. "...") | 18 | print("Waiting connection from talker on " .. i .. ":" .. p .. "...") |
| 18 | c = socket.try(s:accept()) | 19 | c = assert(s:accept()) |
| 19 | print("Connected. Here is the stuff:") | 20 | print("Connected. Here is the stuff:") |
| 20 | l, e = c:receive() | 21 | l, e = c:receive() |
| 21 | while not e do | 22 | while not e do |
diff --git a/samples/talker.lua b/samples/talker.lua index 3f6e69c..901ed2c 100644 --- a/samples/talker.lua +++ b/samples/talker.lua | |||
| @@ -12,10 +12,10 @@ if arg then | |||
| 12 | port = arg[2] or port | 12 | port = arg[2] or port |
| 13 | end | 13 | end |
| 14 | print("Attempting connection to host '" ..host.. "' and port " ..port.. "...") | 14 | print("Attempting connection to host '" ..host.. "' and port " ..port.. "...") |
| 15 | c = socket.try(socket.connect(host, port)) | 15 | c = assert(socket.connect(host, port)) |
| 16 | print("Connected! Please type stuff (empty line to stop):") | 16 | print("Connected! Please type stuff (empty line to stop):") |
| 17 | l = io.read() | 17 | l = io.read() |
| 18 | while l and l ~= "" and not e do | 18 | while l and l ~= "" and not e do |
| 19 | socket.try(c:send(l, "\n")) | 19 | assert(c:send(l .. "\n")) |
| 20 | l = io.read() | 20 | l = io.read() |
| 21 | end | 21 | end |
diff --git a/samples/tinyirc.lua b/samples/tinyirc.lua index 13f42ec..684e7c0 100644 --- a/samples/tinyirc.lua +++ b/samples/tinyirc.lua | |||
| @@ -14,8 +14,8 @@ if arg then | |||
| 14 | port2 = arg[3] or port2 | 14 | port2 = arg[3] or port2 |
| 15 | end | 15 | end |
| 16 | 16 | ||
| 17 | server1 = socket.try(socket.bind(host, port1)) | 17 | server1 = assert(socket.bind(host, port1)) |
| 18 | server2 = socket.try(socket.bind(host, port2)) | 18 | server2 = assert(socket.bind(host, port2)) |
| 19 | server1:settimeout(1) -- make sure we don't block in accept | 19 | server1:settimeout(1) -- make sure we don't block in accept |
| 20 | server2:settimeout(1) | 20 | server2:settimeout(1) |
| 21 | 21 | ||
diff --git a/src/ftp.lua b/src/ftp.lua index c55ec4e..9b7c1e5 100644 --- a/src/ftp.lua +++ b/src/ftp.lua | |||
| @@ -278,4 +278,4 @@ get = socket.protect(function(gett) | |||
| 278 | else return tget(gett) end | 278 | else return tget(gett) end |
| 279 | end) | 279 | end) |
| 280 | 280 | ||
| 281 | getmetatable(_M).__index = nil | 281 | --getmetatable(_M).__index = nil |
diff --git a/src/http.lua b/src/http.lua index 27ce960..5fb59ce 100644 --- a/src/http.lua +++ b/src/http.lua | |||
| @@ -259,4 +259,4 @@ request = socket.protect(function(reqt, body) | |||
| 259 | else return trequest(reqt) end | 259 | else return trequest(reqt) end |
| 260 | end) | 260 | end) |
| 261 | 261 | ||
| 262 | getmetatable(_M).__index = nil | 262 | --getmetatable(_M).__index = nil |
diff --git a/src/ltn12.lua b/src/ltn12.lua index 813e7d6..8c80196 100644 --- a/src/ltn12.lua +++ b/src/ltn12.lua | |||
| @@ -170,20 +170,16 @@ end | |||
| 170 | 170 | ||
| 171 | -- creates a source that produces contents of several sources, one after the | 171 | -- creates a source that produces contents of several sources, one after the |
| 172 | -- other, as if they were concatenated | 172 | -- other, as if they were concatenated |
| 173 | -- (thanks to Wim Couwenberg) | ||
| 173 | function source.cat(...) | 174 | function source.cat(...) |
| 174 | local co = coroutine.create(function() | 175 | local src = table.remove(arg, 1) |
| 175 | local i = 1 | ||
| 176 | while i <= table.getn(arg) do | ||
| 177 | local chunk, err = arg[i]() | ||
| 178 | if chunk then coroutine.yield(chunk) | ||
| 179 | elseif err then return nil, err | ||
| 180 | else i = i + 1 end | ||
| 181 | end | ||
| 182 | end) | ||
| 183 | return function() | 176 | return function() |
| 184 | local ret, a, b = coroutine.resume(co) | 177 | while src do |
| 185 | if ret then return a, b | 178 | local chunk, err = src() |
| 186 | else return nil, a end | 179 | if chunk then return chunk end |
| 180 | if err then return nil, err end | ||
| 181 | src = table.remove(arg, 1) | ||
| 182 | end | ||
| 187 | end | 183 | end |
| 188 | end | 184 | end |
| 189 | 185 | ||
| @@ -276,4 +272,4 @@ function pump.all(src, snk, step) | |||
| 276 | end | 272 | end |
| 277 | end | 273 | end |
| 278 | 274 | ||
| 279 | getmetatable(_M).__index = nil | 275 | --getmetatable(_M).__index = nil |
diff --git a/src/luasocket.h b/src/luasocket.h index 33524e3..db54a18 100644 --- a/src/luasocket.h +++ b/src/luasocket.h | |||
| @@ -13,7 +13,9 @@ | |||
| 13 | /*-------------------------------------------------------------------------*\ | 13 | /*-------------------------------------------------------------------------*\ |
| 14 | * Current luasocket version | 14 | * Current luasocket version |
| 15 | \*-------------------------------------------------------------------------*/ | 15 | \*-------------------------------------------------------------------------*/ |
| 16 | #define LUASOCKET_VERSION "LuaSocket 2.0 (beta3)" | 16 | #define LUASOCKET_VERSION "LuaSocket 2.0 (beta3)" |
| 17 | #define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2005 Diego Nehab" | ||
| 18 | #define LUASOCKET_AUTHORS "Diego Nehab" | ||
| 17 | 19 | ||
| 18 | /*-------------------------------------------------------------------------*\ | 20 | /*-------------------------------------------------------------------------*\ |
| 19 | * This macro prefixes all exported API functions | 21 | * This macro prefixes all exported API functions |
diff --git a/src/mime.lua b/src/mime.lua index 71efdb3..4d5bdba 100644 --- a/src/mime.lua +++ b/src/mime.lua | |||
| @@ -85,4 +85,4 @@ function mime.stuff() | |||
| 85 | return ltn12.filter.cycle(dot, 2) | 85 | return ltn12.filter.cycle(dot, 2) |
| 86 | end | 86 | end |
| 87 | 87 | ||
| 88 | getmetatable(_M).__index = nil | 88 | --getmetatable(_M).__index = nil |
diff --git a/src/smtp.lua b/src/smtp.lua index 6281544..12c2195 100644 --- a/src/smtp.lua +++ b/src/smtp.lua | |||
| @@ -245,4 +245,4 @@ send = socket.protect(function(mailt) | |||
| 245 | return s:close() | 245 | return s:close() |
| 246 | end) | 246 | end) |
| 247 | 247 | ||
| 248 | getmetatable(_M).__index = nil | 248 | --getmetatable(_M).__index = nil |
diff --git a/src/socket.lua b/src/socket.lua index 57619fa..e3c85f0 100644 --- a/src/socket.lua +++ b/src/socket.lua | |||
| @@ -172,4 +172,4 @@ socket.sourcet["default"] = socket.sourcet["until-closed"] | |||
| 172 | 172 | ||
| 173 | socket.source = socket.choose(socket.sourcet) | 173 | socket.source = socket.choose(socket.sourcet) |
| 174 | 174 | ||
| 175 | getmetatable(_M).__index = nil | 175 | --getmetatable(_M).__index = nil |
| @@ -120,4 +120,4 @@ function connect(host, port, timeout) | |||
| 120 | return base.setmetatable({c = c}, metat) | 120 | return base.setmetatable({c = c}, metat) |
| 121 | end | 121 | end |
| 122 | 122 | ||
| 123 | getmetatable(_M).__index = nil | 123 | --getmetatable(_M).__index = nil |
diff --git a/src/url.lua b/src/url.lua index e6132f8..8d7b88f 100644 --- a/src/url.lua +++ b/src/url.lua | |||
| @@ -273,4 +273,4 @@ function build_path(parsed, unsafe) | |||
| 273 | return path | 273 | return path |
| 274 | end | 274 | end |
| 275 | 275 | ||
| 276 | getmetatable(_M).__index = nil | 276 | --getmetatable(_M).__index = nil |
diff --git a/test/httptest.lua b/test/httptest.lua index 71021a4..8862ceb 100644 --- a/test/httptest.lua +++ b/test/httptest.lua | |||
| @@ -23,7 +23,7 @@ http.TIMEOUT = 10 | |||
| 23 | local t = socket.gettime() | 23 | local t = socket.gettime() |
| 24 | 24 | ||
| 25 | host = host or "diego.student.princeton.edu" | 25 | host = host or "diego.student.princeton.edu" |
| 26 | proxy = proxy or "http://localhost:3128" | 26 | proxy = proxy or "http://dell-diego:3128" |
| 27 | prefix = prefix or "/luasocket-test" | 27 | prefix = prefix or "/luasocket-test" |
| 28 | cgiprefix = cgiprefix or "/luasocket-test-cgi" | 28 | cgiprefix = cgiprefix or "/luasocket-test-cgi" |
| 29 | index_file = "test/index.html" | 29 | index_file = "test/index.html" |
| @@ -399,7 +399,6 @@ print("ok") | |||
| 399 | 399 | ||
| 400 | ------------------------------------------------------------------------ | 400 | ------------------------------------------------------------------------ |
| 401 | io.write("testing HEAD method: ") | 401 | io.write("testing HEAD method: ") |
| 402 | http.TIMEOUT = 1 | ||
| 403 | local r, c, h = http.request { | 402 | local r, c, h = http.request { |
| 404 | method = "HEAD", | 403 | method = "HEAD", |
| 405 | url = "http://www.cs.princeton.edu/~diego/" | 404 | url = "http://www.cs.princeton.edu/~diego/" |
