diff --git a/src/Adoy/FastCGI/Client.php b/src/Adoy/FastCGI/Client.php index 0a7d8a5..a5a946e 100644 --- a/src/Adoy/FastCGI/Client.php +++ b/src/Adoy/FastCGI/Client.php @@ -10,6 +10,7 @@ namespace Adoy\FastCGI; class TimedOutException extends \Exception {} +class ForbiddenException extends \Exception {} /** * Handles communication with a FastCGI application @@ -547,6 +548,12 @@ public function wait_for_response($requestId, $timeoutMs = 0) { throw new TimedOutException('Read timed out'); } + if ($info['unread_bytes'] == 0 + && $info['blocked'] + && $info['eof']) { + throw new ForbiddenException('Not in white list. Check listen.allowed_clients.'); + } + throw new \Exception('Read failed'); }