goto out;
/* avoid buffering issues while reading header */
- if (options & STREAM_WILL_CAST)
- chunk_size = php_stream_set_chunk_size(stream, 1);
+ chunk_size = php_stream_set_chunk_size(stream, 1);
php_stream_context_set(stream, context);
if (stream) {
stream->wrapperdata = response_header;
php_stream_notify_progress_init(context, 0, file_size);
- if (options & STREAM_WILL_CAST)
- php_stream_set_chunk_size(stream, chunk_size);
+ /* Restore original chunk size now that we're done with headers */
+ php_stream_set_chunk_size(stream, chunk_size);
/* as far as streams are concerned, we are now at the start of
* the stream */
stream->position = 0;