diff options
Diffstat (limited to 'std/http/server.ts')
-rw-r--r-- | std/http/server.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/std/http/server.ts b/std/http/server.ts index deedb0f12..ce32511b1 100644 --- a/std/http/server.ts +++ b/std/http/server.ts @@ -371,7 +371,9 @@ export class Server implements AsyncIterable<ServerRequest> { ): AsyncIterableIterator<ServerRequest> { if (this.closing) return; // Wait for a new connection. - const conn = await this.listener.accept(); + const { value, done } = await this.listener.next(); + if (done) return; + const conn = value as Conn; // Try to accept another connection and add it to the multiplexer. mux.add(this.acceptConnAndIterateHttpRequests(mux)); // Yield the requests that arrive on the just-accepted connection. |