Skip to content

Instantly share code, notes, and snippets.

@nielsdos
Created June 7, 2024 21:58
Show Gist options
  • Save nielsdos/b47a42bb29f2ababdba35b37eaa3d468 to your computer and use it in GitHub Desktop.
Save nielsdos/b47a42bb29f2ababdba35b37eaa3d468 to your computer and use it in GitHub Desktop.
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 238212c745..e9b5152f97 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -46,7 +46,11 @@ typedef struct {
FILE *fopencookie(void *cookie, const char *mode, cookie_io_functions_t *funcs)
{
- return funopen(cookie, funcs->reader, funcs->writer, funcs->seeker, funcs->closer);
+ FILE *file = funopen(cookie, funcs->reader, funcs->writer, funcs->seeker, funcs->closer);
+ if (file) {
+ setvbuf(file, NULL, _IONBF, 0);
+ }
+ return file;
}
# define HAVE_FOPENCOOKIE 1
# define PHP_EMULATE_FOPENCOOKIE 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment