Closed sxin0 closed 1 year ago
这个已经在4.8以上的版本修复了https://github.com/swoole/swoole-src/pull/4835
openssl版本号小于1.1.0h的版本,只存在bio_info_cb这个结构体,不存在BIO_info_cb这个结构体,所以在编译的时候会报错
替换成这样就可以编译成功。
#if OPENSSL_VERSION_NUMBER > 0x1010007fL
BIO_meth_set_callback_ctrl(_bio_methods, (long (*)(BIO *, int, BIO_info_cb *)) BIO_callback_ctrl);
#else
BIO_meth_set_callback_ctrl(_bio_methods, (long (*)(BIO *, int, bio_info_cb *)) BIO_callback_ctrl);
#endif
Please answer these questions before submitting your issue.
What did you do? If possible, provide a simple script for reproducing the error.
What did you expect to see?
What did you see instead?
What version of Swoole are you using (show your
php --ri swoole
)?Swoole => enabled Author => Swoole Team team@swoole.com Version => 4.5.11 Built => Jul 28 2023 18:07:09 coroutine => enabled epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled openssl => OpenSSL 1.1.0d 26 Jan 2017 http2 => enabled pcre => enabled zlib => 1.2.7 mutex_timedlock => enabled pthread_barrier => enabled futex => 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 => Off => Off swoole.unixsock_buffer_size => 8388608 => 8388608
怎么修复它?
BIO_meth_set_callback_ctrl
函数调用中,long
关键字前出现了一个语法问题long
关键字之后缺少一个)
BIO_meth_set_callback_ctrl
的定义,如果参数的类型与BIO_callback_ctrl
函数的参数类型匹配,可以尝试去掉类型转换,直接写成:BIO_meth_set_callback_ctrl(_bio_methods, BIO_callback_ctrl);