check mongo reply data stream

This commit is contained in:
Cloud Wu
2014-06-09 17:43:40 +08:00
parent f92fc153e4
commit bf6501f2ee
3 changed files with 19 additions and 3 deletions

View File

@@ -260,6 +260,13 @@ op_reply(lua_State *L) {
lua_pushnil(L);
lua_rawseti(L, 2, i);
}
} else {
if (sz >= 4) {
sz -= get_length((document)doc);
}
}
if (sz != 0) {
return luaL_error(L, "Invalid result bson document");
}
lua_pushboolean(L,1);
lua_pushinteger(L, id);