diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-01-18 08:59:21 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-01-18 08:59:21 +0000 |
commit | 3ea92711269153916990d6cd7999bf436775e647 (patch) | |
tree | 7643554eabc998871bf7627abe499614836e3b3d | |
parent | 50ce1437255ada7ec8e667020001a1a00cf5744e (diff) | |
download | luasocket-3ea92711269153916990d6cd7999bf436775e647.tar.gz luasocket-3ea92711269153916990d6cd7999bf436775e647.tar.bz2 luasocket-3ea92711269153916990d6cd7999bf436775e647.zip |
Added new filter to code.c, to convert between line conventions.
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | etc/eol.lua | 9 | ||||
-rw-r--r-- | src/http.lua | 2 | ||||
-rw-r--r-- | test/httptest.lua | 3 |
4 files changed, 14 insertions, 5 deletions
@@ -1,9 +1,10 @@ | |||
1 | 1 | write some utilities that use the code.lua module and put them | |
2 | 2 | in etc, modify the README.etc file and makefile.dist (eol.lua is done) | |
3 | 3 | ||
4 | check for interrupt compliance | 4 | check for interrupt compliance |
5 | add connect with timeout | 5 | add connect with timeout |
6 | add gethostname and use it in HTTP, SMTP etc, and add manual entry. | 6 | add gethostname and use it in HTTP, SMTP etc, and add manual entry. |
7 | add thanks for cassino and david burgess | ||
7 | 8 | ||
8 | add local connect, and manual entry | 9 | add 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 @@ | |||
1 | marker = {['-u'] = '\10', ['-d'] = '\13\10'} | ||
2 | arg = arg or {'-u'} | ||
3 | marker = marker[arg[1]] or marker['-u'] | ||
4 | local convert = socket.code.canonic(marker) | ||
5 | while 1 do | ||
6 | local chunk = io.read(4096) | ||
7 | io.write(convert(chunk)) | ||
8 | if not chunk then break end | ||
9 | end | ||
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 | ----------------------------------------------------------------------------- |
420 | local function authorize(reqt, parsed, respt) | 420 | local 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: ") | |||
216 | request = { | 216 | request = { |
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 | } |
223 | expect = { | 222 | expect = { |