Branch Coverage

blib/lib/Yars/Routes.pm
Criterion Covered Total %
branch 72 104 69.2


line true false branch
22 0 23 if ($^O eq 'MSWin32')
46 100 562 if $c->req->method eq 'HEAD'
49 157 405 if ($url ne $c->tools->server_url)
52 44 113 if _get_from_local_stash($c, $filename, $md5)
58 25 380 unless (-r "$dir/$filename")
65 379 1 if ($c->config->download_md5_verify('default', 1) or not $c->req->headers->header('X-Yars-Skip-Verify'))
67 2 377 unless ($computed eq $md5)
73 1 377 if ($c->req->headers->header('X-Yars-Use-X-Accel'))
90 1 0 $localfile =~ /\.(\w+)$/ ? :
107 20 382 $filepath =~ /\.(\w+)$/ ? :
120 52 48 $c->req->headers->header('X-Yars-Check-Stash') ? :
122 48 52 unless $check_stash
125 70 30 if ($check_stash or $url ne $c->tools->server_url)
126 9 61 if (my $found_dir = $c->tools->local_stashed_dir($filename, $md5))
130 46 15 if $check_stash
136 16 14 -r "$dir/$filename" ? :
138 2 28 if _redirect_to_remote_stash($c, $filename, $md5)
139 12 16 unless $found_dir
148 138 44 unless my $dir = $c->tools->local_stashed_dir($filename, $md5)
150 44 0 if ($c->config->download_md5_verify('default', 1) or not $c->req->headers->header('X-Yars-Skip-Verify'))
152 0 44 unless ($computed eq $md5)
158 0 44 if ($c->req->headers->header('X-Yars-Use-X-Accel'))
171 5 50 if (my $server = $c->tools->remote_stashed_server($filename, $digest))
271 217 1 unless opendir DR, $path
274 0 1 if /^\.\.?$/
279 0 1 unless $found
287 0 1 unless $status
297 0 107 $temporary ? :
299 0 107 $temporary ? :
305 63 44 if ($res = $tx->success)
308 63 0 unless $temporary
323 0 276 unless $asset->move_to("$dir/$filename")
324 0 276 if ($@)
328 0 276 if $failed
338 0 59 if $c->req->headers->header('X-Yars-NoStash')
346 4 71 if $assigned_root and $root eq $assigned_root
347 12 59 unless ($c->tools->disk_is_up($root))
352 59 0 if (_atomic_write($dir, $filename, $asset))
358 0 59 unless $wrote
360 0 59 unless $wrote
373 0 0 if $c->req->headers->header('X-Yars-NoStash')
378 0 0 if $server eq $c->tools->server_url
379 0 0 if $server eq $assigned_server
380 0 0 if _proxy_to($c, $server, $filename, $digest, $asset, 1)
398 20 10 if ($server eq $c->tools->server_url)
401 19 1 if (-r "$dir/$filename")
402 0 19 unless unlink "$dir/$filename"
408 0 1 unless $server
412 2 9 if (my $dir = $c->tools->local_stashed_dir($filename, $md5))
413 0 2 unless unlink "$dir/$filename"
420 9 0 if (my $res = $tx->success) { }
425 0 0 if $code