mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
more
This commit is contained in:
@@ -1371,7 +1371,7 @@ pub fn Bun__fetch_(
|
||||
body.detach();
|
||||
} else {
|
||||
// These are single-use, and have effectively been moved to the FetchTasklet.
|
||||
body = HTTPRequestBody.Empty;
|
||||
body = FetchTasklet.HTTPRequestBody.Empty;
|
||||
}
|
||||
proxy = null;
|
||||
url_proxy_buffer = "";
|
||||
|
||||
@@ -463,11 +463,11 @@ export fn Bun__FetchResponse_finalize(this: *FetchTasklet) callconv(.c) void {
|
||||
if (body.Locked.promise) |promise| {
|
||||
if (promise.isEmptyOrUndefinedOrNull()) {
|
||||
// Scenario 2b.
|
||||
this.ignoreRemainingResponseBody();
|
||||
this.response.ignoreRemainingResponseBody();
|
||||
}
|
||||
} else {
|
||||
// Scenario 3.
|
||||
this.ignoreRemainingResponseBody();
|
||||
this.response.ignoreRemainingResponseBody();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ readable_stream_ref: jsc.WebCore.ReadableStream.Strong = .{},
|
||||
/// response weak ref we need this to track the response JS lifetime
|
||||
response: jsc.Weak(FetchTasklet) = .{},
|
||||
/// native response ref if we still need it when JS is discarted
|
||||
native_response: ?*Response = null,
|
||||
native_response: ?*jsc.WebCore.Response = null,
|
||||
|
||||
/// For Http Client requests
|
||||
/// when Content-Length is provided this represents the whole size of the request
|
||||
@@ -22,7 +22,9 @@ native_response: ?*Response = null,
|
||||
/// If is not chunked encoded and Content-Length is not provided this will be unknown
|
||||
body_size: http.HTTPClientResult.BodySize = .unknown,
|
||||
|
||||
state: enum {
|
||||
state: ResponseState = .created,
|
||||
|
||||
const ResponseState = enum {
|
||||
created,
|
||||
enqueued,
|
||||
// information_headers,
|
||||
@@ -31,7 +33,7 @@ state: enum {
|
||||
// receiving_trailer_headers,
|
||||
failed,
|
||||
done,
|
||||
} = .created,
|
||||
};
|
||||
|
||||
pub const Flags = packed struct(u8) {
|
||||
ignore_data: bool = false,
|
||||
|
||||
Reference in New Issue
Block a user