Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

cURL incompatibility with Kaspersky (kesl)

Đang mở
#656 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 9 ngày

Một pull request liên quan đã được merge.

  • #657 của @mircobabini — đã merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
php
Lĩnh vực
networking

Hướng nghiên cứu

Bắt đầu từ triển khai WpOrg\Requests\Transport\cURL được các lệnh gọi wp_remote_* sử dụng và kiểm tra logic của header Connection cùng với phiên bản cURL hiện có. Xác minh hành vi đối với lỗi truyền tải Kaspersky kesl đã được báo cáo; hoàn tất khi header có điều kiện đối với các phiên bản cURL cũ hơn và đường dẫn tải xuống hiện tại vẫn hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Status: triage

Summary

I'm facing an issue with some servers having kesl service (Kaspersky) installed and running.

Sometimes wp_remote_* calls fails with error:

Scaricamento del pacchetto di installazione da https://downloads.wordpress.org/plugin/jetpack.10.1.zip...
Warning: Il download non è andato a buon fine. "cURL error 18: transfer closed with 332690 bytes remaining to read"

The number of bytes is completely randomic.
Since it's not consistent, I've prepared this script to be run over and over (without wp-cli cache of course):

while :; do  wp plugin install jetpack && wp plugin delete jetpack && rm -rf /root/.wp-cli/cache/*; done

After digging a lot into WpOrg\Requests\Transport\cURL implementation I've found these lines being the cause of the issue:

<?php
// Force closing the connection for old versions of cURL (<7.22).
if (!isset($headers['Connection'])) {
        $headers['Connection'] = 'close';
}

Disabling these lines, the issue disappear. Why aren't we checking the cURL version here?
I would then suggest these changes:

  1. Add a new const const CURL_7_22_0 = 0x071600
  2. Check the version and add that header only if needed

Your environment

Environment Answer
Operating system and version (e.g. Ubuntu 20.04, CentOS, tried both)
PHP version 7.4 (tried others as well)
Requests version provided with WordPress latest
Autoloader used WordPress
Link to your project into a vpn, not accessible through the internet

Tested against develop branch?

  • I have verified the issue still exists in the develop branch of Requests.
Ngôn ngữ chính
PHP
Star
3.6k
Fork
503
Merge trung bình
10 ngày 23 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WordPress/Requests

Tất cả issue của WordPress/Requests

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.