diff --git a/FIX b/FIX index 9cd7421..10a96b0 100644 --- a/FIX +++ b/FIX @@ -1 +1,2 @@ -tcp:shutdown() was checking for group instead of class. +tcp{client}:shutdown() was checking for group instead of class. +tcp{client}:send() now returns i+sent-1... diff --git a/TODO b/TODO index 2819707..ed00a6c 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,15 @@ + +think about a dispatcher. + - it creates a server and receives a function that will do the work on + received connections + - this function is invoked with the client socket + - it calls special send and receive functions that yield on timeout + +think about how to extend http, ftp, smtp to use special send and receive +functions for non-blocking so they can be used in the context of the +dispatcher! + +adjust manual for new sock:send returns. check all "require("http")" etc in the manual. _VERSION, _DEBUG, etc. 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) { if (err != IO_DONE) { lua_pushnil(L); lua_pushstring(L, buf->io->error(buf->io->ctx, err)); - lua_pushnumber(L, sent); + lua_pushnumber(L, sent+start-1); } else { - lua_pushnumber(L, sent); + lua_pushnumber(L, sent+start-1); lua_pushnil(L); lua_pushnil(L); }