File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -281,17 +281,24 @@ public function start()
281
281
// Close open file handles and reset the curl instance.
282
282
if (isset ($ this ->curl_fhs [$ ch ->id ])) {
283
283
$ fh = $ this ->curl_fhs [$ ch ->id ];
284
- if (!$ ch ->error ) {
284
+
285
+ if (!$ ch ->error && $ ch ->download_complete_function ) {
285
286
rewind ($ fh );
286
287
$ ch ->call ($ ch ->download_complete_function , $ fh );
287
288
}
289
+
288
290
if (is_resource ($ fh )) {
289
291
fclose ($ fh );
290
292
}
291
- defined ('STDOUT ' ) || define ('STDOUT ' , null );
293
+
294
+ if (!defined ('STDOUT ' )) {
295
+ define ('STDOUT ' , null );
296
+ }
297
+
292
298
$ ch ->setOpt (CURLOPT_FILE , STDOUT );
293
299
$ ch ->setOpt (CURLOPT_RETURNTRANSFER , true );
294
- unset($ fh );
300
+
301
+ unset($ this ->curl_fhs [$ ch ->id ]);
295
302
}
296
303
break ;
297
304
}
You can’t perform that action at this time.
0 commit comments