bugfix: socket.read(fd, nil) should clear buffer size to 0

This commit is contained in:
Cloud Wu
2014-07-31 17:22:59 +08:00
parent 25a8b3a179
commit 11c528987c

View File

@@ -246,6 +246,7 @@ lclearbuffer(lua_State *L) {
while(sb->head) {
return_free_node(L,2,sb);
}
sb->size = 0;
return 0;
}
@@ -264,6 +265,7 @@ lreadall(lua_State *L) {
return_free_node(L,2,sb);
}
luaL_pushresult(&b);
sb->size = 0;
return 1;
}