Skip to content

Commit e6c3ab5

Browse files
committed
修复丢字bug
1 parent 5eba4e7 commit e6c3ab5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

class/Class.StreamHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public function callback($ch, $data) {
5050

5151
// 0、把上次缓冲区内数据拼接上本次的data
5252
$buffer = $this->data_buffer.$data;
53+
54+
//拼接完之后,要把缓冲字符串清空
55+
$this->data_buffer = '';
5356

5457
// 1、把所有的 'data: {' 替换为 '{' ,'data: [' 换成 '['
5558
$buffer = str_replace('data: {', '{', $buffer);

0 commit comments

Comments
 (0)