Swoole v4.6.3 版本发布,祝大家 2021 春节快乐

栏目: 软件资讯 · 发布时间: 5年前

内容简介:牛年春节在即,Swoole 也迎来了 2020年(农历)的最后一个版本。 在此感谢为 Swoole 的代码、文档以及生态方面做出贡献的小伙伴,也期待有更多的小伙伴加入\~ 祝大家 2021 牛年春节快乐,Bug 全走开。 v4.6.3 版本...

牛年春节在即,Swoole 也迎来了 2020年(农历)的最后一个版本。

在此感谢为 Swoole 的代码、文档以及生态方面做出贡献的小伙伴,也期待有更多的小伙伴加入\~

祝大家 2021 牛年春节快乐,Bug 全走开。

v4.6.3 版本主要是一个 Bug 修复版本,没有向下不兼容改动。

  • 新增了 Swoole\Coroutine\go 和 Swoole\Coroutine\defer 函数,这个操作主要防止用户手动关闭了短名,去复制粘贴运行示例代码时会报错的问题
use function Swoole\Coroutine\go;
use function Swoole\Coroutine\run;
use function Swoole\Coroutine\defer;

run(function () {
    defer(function () {
        echo "co1 end\n";
    });
    sleep(1);
    go(function () {
        usleep(100000);
        defer(function () {
            echo "co2 end\n";
        });
        echo "co2\n";
    });
    echo "co1\n";
});
  • 如果用户知道 Content-Length 的长度,在此版本中也允许用户自行设置 Content-Length 的 HTTP 头。
    用户设置的 Content-Length HTTP 头会覆盖底层计算的 Content-Length
use Swoole\Http\Server;
use Swoole\Http\Request;
use Swoole\Http\Response;

$http = new Server('0.0.0.0', 9501);

$http->on('Request', function (Request $request, Response $response) {
    $msg = 'Hello, Swoole';
    $response->header('Content-Length', strlen($msg));
    $response->end($msg);
});

$http->start();

更新日志

下面是完整的更新日志:

新增 API

  • 新增 Swoole\Coroutine\go 函数 (swoole/library@82f63be) (@matyhtf)
  • 新增 Swoole\Coroutine\defer 函数 (swoole/library@92fd0de) (@matyhtf)

增强

  • 为 HTTP 服务器添加 compression\_min\_length 选项 (#4033) (@matyhtf)
  • 允许在应用层设置 Content-Length HTTP 头 (#4041) (@doubaokun)

修复

  • 修复程序达到文件打开限制时的 coredump (swoole/swoole-src@709813f) (@matyhtf)
  • 修复 JIT 被禁用问题 (#4029) (@twose)
  • 修复 Response::create() 参数错误问题 (swoole/swoole-src@a630b5b) (@matyhtf)
  • 修复 ARM 平台下投递 task 时 task\_worker\_id 误报 (#4040) (@doubaokun)
  • 修复 PHP 8 开启 native curl hook 时的 coredump (#4042)(#4045) (@Yurunsoft) (@matyhtf)
  • 修复 fatal error 时 shutdown 阶段的内存越界错误 (#4050) (@matyhtf)

内核

  • 优化 ssl\_connect/ssl\_shutdown (#4030) (@matyhtf)
  • 发生 fatal error 时直接退出进程 (#4053) (@matyhtf)

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Sass and Compass in Action

Sass and Compass in Action

Wynn Netherland、Nathan Weizenbaum、Chris Eppstein、Brandon Mathis / Manning Publications / 2013-8-2 / USD 44.99

Written by Sass and Compass creators * Complete Sass language reference * Covers prominent Compass community plug-ins * Innovative approach to creating stylesheets Cascading Style Sheets paint the we......一起来看看 《Sass and Compass in Action》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具