aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-01-18 08:59:21 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-01-18 08:59:21 +0000
commit3ea92711269153916990d6cd7999bf436775e647 (patch)
tree7643554eabc998871bf7627abe499614836e3b3d
parent50ce1437255ada7ec8e667020001a1a00cf5744e (diff)
downloadluasocket-3ea92711269153916990d6cd7999bf436775e647.tar.gz
luasocket-3ea92711269153916990d6cd7999bf436775e647.tar.bz2
luasocket-3ea92711269153916990d6cd7999bf436775e647.zip
Added new filter to code.c, to convert between line conventions.
-rw-r--r--TODO5
-rw-r--r--etc/eol.lua9
-rw-r--r--src/http.lua2
-rw-r--r--test/httptest.lua3
4 files changed, 14 insertions, 5 deletions
diff --git a/TODO b/TODO
index 5566d16..91b8830 100644
--- a/TODO
+++ b/TODO
@@ -1,9 +1,10 @@
1 1write some utilities that use the code.lua module and put them
2 2in etc, modify the README.etc file and makefile.dist (eol.lua is done)
3 3
4check for interrupt compliance 4check for interrupt compliance
5add connect with timeout 5add connect with timeout
6add gethostname and use it in HTTP, SMTP etc, and add manual entry. 6add gethostname and use it in HTTP, SMTP etc, and add manual entry.
7add thanks for cassino and david burgess
7 8
8add local connect, and manual entry 9add local connect, and manual entry
9 10
diff --git a/etc/eol.lua b/etc/eol.lua
new file mode 100644
index 0000000..234cc4d
--- /dev/null
+++ b/etc/eol.lua
@@ -0,0 +1,9 @@
1marker = {['-u'] = '\10', ['-d'] = '\13\10'}
2arg = arg or {'-u'}
3marker = marker[arg[1]] or marker['-u']
4local convert = socket.code.canonic(marker)
5while 1 do
6 local chunk = io.read(4096)
7 io.write(convert(chunk))
8 if not chunk then break end
9end
diff --git a/src/http.lua b/src/http.lua
index 2fc9e87..f51da25 100644
--- a/src/http.lua
+++ b/src/http.lua
@@ -419,7 +419,7 @@ end
419----------------------------------------------------------------------------- 419-----------------------------------------------------------------------------
420local function authorize(reqt, parsed, respt) 420local function authorize(reqt, parsed, respt)
421 reqt.headers["authorization"] = "Basic " .. 421 reqt.headers["authorization"] = "Basic " ..
422 socket.code.base64.encode(parsed.user .. ":" .. parsed.password) 422 (socket.code.b64(parsed.user .. ":" .. parsed.password))
423 local autht = { 423 local autht = {
424 nredirects = reqt.nredirects, 424 nredirects = reqt.nredirects,
425 method = reqt.method, 425 method = reqt.method,
diff --git a/test/httptest.lua b/test/httptest.lua
index d3a4dc0..96c9378 100644
--- a/test/httptest.lua
+++ b/test/httptest.lua
@@ -216,8 +216,7 @@ io.write("testing manual basic auth: ")
216request = { 216request = {
217 url = "http://" .. host .. prefix .. "/auth/index.html", 217 url = "http://" .. host .. prefix .. "/auth/index.html",
218 headers = { 218 headers = {
219 authorization = "Basic " .. 219 authorization = "Basic " .. (socket.code.b64("luasocket:password"))
220 socket.code.base64.encode("luasocket:password")
221 } 220 }
222} 221}
223expect = { 222expect = {