diff options
| author | 2023-03-05 18:09:17 +0200 | |
|---|---|---|
| committer | 2023-03-05 08:09:17 -0800 | |
| commit | 67422785cc593003813d500c13919d35cd4259b0 (patch) | |
| tree | 1b3e99e6c0d2a74a05b743c0cefae3a1062d8cbf /src | |
| parent | 42f6b35a5be8bc0b48f7643618a8458c146e8272 (diff) | |
| download | bun-67422785cc593003813d500c13919d35cd4259b0.tar.gz bun-67422785cc593003813d500c13919d35cd4259b0.tar.zst bun-67422785cc593003813d500c13919d35cd4259b0.zip | |
[install] fix connection error detection (#2307)
Diffstat (limited to 'src')
| -rw-r--r-- | src/http_client_async.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/http_client_async.zig b/src/http_client_async.zig index 945406448..0033d8ad0 100644 --- a/src/http_client_async.zig +++ b/src/http_client_async.zig @@ -1335,14 +1335,15 @@ pub const AsyncHTTP = struct { std.debug.assert(active_requests > 0); var completion = this.completion_callback; - this.response = result.response; this.elapsed = http_thread.timer.read() -| this.elapsed; this.redirected = this.client.remaining_redirect_count != default_redirect_count; if (!result.isSuccess()) { this.err = result.fail; + this.response = null; this.state.store(State.fail, .Monotonic); } else { this.err = null; + this.response = result.response; this.state.store(.success, .Monotonic); } this.client.deinit(); |
