Swoole v4.5.3 版本发布

时间:2022-07-24
本文章向大家介绍Swoole v4.5.3 版本发布,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

新增 API

  • 增加 SwooleProcessProcessManager (swoole/library#88f147b) (@huanghantao)
  • 增加 ArrayObject::append, StringObject::equals (swoole/library#f28556f) (@matyhtf)
  • 增加 Coroutine::parallel (swoole/library#6aa89a9) (@matyhtf)
  • 增加 CoroutineBarrier (swoole/library#2988b2a) (@matyhtf)

增强

  • 增加 usePipelineRead 来支持 http2 client streaming (#3354) (@twose)
  • http 客户端下载文件时,在接受数据前不创建文件 (#3381) (@twose)
  • http client 支持bind_addressbind_port配置 (#3390) (@huanghantao)
  • http client 支持lowercase_header配置 (#3399) (@matyhtf)
  • SwooleServer支持tcp_user_timeout配置 (#3404) (@huanghantao)
  • CoroutineSocket增加 event barrier 来减少协程切换 (#3409) (@matyhtf)
  • 为特定的 swString 增加memory allocator (#3418) (@matyhtf)
  • cURL 支持__toString (swoole/library#38) (@twose)
  • 支持直接在 WaitGroup 构造函数中设置wait count (swoole/library#2fb228b8) (@matyhtf)
  • 增加CURLOPT_REDIR_PROTOCOLS (swoole/library#46) (@sy-records)
  • http1.1 server 支持 trailer (#3485) (@huanghantao)
  • 协程 sleep 时间小于 1ms 将会 yield 当前协程 (#3487) (@Yurunsoft)
  • http static handler 支持软连接的文件 (#3569) (@LeiZhang-Hunter)
  • 在 Server 调用完 close 方法之后立刻关闭 WebSocket 连接 (#3570) (@matyhtf)
  • 支持 hook stream_set_blocking (#3585) (@Yurunsoft)
  • 异步 HTTP2 server 支持流控 (#3486) (@huanghantao) (@matyhtf)
  • 释放 socket buffer 在 onPackage 回调函数执行完 (#3551) (@huanghantao) (@matyhtf)

修复

  • 修复 WebSocket coredump, 处理协议错误的状态 (#3359) (@twose)
  • 修复 swSignalfd_setup 函数以及 wait_signal 函数里的空指针错误 (#3360) (@twose)
  • 修复在设置了 dispatch_func 时候,调用SwooleServer::close会报错的问题 (#3365) (@twose)
  • 修复SwooleRedisServer::format函数中 format_buffer 初始化问题 (#3369) (@matyhtf) (@twose)
  • 修复 MacOS 上无法获取 mac 地址的问题 (#3372) (@twose)
  • 修复 MySQL 测试用例 (#3374) (@qiqizjl)
  • 修复多处 PHP8 兼容性问题 (#3384) (#3458) (#3578) (#3598) (@twose)
  • 修复 hook 的 socket write 中丢失了 php_error_docref, timeout_event 和返回值问题 (#3383) (@twose)
  • 修复异步 Server 无法在WorkerStart回调函数中关闭 Server 的问题 (#3382) (@huanghantao)
  • 修复心跳线程在操作 conn->socket 的时候,可能会发生 coredump 的问题 (#3396) (@huanghantao)
  • 修复 send_yield 的逻辑问题 (#3397) (@twose) (@matyhtf)
  • 修复 Cygwin64 上的编译问题 (#3400) (@twose)
  • 修复 WebSocket finish 属性无效的问题 (#3410) (@matyhtf)
  • 修复遗漏的 MySQL transaction 错误状态 (#3429) (@twose)
  • 修复 hook 后的stream_select与 hook 之前返回值行为不一致的问题 (#3440) (@Yurunsoft)
  • 修复使用CoroutineSystem来创建子进程时丢失SIGCHLD信号的问题 (#3446) (@huanghantao)
  • 修复sendwait不支持 SSL 的问题 (#3459) (@huanghantao)
  • 修复ArrayObjectStringObject的若干问题 (swoole/library#44) (@matyhtf)
  • 修复 mysqli 打印错误消息时错别字的问题 (swoole/library#45) (@sy-records)
  • 修复当设置open_eof_check后,SwooleClient无法获取正确的errCode的问题 (#3478) (@huanghantao)
  • 修复 MacOS 上 atomic->wait()/wakeup()的若干问题 (#3476) (@Yurunsoft)
  • 修复Client::connect连接拒绝的时候,返回成功状态的问题 (#3484) (@matyhtf)
  • 修复 alpine 环境下 nullptr_t 没有被声明的问题 (#3488) (@limingxinleo)
  • 修复 HTTP Client 下载文件的时候,double-free 的问题 (#3489) (@Yurunsoft)
  • 修复Server被销毁时候,ServerPort没释放导致的内存泄漏问题 (#3507) (@twose)
  • 修复 MQTT 协议解析问题 (318e33a) (84d8214) (80327b3) (efe6c63) (@GXhua) (@sy-records)
  • 修复CoroutineHttpClient->getHeaderOut方法导致的 coredump 问题 (#3534) (@matyhtf)
  • 修复 SSL 验证失败后,丢失了错误信息的问题 (#3535) (@twose)
  • 修复 README 中,Swoole benchmark链接错误的问题 (#3536) (@sy-records) (@santalex)
  • 修复在HTTP header/cookie中使用CRLF后导致的header注入问题 (#3539) (#3541) (#3545) (chromium1337) (@huanghantao)
  • 修复 issue #3463 中提到的变量错误的问题 (#3547) (chromium1337) (@huanghantao)
  • 修复 pr #3463 中提到的错别字问题 (#3547) (@deminy)
  • 修复协程 WebSocket 服务器 frame->fd 为空的问题 (#3549) (@huanghantao)
  • 修复心跳线程错误判断连接状态导致的连接泄漏问题 (#3534) (@matyhtf)
  • 修复ProcessPool中阻塞了信号的问题 (#3582) (@huanghantao) (@matyhtf)
  • 修复SAPI中使用 send headers 的问题 (#3571) (@twose) (@sshymko)
  • 修复CURL执行失败的时候,设置了错误的codemessage的问题 (swoole/library#1b6c65e) (@sy-records)
  • 修复当调用了setProtocol方法后,swoole_socket_coroaccept coredump 的问题 (#3591) (@matyhtf)

内核

  • 使用 C++风格 (#3349) (#3351) (#3454) (#3479) (#3490) (@huanghantao) (@matyhtf)
  • 增加Swoole known strings来提高PHP对象读属性的性能 (#3363) (@huanghantao)
  • 多处代码优化 (#3350) (#3356) (#3357) (#3423) (#3426) (#3461) (#3463) (#3472) (#3557) (#3583) (@huanghantao) (@twose) (@matyhtf)
  • 多处测试代码的优化 (#3416) (#3481) (#3558) (@matyhtf)
  • 简化SwooleTableint类型 (#3407) (@matyhtf)
  • 增加sw_memset_zero,并且替换bzero函数 (#3419) (@CismonX)
  • 优化日志模块 (#3432) (@matyhtf)
  • 多处 libswoole 重构 (#3448) (#3473) (#3475) (#3492) (#3494) (#3497) (#3498) (#3526) (@matyhtf)
  • 多处头文件引入重构 (#3457) (@matyhtf) (@huanghantao)
  • 增加Channel::count()Channel::get_bytes() (f001581) (@matyhtf)
  • 增加scope guard (#3504) (@huanghantao)
  • 增加 libswoole 覆盖率测试 (#3431) (@huanghantao)
  • 增加 lib-swoole/ext-swoole MacOS 环境的测试 (#3521) (@huanghantao)
  • 增加 lib-swoole/ext-swoole Alpine 环境的测试 (#3537) (@limingxinleo)
素质三连biubiubiu~