forked from yystopf/xiuos
Fix session bug.
This commit is contained in:
parent
dd0c6c66ed
commit
ba54936940
|
@ -223,7 +223,7 @@ void ipc_server_loop(struct IpcNode* ipc_node)
|
|||
if (ipc_node->interfaces[ipc_server_loop_cur_msg->header.opcode]) {
|
||||
ipc_node->interfaces[ipc_server_loop_cur_msg->header.opcode](ipc_server_loop_cur_msg);
|
||||
// check if this session is delayed by op handler, all messages after the delayed message in current session is blocked.
|
||||
if (is_cur_session_delayed()) {
|
||||
if (ipc_server_loop_cur_msg->header.done == 0) {
|
||||
ipc_server_loop_cur_msg->header.delayed = 1;
|
||||
has_delayed = true;
|
||||
break;
|
||||
|
|
|
@ -46,7 +46,7 @@ int free_session(struct Session* session)
|
|||
|
||||
void* session_alloc_buf(struct Session* session, int len)
|
||||
{
|
||||
if (len > session_remain_capacity(session)) {
|
||||
if (len < 0 || len > session_remain_capacity(session)) {
|
||||
return NULL;
|
||||
}
|
||||
void* buf = (void*)((uintptr_t)session->buf + session->tail);
|
||||
|
@ -58,7 +58,7 @@ void* session_alloc_buf(struct Session* session, int len)
|
|||
|
||||
bool session_free_buf(struct Session* session, int len)
|
||||
{
|
||||
if (len > session_used_size(session)) {
|
||||
if (len < 0 || len > session_used_size(session)) {
|
||||
return false;
|
||||
}
|
||||
assert(session_forward_head(session, len) != -1);
|
||||
|
|
Loading…
Reference in New Issue