Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit f20e5ee

Browse files
committed
🐛 修复206时不会上报数据
1 parent 756c802 commit f20e5ee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

inc/server.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public function startserver() {
5353
}
5454
$length = $end_byte - $start_byte + 1;
5555
$fileSize = filesize($this->dir.'/'.substr($downloadhash, 0, 2).'/'.$downloadhash);
56+
global $enable;
57+
if ($enable){
58+
global $kacounters;
59+
$kacounters->incr('1','hits');
60+
$kacounters->incr('1','bytes',$length);
61+
}
5662
$code = 206;
5763
$response->header('Content-Type', 'application/octet-stream');
5864
$response->sendfile($this->dir.'/'.substr($downloadhash, 0, 2).'/'.$downloadhash,$start_byte,$length);

0 commit comments

Comments
 (0)