Branch Coverage

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


line true false branch
23 0 23 if ($^O eq 'MSWin32')
47 100 562 if $c->req->method eq 'HEAD'
50 157 405 if ($url ne $c->tools->server_url)
53 44 113 if _get_from_local_stash($c, $filename, $md5)
59 25 380 unless (-r "$dir/$filename")
66 379 1 if ($c->config->download_md5_verify('default', 1) or not $c->req->headers->header('X-Yars-Skip-Verify'))
68 2 377 unless ($computed eq $md5)
74 1 377 if ($c->req->headers->header('X-Yars-Use-X-Accel'))
91 1 0 $localfile =~ /\.(\w+)$/ ? :
108 20 382 $filepath =~ /\.(\w+)$/ ? :
121 52 48 $c->req->headers->header('X-Yars-Check-Stash') ? :
123 48 52 unless $check_stash
126 70 30 if ($check_stash or $url ne $c->tools->server_url)
127 9 61 if (my $found_dir = $c->tools->local_stashed_dir($filename, $md5))
131 46 15 if $check_stash
137 16 14 -r "$dir/$filename" ? :
139 2 28 if _redirect_to_remote_stash($c, $filename, $md5)
140 12 16 unless $found_dir
149 138 44 unless my $dir = $c->tools->local_stashed_dir($filename, $md5)
151 44 0 if ($c->config->download_md5_verify('default', 1) or not $c->req->headers->header('X-Yars-Skip-Verify'))
153 0 44 unless ($computed eq $md5)
159 0 44 if ($c->req->headers->header('X-Yars-Use-X-Accel'))
172 5 50 if (my $server = $c->tools->remote_stashed_server($filename, $digest))
272 217 1 unless opendir DR, $path
275 0 1 if /^\.\.?$/
280 0 1 unless $found
288 0 1 unless $status
298 0 107 $temporary ? :
300 0 107 $temporary ? :
306 63 44 if ($res = $tx->success)
309 63 0 unless $temporary
324 0 276 unless $asset->move_to("$dir/$filename")
325 0 276 if ($@)
329 0 276 if $failed
339 0 59 if $c->req->headers->header('X-Yars-NoStash')
347 5 68 if $assigned_root and $root eq $assigned_root
348 9 59 unless ($c->tools->disk_is_up($root))
353 59 0 if (_atomic_write($dir, $filename, $asset))
359 0 59 unless $wrote
361 0 59 unless $wrote
374 0 0 if $c->req->headers->header('X-Yars-NoStash')
379 0 0 if $server eq $c->tools->server_url
380 0 0 if $server eq $assigned_server
381 0 0 if _proxy_to($c, $server, $filename, $digest, $asset, 1)
399 20 10 if ($server eq $c->tools->server_url)
402 19 1 if (-r "$dir/$filename")
403 0 19 unless unlink "$dir/$filename"
409 0 1 unless $server
413 2 9 if (my $dir = $c->tools->local_stashed_dir($filename, $md5))
414 0 2 unless unlink "$dir/$filename"
421 9 0 if (my $res = $tx->success) { }
426 0 0 if $code