Skip to content

Commit

Permalink
Fix client cant be disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
sundb committed Nov 19, 2024
1 parent 55c2b51 commit bfdc208
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -2766,14 +2766,10 @@ int processInputBuffer(client *c) {

if (c->reqtype == PROTO_REQ_INLINE) {
if (processInlineBuffer(c) != C_OK) {
if (c->running_tid != IOTHREAD_MAIN_THREAD_ID && c->read_error)
putInPendingClienstForMainThread(c);
break;
}
} else if (c->reqtype == PROTO_REQ_MULTIBULK) {
if (processMultibulkBuffer(c) != C_OK) {
if (c->running_tid != IOTHREAD_MAIN_THREAD_ID && c->read_error)
putInPendingClienstForMainThread(c);
break;
}
} else {
Expand Down Expand Up @@ -2961,8 +2957,13 @@ void readQueryFromClient(connection *conn) {
c = NULL;

done:
if (c && c->running_tid == IOTHREAD_MAIN_THREAD_ID && c->read_error)
handleClientReadError(c);
if (c && c->read_error) {
if (c->running_tid == IOTHREAD_MAIN_THREAD_ID) {
handleClientReadError(c);
} else {
putInPendingClienstForMainThread(c);
}
}

if (c && c->in_reusable_querybuf) {
serverAssert(c->qb_pos == 0); /* Ensure the client's query buffer is trimmed in processInputBuffer */
Expand Down

0 comments on commit bfdc208

Please sign in to comment.