Index: trunk/phase3/includes/filerepo/backend/SwiftFileBackend.php |
— | — | @@ -25,9 +25,9 @@ |
26 | 26 | |
27 | 27 | /** @var CF_Connection */ |
28 | 28 | protected $conn; // Swift connection handle |
| 29 | + protected $connTTL = 120; // integer seconds |
29 | 30 | protected $connStarted = 0; // integer UNIX timestamp |
30 | 31 | protected $connContainers = array(); // container object cache |
31 | | - protected $connTTL = 120; // integer seconds |
32 | 32 | |
33 | 33 | protected $swiftProxyUser; // string |
34 | 34 | |
— | — | @@ -367,7 +367,7 @@ |
368 | 368 | return $status; |
369 | 369 | } |
370 | 370 | |
371 | | - // (c) Delete the container if empty |
| 371 | + // (b) Delete the container if empty |
372 | 372 | if ( $contObj->object_count == 0 ) { |
373 | 373 | try { |
374 | 374 | $this->deleteContainer( $fullCont ); |
— | — | @@ -503,16 +503,12 @@ |
504 | 504 | |
505 | 505 | try { |
506 | 506 | $cont = $this->getContainer( $srcCont ); |
507 | | - $obj = $cont->get_object( $srcRel ); |
508 | 507 | } catch ( NoSuchContainerException $e ) { |
509 | 508 | $status->fatal( 'backend-fail-stream', $params['src'] ); |
510 | 509 | return $status; |
511 | | - } catch ( NoSuchObjectException $e ) { |
512 | | - $status->fatal( 'backend-fail-stream', $params['src'] ); |
| 510 | + } catch ( InvalidResponseException $e ) { |
| 511 | + $status->fatal( 'backend-fail-connect', $this->name ); |
513 | 512 | return $status; |
514 | | - } catch ( IOException $e ) { |
515 | | - $status->fatal( 'backend-fail-stream', $params['src'] ); |
516 | | - return $status; |
517 | 513 | } catch ( Exception $e ) { // some other exception? |
518 | 514 | $status->fatal( 'backend-fail-stream', $params['src'] ); |
519 | 515 | $this->logException( $e, __METHOD__, $params ); |
— | — | @@ -521,9 +517,10 @@ |
522 | 518 | |
523 | 519 | try { |
524 | 520 | $output = fopen( 'php://output', 'w' ); |
| 521 | + $obj = new CF_Object( $cont, $srcRel, False, False ); // skip HEAD request |
525 | 522 | $obj->stream( $output, $this->headersFromParams( $params ) ); |
526 | | - } catch ( InvalidResponseException $e ) { |
527 | | - $status->fatal( 'backend-fail-connect', $this->name ); |
| 523 | + } catch ( InvalidResponseException $e ) { // 404? connection problem? |
| 524 | + $status->fatal( 'backend-fail-stream', $params['src'] ); |
528 | 525 | } catch ( Exception $e ) { // some other exception? |
529 | 526 | $status->fatal( 'backend-fail-stream', $params['src'] ); |
530 | 527 | $this->logException( $e, __METHOD__, $params ); |