Gzip output handler - `ob_end_flush()` must not call `flush()`
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C
- Star
- 40.4k
- Fork
- 8.2k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 96
Mô tả
Description
This issue is problematic only when zlib.output_compression is enabled.
Currently, when zlib.output_compression is enabled like:
php -S 127.0.0.1:81 -d zlib.output_compression=1 -t .
(but also tested if enabled when used /w Apache /wo mod_deflate)
and ob_end_flush() is called, no headers cannot be send anymore even if the nothing was output.
Currently, we had to use the following code
while (ob_get_level() > 0) {
if (ob_get_length() === 0) {
ob_end_clean();
} else {
ob_end_flush();
}
}
to workaround.
When zlib.output_compression is NOT enabled, the following code:
while (ob_get_level() > 0) {
ob_end_flush();
}
is working (allows to send additional headers).
Because of this inconsistency, I belive php gzip output handler behaviour should be fixed, when output buffer is empty, to not flush implicitly.
PHP Version
any
Operating System
any
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Tái hiện hành vi bằng lệnh PHP CLI được cung cấp, so sánh một bộ đệm đầu ra rỗng với một bộ đệm chứa đầu ra và kiểm tra xem headers còn có thể được gửi hay không. Sau đó kiểm tra đường dẫn ob_end_flush() và trình xử lý đầu ra zlib; hoàn tất khi một bộ đệm rỗng không ngầm thực hiện flush, còn đầu ra không rỗng vẫn giữ hành vi mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- c, php
- Lĩnh vực
- backend
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100