mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Handle blocking initial read
This commit is contained in:
@@ -3791,6 +3791,24 @@ pub const FileReader = struct {
|
||||
this.buf = read_buf;
|
||||
}
|
||||
|
||||
this.watch(fd);
|
||||
return .{
|
||||
.pending = &this.pending,
|
||||
};
|
||||
}
|
||||
} else if (this.isFIFO() and this.poll_ref == null and available_to_read == null) {
|
||||
// we don't know if it's readable or not
|
||||
if (!bun.isReadable(fd)) {
|
||||
if (free_buffer_on_error) {
|
||||
bun.default_allocator.free(buf_to_use);
|
||||
buf_to_use = read_buf;
|
||||
}
|
||||
|
||||
if (view != .zero) {
|
||||
this.view.set(this.globalThis(), view);
|
||||
this.buf = read_buf;
|
||||
}
|
||||
|
||||
this.watch(fd);
|
||||
return .{
|
||||
.pending = &this.pending,
|
||||
|
||||
Reference in New Issue
Block a user