summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--src/keeper.lua1
-rw-r--r--src/lanes.c6
3 files changed, 9 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index f4ff88a..f7ab99f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,9 @@ CHANGES:
3 3
4CHANGE X: 4CHANGE X:
5 5
6CHANGE 32 BGe 14-May-2011
7* raise an error when linda:send() has nothing to send
8
6CHANGE 31 BGe 17-Apr-2011 9CHANGE 31 BGe 17-Apr-2011
7* linda uses a fast FIFO implementation to speed up data exchanges 10* linda uses a fast FIFO implementation to speed up data exchanges
8* new linda:count() method 11* new linda:count() method
diff --git a/src/keeper.lua b/src/keeper.lua
index 828932e..77bf880 100644
--- a/src/keeper.lua
+++ b/src/keeper.lua
@@ -150,7 +150,6 @@ function send( ud, key, ...)
150 local data, limits = tables( ud) 150 local data, limits = tables( ud)
151 151
152 local n = select( '#', ...) 152 local n = select( '#', ...)
153 if n == 0 then return true end -- nothing to send
154 153
155 -- Initialize queue for all keys that have been used with ':send()' 154 -- Initialize queue for all keys that have been used with ':send()'
156 -- 155 --
diff --git a/src/lanes.c b/src/lanes.c
index e514e6b..ed54b0f 100644
--- a/src/lanes.c
+++ b/src/lanes.c
@@ -295,6 +295,12 @@ LUAG_FUNC( linda_send)
295 // make sure the keys are of a valid type 295 // make sure the keys are of a valid type
296 check_key_types( L, key_i, key_i); 296 check_key_types( L, key_i, key_i);
297 297
298 // make sure there is something to send
299 if( lua_gettop( L) == key_i)
300 {
301 luaL_error( L, "no data to send");
302 }
303
298 // convert nils to some special non-nil sentinel in sent values 304 // convert nils to some special non-nil sentinel in sent values
299 keeper_toggle_nil_sentinels( L, key_i + 1, 1); 305 keeper_toggle_nil_sentinels( L, key_i + 1, 1);
300 306