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)