Skip to content

Commit

Permalink
bugfix: socket.read(fd, nil) should clear buffer size to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Jul 31, 2014
1 parent 25a8b3a commit 11c5289
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lualib-src/lua-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ lclearbuffer(lua_State *L) {
while(sb->head) {
return_free_node(L,2,sb);
}
sb->size = 0;
return 0;
}

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

Expand Down

0 comments on commit 11c5289

Please sign in to comment.