Swoole v4.6.4 版本发布,Bug 修复版本

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

内容简介:v4.6.4 版本主要是一个 Bug 修复版本,没有向下不兼容改动。 新增了 Swoole\Coroutine\Http\get 、Swoole\Coroutine\Http\post 和 Swoole\Coroutine\Http\request 函数,这个操作为了方便 Coroutine\Http\Client ...

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

新增了 Swoole\Coroutine\Http\get 、Swoole\Coroutine\Http\post 和 Swoole\Coroutine\Http\request 函数,这个操作为了方便 Coroutine\Http\Client 的使用

use function Swoole\Coroutine\go;
use function Swoole\Coroutine\run;
use function Swoole\Coroutine\Http\get;
use function Swoole\Coroutine\Http\post;
use function Swoole\Coroutine\Http\request;

run(function () {
    go(function () {
        $data = get('http://httpbin.org/get?hello=world');
        $body = json_decode($data->getBody());
        assert($body->headers->Host === 'httpbin.org');
        assert($body->args->hello === 'world');
    });
    go(function () {
        $random_data = base64_encode(random_bytes(128));
        $data = post('http://httpbin.org/post?hello=world', ['random_data' => $random_data]);
        $body = json_decode($data->getBody());
        assert($body->headers->Host === 'httpbin.org');
        assert($body->args->hello === 'world');
        assert($body->form->random_data === $random_data);
    });
});

更新日志

下面是完整的更新日志:

新增 API

  • 新增 Coroutine\Http::request, Coroutine\Http::post, Coroutine\Http::get 函数 (swoole/library#97) (@matyhtf)

增强

  • 支持 ARM 64 构建 (#4057) (@devnexen)
  • 支持在 Swoole TCP 服务器中设置 open_http_protocol (#4063) (@matyhtf)
  • 支持 ssl 客户端只设置 certificate (91704ac) (@matyhtf)
  • 支持 FreeBSD 的 tcp_defer_accept 选项 (#4049) (@devnexen)

修复

  • 修复使用 Coroutine\Http\Client 时缺少代理授权的问题 (edc0552) (@matyhtf)
  • 修复 Swoole\Table 的内存分配问题 (3e7770f) (@matyhtf)
  • 修复 Coroutine\Http2\Client 并发连接时的 crash (630536d) (@matyhtf)
  • 修复 DTLS 的 enable_ssl_encrypt 问题 (842733b) (@matyhtf)
  • 修复 Coroutine\Barrier 内存泄漏(swoole/library#94) (@Appla) (@FMiS)
  • 修复由 CURLOPT_PORT 和 CURLOPT_URL 顺序引起的偏移错误 (swoole/library#96) (@sy-records)
  • 修复Table::get($key, $field)当字段类型为 float 时的错误 (08ea20c) (@matyhtf)
  • 修复 Swoole\Table 内存泄漏 (d78ca8c) (@matyhtf)

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

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

Handbook of Data Structures and Applications

Handbook of Data Structures and Applications

Dinesh P. Mehta / Chapman and Hall/CRC / 2004-10-28 / USD 135.95

In the late sixties, Donald Knuth, winner of the 1974Turing Award, published his landmark book The Art of Computer Programming: Fundamental Algorithms. This book brought to- gether a body of kno......一起来看看 《Handbook of Data Structures and Applications》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

html转js在线工具
html转js在线工具

html转js在线工具

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

HEX CMYK 互转工具