Skip to content

Commit

Permalink
Forward synchronously, the PHP development webserver can only handle …
Browse files Browse the repository at this point in the history
…one at a time!
  • Loading branch information
thekid committed Jan 18, 2025
1 parent b9c69dc commit 9f9fe9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/php/xp/web/srv/ForwardRequests.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function handleData($socket) {
// \util\cmd\Console::writeLine('>>> ', $message);
$this->backend->write($message."\r\n");
foreach ($this->transmit($request->incoming(), $this->backend) as $step) {
yield 'read' => $socket;
// yield 'read' => $socket;
}

$response= new Input($this->backend);
Expand All @@ -79,7 +79,7 @@ public function handleData($socket) {
$result= null;
}

yield 'write' => $socket;
// yield 'write' => $socket;
$message= "HTTP/{$response->version()} {$response->status()} {$response->message()}\r\n";
foreach ($response->headers() as $name => $value) {
isset($exclude[$name]) || $message.= "{$name}: {$value}\r\n";
Expand All @@ -88,7 +88,7 @@ public function handleData($socket) {
$socket->write($message."\r\n");

foreach ($this->transmit($response->incoming(), $socket) as $step) {
yield 'write' => $socket;
// yield 'write' => $socket;
}
$this->backend->close();

Expand Down

0 comments on commit 9f9fe9f

Please sign in to comment.