akamai / NetStorageKit-PHP

Akamai NetStorage for PHP
http://developer.akamai.com
Apache License 2.0
18 stars 19 forks source link

Return false when writeStream fails #7

Closed lookaflyingdonkey closed 7 years ago

lookaflyingdonkey commented 7 years ago

Fixes a bug where using writeStream expects a false return value when it fails, was actually returning a truthy object.

This impacts the storage manager functionality when using copy as it will return true for a copy even if the copy failed. Noticed when trying to copy a large file from stream to stream and had a low timeout set.

dshafik commented 7 years ago

Good catch, the assignment to $meta['stream'] was implicitly casting the false to an array, which is then truthy.

Thanks!

lookaflyingdonkey commented 7 years ago

No worries, glad I could help. It had me pulling my hair for a few hours that it was returning true for the transfer but only little files were appearing!