diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-02-04 14:29:11 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-02-04 14:29:11 +0000 |
commit | 0b2542d1a61fc5425ff65ab3dbf7ba7de174763f (patch) | |
tree | 8a6188e11db0c9ef6891c31e8a1bebca050b23b2 /src/smtp.lua | |
parent | f67864f86c7d703325e86b14d0ba33992c52891b (diff) | |
download | luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.gz luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.bz2 luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.zip |
Worked on the manual.
Implemented stuffing (needs test)
Added cddb and qp examples.
Diffstat (limited to 'src/smtp.lua')
-rw-r--r-- | src/smtp.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/smtp.lua b/src/smtp.lua index 25d7f74..8b65e44 100644 --- a/src/smtp.lua +++ b/src/smtp.lua | |||
@@ -4,7 +4,7 @@ if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end | |||
4 | local socket = _G[LUASOCKET_LIBNAME] | 4 | local socket = _G[LUASOCKET_LIBNAME] |
5 | if not socket then error('module requires LuaSocket') end | 5 | if not socket then error('module requires LuaSocket') end |
6 | -- create smtp namespace inside LuaSocket namespace | 6 | -- create smtp namespace inside LuaSocket namespace |
7 | local smtp = {} | 7 | local smtp = socket.smtp or {} |
8 | socket.smtp = smtp | 8 | socket.smtp = smtp |
9 | -- make all module globals fall into smtp namespace | 9 | -- make all module globals fall into smtp namespace |
10 | setmetatable(smtp, { __index = _G }) | 10 | setmetatable(smtp, { __index = _G }) |
@@ -18,6 +18,10 @@ DOMAIN = os.getenv("SERVER_NAME") or "localhost" | |||
18 | -- default server used to send e-mails | 18 | -- default server used to send e-mails |
19 | SERVER = "localhost" | 19 | SERVER = "localhost" |
20 | 20 | ||
21 | function stuff() | ||
22 | return socket.cicle(dot, 2) | ||
23 | end | ||
24 | |||
21 | -- tries to get a pattern from the server and closes socket on error | 25 | -- tries to get a pattern from the server and closes socket on error |
22 | local function try_receiving(connection, pattern) | 26 | local function try_receiving(connection, pattern) |
23 | local data, message = connection:receive(pattern) | 27 | local data, message = connection:receive(pattern) |