Merge "Fixed fatal in SwiftFileBackend when a bogus HTTP status is given"
This commit is contained in:
commit
77eade6f9b
1 changed files with 3 additions and 2 deletions
|
|
@ -1066,10 +1066,11 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $op['response'];
|
||||
fclose( $op['stream'] ); // close open handle
|
||||
if ( $rcode >= 200 && $rcode <= 299 ) {
|
||||
$size = $tmpFiles[$path] ? $tmpFiles[$path]->getSize() : 0;
|
||||
// Double check that the disk is not full/broken
|
||||
if ( $tmpFiles[$path]->getSize() != $rhdrs['content-length'] ) {
|
||||
if ( $size != $rhdrs['content-length'] ) {
|
||||
$tmpFiles[$path] = null;
|
||||
$rerr = "Got {$tmpFiles[$path]->getSize()}/{$rhdrs['content-length']} bytes";
|
||||
$rerr = "Got {$size}/{$rhdrs['content-length']} bytes";
|
||||
$this->onError( null, __METHOD__,
|
||||
array( 'src' => $path ) + $ep, $rerr, $rcode, $rdesc );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue