Bug #79033 [Ver->Csd]: Curl timeout error with specific url and post
| From: | cmb@php.net | Date: | Sat, 28 Dec 2019 09:50:47 +0000 |
| Subject: | Bug #79033 [Ver->Csd]: Curl timeout error with specific url and post | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224571@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79033&edit=1
ID: 79033
Updated by: cmb@php.net
Reported by: dav dot tur19 at gmail dot com
Summary: Curl timeout error with specific url and post
-Status: Verified
+Status: Closed
Type: Bug
Package: cURL related
Operating System: linux/windows
PHP Version: 7.4.1
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c47b18a222ceb1d78810d2822170cbf6e110a98c
Log: Fix #79033: Curl timeout error with specific url and post
Previous Comments:
------------------------------------------------------------------------
[2019-12-27 21:58:13] cmb@php.net
This regression has been introduced with commit a83b68b[1].
[1] <http://git.php.net/?p=php-src.git;a=commit;h=a83b68ba56714bfa06737a61af795460caa4a105>
------------------------------------------------------------------------
[2019-12-26 01:07:15] dav dot tur19 at gmail dot com
Description:
------------
If an empty array is set to CURLOPT_POSTFIELDS, the request will timeout, this does not happen on
php7.3 or with CURLOPT_POSTFIELDS with other values.
The problem occurs on both windows and linux.
Test script:
---------------
<?php
$token = '12341234:WASDWASD';
$method = 'getMe';
$args = [];
$curlRequestSession = curl_init();
curl_setopt_array($curlRequestSession, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_TIMEOUT => 3,
CURLOPT_URL => 'https://api.telegram.org/bot' . $token .
'/' . $method,
CURLOPT_POSTFIELDS => $args,
]);
$response = curl_exec($curlRequestSession);
if($response === false) {
echo curl_error($curlRequestSession) . PHP_EOL . var_export(curl_getinfo($curlRequestSession),
true) . PHP_EOL;
} else {
echo 'Success: ' . $response . PHP_EOL;
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79033&edit=1