mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
sep size may greater than buffer node, See Issue #286
This commit is contained in:
@@ -190,7 +190,10 @@ pop_lstring(lua_State *L, struct socket_buffer *sb, int sz, int skip) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
luaL_addlstring(&b, current->msg + sb->offset, (sz - skip < bytes) ? sz - skip : bytes);
|
int real_sz = sz - skip;
|
||||||
|
if (real_sz > 0) {
|
||||||
|
luaL_addlstring(&b, current->msg + sb->offset, (real_sz < bytes) ? real_sz : bytes);
|
||||||
|
}
|
||||||
return_free_node(L,2,sb);
|
return_free_node(L,2,sb);
|
||||||
sz-=bytes;
|
sz-=bytes;
|
||||||
if (sz==0)
|
if (sz==0)
|
||||||
|
|||||||
Reference in New Issue
Block a user