Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Jun 8, 2021
1 parent 8323445 commit 2609899
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions ext-src/swoole_curl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,8 @@ CURLcode Multi::exec(php_curl *ch) {

Handle *handle = get_handle(ch->cp);

Coroutine::CancelFunc cancel_fn = [](Coroutine *co) {
co->resume();
return true;
};

SW_LOOP {
co->yield(&cancel_fn);
co->yield_ex(-1);
if (co->is_canceled()) {
swoole_set_last_error(SW_ERROR_CO_CANCELED);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/server/reactor_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ static int ReactorThread_onPipeRead(Reactor *reactor, Event *ev) {
SW_ERROR_SESSION_NOT_EXIST,
"force close connection failed, session#%ld does not exist",
session_id);
return SW_ERR;
return SW_OK;
}

if (serv->disable_notify || conn->close_force) {
Expand Down

0 comments on commit 2609899

Please sign in to comment.