Skip to content

Commit

Permalink
QUICKFIX Continue Returns Response
Browse files Browse the repository at this point in the history
Fixes issue #1023 
The added lines returns the response to the client and allows code to continue executing. 

`ob_end_flush; ` does not actually work correctly according to https://stackoverflow.com/questions/10579116/how-to-flush-data-to-browser-but-continue-executing 
It is kept for legacy compatibility and to prevent regressions.
  • Loading branch information
rayliverified authored and chriskacerguis committed Oct 4, 2019
1 parent ae62b76 commit 3ed9565
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions application/libraries/REST_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,19 @@ public function response($data = NULL, $http_code = NULL, $continue = FALSE)
}
else
{
ob_end_flush();
if (is_callable('fastcgi_finish_request'))
{
// Terminates connection and returns response to client on PHP-FPM.
$this->output->_display();
ob_end_flush();
fastcgi_finish_request();
ignore_user_abort(true);
}
else
{
// Legacy compatibility.
ob_end_flush();
}
}

// Otherwise dump the output automatically
Expand Down Expand Up @@ -2213,4 +2225,4 @@ protected function _check_cors()
exit;
}
}
}
}

0 comments on commit 3ed9565

Please sign in to comment.