You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
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) ?
6bcd0d6d19c6:/home/bingcool/wwwroot/workerfy/tests#uname -a
Linux 6bcd0d6d19c6 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 Linux
PHP 7.3.19 (cli) (built: Jun 12 2020 12:27:37) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19, Copyright (c) 1999-2018, by Zend Technologies
[2]+ Done(127) $(...)
Please answer these questions before submitting your issue. Thanks!
include "../vendor/autoload.php";
$http = new swoole_http_server("0.0.0.0", 9509);
$http->set([
'reactor_num' => 2,
'worker_num' => 1,
'max_request' => 100000,
'task_tmpdir' => '/dev/shm',
'reload_async' => true,
'daemonize' => 0,
'enable_coroutine' => 1,
'hook_flags' => SWOOLE_HOOK_ALL | SWOOLE_HOOK_CURL
]);
$http->on('workerStart', function ($serv, $id) {
$client = new \GuzzleHttp\Client();
$url = 'http://www.baidu.com';
/**
* 开启了SWOOLE_HOOK_CURL后,使用\GuzzleHttp\Client->request(),直接就会在终端打印出返回的数据了,没有使用var_dump也会自动打印出来response.
* 不开启SWOOLE_HOOK_CURL则没有问题
*/
$res = $client->request('GET', $url);
});
$http->on('request', function ($request, Swoole\Http\Response $response) use ($http) {
if($request->server['path_info'] == '/favicon.ico' || $request->server['request_uri'] == '/favicon.ico') {
$response->end();
return;
}
});
$http->start();
不希望调用$res = $client->request('GET', $url);就在终端自动打印出返回的res.
不开启SWOOLE_HOOK_CURL则没有问题
What did you see instead?
现在程序没有调用var_dump, 但却自动打印出返回的res
What version of Swoole are you using (show your
php --ri swoole
)?swoole
Swoole => enabled
Author => Swoole Team [email protected]
Version => 4.5.5
Built => Oct 31 2020 19:36:01
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
spinlock => enabled
rwlock => enabled
pcre => enabled
zlib => 1.2.11
mutex_timedlock => enabled
pthread_barrier => enabled
async_redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608
uname -a
&php -v
&gcc -v
) ?6bcd0d6d19c6:/home/bingcool/wwwroot/workerfy/tests#uname -a
Linux 6bcd0d6d19c6 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 Linux
PHP 7.3.19 (cli) (built: Jun 12 2020 12:27:37) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19, Copyright (c) 1999-2018, by Zend Technologies
[2]+ Done(127) $(...)
6bcd0d6d19c6:/home/bingcool/wwwroot/workerfy/tests#gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/9.3.0/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-9.3.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 9.3.0' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-default-ssp --enable-cloog-backend --enable-languages=c,c++,d,objc,fortran,ada --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
gcc version 9.3.0 (Alpine 9.3.0)
The text was updated successfully, but these errors were encountered: