Fixed smtp.lua loading.

Adjusted tftp module.
Added some comments.
This commit is contained in:
Diego Nehab 2004-06-16 01:02:07 +00:00
parent 843a431ef9
commit d46f7a09a7
20 changed files with 162 additions and 139 deletions

View file

@ -1,11 +1,13 @@
smtp = require("smtp")
function test_dot(original, right)
local result, n = socket.smtp.dot(2, original)
local result, n = smtp.dot(2, original)
assert(result == right, "->" .. result .. "<-")
print("ok")
end
function test_stuff(original, right)
local result, n = socket.smtp.dot(2, original)
local result, n = smtp.dot(2, original)
assert(result == right, "->" .. result .. "<-")
print("ok")
end

View file

@ -14,7 +14,7 @@ source = smtp.message{
},
body = {
preamble = "If your client doesn't understand attachments, \r\n" ..
"it will still display the preamble and the epilogue.\r\n",
"it will still display the preamble and the epilogue.\r\n" ..
"Preamble might show up even in a MIME enabled client.",
-- first part: No headers means plain text, us-ascii.
-- The mime.eol low-level filter normalizes end-of-line markers.
@ -55,3 +55,5 @@ r, e = smtp.send{
source = source,
server = "mail.cs.princeton.edu"
}
print(r, e)

View file

@ -1,5 +1,5 @@
-- load tftpclnt.lua
dofile("tftp.lua")
local tftp = require("tftp")
-- needs tftp server running on localhost, with root pointing to
-- a directory with index.html in it
@ -13,7 +13,7 @@ function readfile(file)
end
host = host or "localhost"
retrieved, err = socket.tftp.get("tftp://" .. host .."/index.html")
retrieved, err = tftp.get("tftp://" .. host .."/index.html")
assert(not err, err)
original = readfile("test/index.html")
assert(original == retrieved, "files differ!")