diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-27 21:30:01 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-27 21:30:01 +0000 |
commit | c5fefd5529e2b611367bcd917bfc2024d260e144 (patch) | |
tree | 338473c806c530b45767906f08bc73e19b16513a | |
parent | 2cd2a5d4a4ca9307eacbd73bc6c591d635204a8a (diff) | |
download | luasocket-c5fefd5529e2b611367bcd917bfc2024d260e144.tar.gz luasocket-c5fefd5529e2b611367bcd917bfc2024d260e144.tar.bz2 luasocket-c5fefd5529e2b611367bcd917bfc2024d260e144.zip |
Simplified use for sock:send.
-rw-r--r-- | FIX | 3 | ||||
-rw-r--r-- | TODO | 12 | ||||
-rw-r--r-- | src/buffer.c | 4 |
3 files changed, 16 insertions, 3 deletions
@@ -1 +1,2 @@ | |||
1 | tcp:shutdown() was checking for group instead of class. | 1 | tcp{client}:shutdown() was checking for group instead of class. |
2 | tcp{client}:send() now returns i+sent-1... | ||
@@ -1,3 +1,15 @@ | |||
1 | |||
2 | think about a dispatcher. | ||
3 | - it creates a server and receives a function that will do the work on | ||
4 | received connections | ||
5 | - this function is invoked with the client socket | ||
6 | - it calls special send and receive functions that yield on timeout | ||
7 | |||
8 | think about how to extend http, ftp, smtp to use special send and receive | ||
9 | functions for non-blocking so they can be used in the context of the | ||
10 | dispatcher! | ||
11 | |||
12 | adjust manual for new sock:send returns. | ||
1 | check all "require("http")" etc in the manual. | 13 | check all "require("http")" etc in the manual. |
2 | _VERSION, _DEBUG, etc. | 14 | _VERSION, _DEBUG, etc. |
3 | get rid of "base." kludge | 15 | get rid of "base." kludge |
diff --git a/src/buffer.c b/src/buffer.c index 1b1b791..0ec7b4d 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
@@ -90,9 +90,9 @@ int buf_meth_send(lua_State *L, p_buf buf) { | |||
90 | if (err != IO_DONE) { | 90 | if (err != IO_DONE) { |
91 | lua_pushnil(L); | 91 | lua_pushnil(L); |
92 | lua_pushstring(L, buf->io->error(buf->io->ctx, err)); | 92 | lua_pushstring(L, buf->io->error(buf->io->ctx, err)); |
93 | lua_pushnumber(L, sent); | 93 | lua_pushnumber(L, sent+start-1); |
94 | } else { | 94 | } else { |
95 | lua_pushnumber(L, sent); | 95 | lua_pushnumber(L, sent+start-1); |
96 | lua_pushnil(L); | 96 | lua_pushnil(L); |
97 | lua_pushnil(L); | 97 | lua_pushnil(L); |
98 | } | 98 | } |