Skip to content

Commit

Permalink
fix bug: dead loop in issue 6
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtdkp committed Apr 2, 2017
1 parent ce913cf commit 50c6879
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ void connection_expire(connection_t* c) {
heap_shift_up(c->heap_idx);
if (c->side == C_SIDE_FRONT && c->r->uc)
connection_expire(c->r->uc);
else if (c->side == C_SIDE_BACK)
c->r->uc = NULL;
}

bool connection_is_expired(connection_t* c) {
Expand Down
2 changes: 1 addition & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ wait:;
err == ERROR ? connection_expire(c): connection_activate(c);
}
if (!connection_is_expired(c) && events[i].events & EPOLLOUT) {
err = (c->side == C_SIDE_BACK) ?
err = (c->side == C_SIDE_BACK) ?
handle_pass(c): handle_response(c);
err == ERROR ? connection_expire(c): connection_activate(c);
}
Expand Down

0 comments on commit 50c6879

Please sign in to comment.