I expect curl to reuse the connection in the second request.
What did you see instead?
I see that curl creates a new connection for each request.
The problem is only with SWOOLE_HOOK_NATIVE_CURL. When using SWOOLE_HOOK_CURL or curl without swoole, there is no problem.
I checked on Ubuntu 20.04, 22.04 and Debian 11, and on older versions of swoole.
What version of Swoole are you using (show your php --ri swoole)?
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 5.1.0-dev
Built => Jun 22 2023 01:44:22
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1n 15 Mar 2022
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
zlib => 1.2.11
brotli => E16777225/D16777225
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
async_redis => enabled
coroutine_pgsql => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_fiber_mock => Off => Off
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608
What is your machine environment used (show your uname -a & php -v & gcc -v) ?
Linux ip-172-31-22-1 5.10.0-23-cloud-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64 GNU/Linux
PHP 8.2.7 (cli) (built: Jun 9 2023 07:37:35) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies`
Hi, I need some help, please.
Please answer these questions before submitting your issue.
I expect curl to reuse the connection in the second request.
I see that curl creates a new connection for each request. The problem is only with SWOOLE_HOOK_NATIVE_CURL. When using SWOOLE_HOOK_CURL or curl without swoole, there is no problem. I checked on Ubuntu 20.04, 22.04 and Debian 11, and on older versions of swoole.
php --ri swoole
)?uname -a
&php -v
&gcc -v
) ?