@@ -187,11 +187,6 @@ void php_stream_mode_sanitize_fdopen_fopencookie(php_stream *stream, char *resul
187
187
}
188
188
/* }}} */
189
189
190
- static inline bool is_stream_user_stream (const php_stream * stream )
191
- {
192
- return stream -> ops == & php_stream_userspace_ops ;
193
- }
194
-
195
190
/* {{{ php_stream_cast */
196
191
PHPAPI int _php_stream_cast (php_stream * stream , int castas , void * * ret , int show_err )
197
192
{
@@ -201,10 +196,6 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
201
196
/* synchronize our buffer (if possible) */
202
197
if (ret && castas != PHP_STREAM_AS_FD_FOR_SELECT ) {
203
198
php_stream_flush (stream );
204
- /* Do special handling for user streams as they may not implement the cast method */
205
- if (!show_err && is_stream_user_stream (stream )) {
206
- castas |= PHP_STREAM_FLAG_SUPPRESS_ERRORS ;
207
- }
208
199
if (stream -> ops -> seek && (stream -> flags & PHP_STREAM_FLAG_NO_SEEK ) == 0 ) {
209
200
zend_off_t dummy ;
210
201
@@ -223,11 +214,6 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
223
214
goto exit_success ;
224
215
}
225
216
226
- /* Do special handling for user streams as they may not implement the cast method */
227
- if (!show_err && is_stream_user_stream (stream )) {
228
- castas |= PHP_STREAM_FLAG_SUPPRESS_ERRORS ;
229
- }
230
-
231
217
/* if the stream is a stdio stream let's give it a chance to respond
232
218
* first, to avoid doubling up the layers of stdio with an fopencookie */
233
219
if (php_stream_is (stream , PHP_STREAM_IS_STDIO ) &&
@@ -282,7 +268,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
282
268
} else if (flags & PHP_STREAM_CAST_TRY_HARD ) {
283
269
php_stream * newstream ;
284
270
285
- newstream = php_stream_fopen_tmpfile_ex ( /* emit errors */ false );
271
+ newstream = php_stream_fopen_tmpfile ( );
286
272
if (newstream ) {
287
273
int retcopy = php_stream_copy_to_stream_ex (stream , newstream , PHP_STREAM_COPY_ALL , NULL );
288
274
@@ -314,10 +300,6 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
314
300
}
315
301
return FAILURE ;
316
302
} else if (stream -> ops -> cast ) {
317
- /* Do special handling for user streams as they may not implement the cast method */
318
- if (!show_err && is_stream_user_stream (stream )) {
319
- castas |= PHP_STREAM_FLAG_SUPPRESS_ERRORS ;
320
- }
321
303
if (stream -> ops -> cast (stream , castas , ret ) == SUCCESS ) {
322
304
goto exit_success ;
323
305
}
0 commit comments