Swoole v4.5.7 版本发布,新增 --enable-swoole-json 编译选项

Swoole 正在参与 2020 年度 OSC 中国开源项目评选,评选已经来到了最后一周,还有没给 Swoole 投票的小伙伴请点击下方链接投出您的一篇: https://www.oschina.net/p/swoole-server

在上个版本中添加的 swoole_substr_json_decode 函数,由于少部分用户的扩展依赖顺序问题,所以添加了一个编译选项--enable-swoole-json,用于启用 swoole_substr_json_decode 支持

在此版本如果需要使用此函数,需要在编译时加上此选项。同时此版本还支持了负偏移量

$val = json_encode(['hello' => 'swoole']);
$str = pack('N', strlen($val)) . $val . "\r\n";
$l = strlen($str) - 6;
var_dump(json_decode(substr($str, 4, $l), true));
var_dump(swoole_substr_json_decode($str, 4, $l, true));
var_dump(swoole_substr_json_decode($str, -(strlen($str)-4), $l, true));

更新内容如下:

新增 API

  • Coroutine\Socket 客户端新增 writeVector, writeVectorAll, readVector, readVectorAll 方法 (#3764) (@huanghantao)

增强

  • 为 server->stats 增加 task_worker_num 和 dispatch_count (#3771) (#3806) (@sy-records) (@matyhtf)
  • 添加了扩展依赖项,包括 json, mysqlnd, sockets (#3789) (@remicollet)
  • 限制 server->bind 的 uid 最小值为 INT32_MIN (#3785) (@sy-records)
  • 为 swoole_substr_json_decode 添加了编译选项,支持负偏移量(#3809) (@matyhtf)
  • 支持 CURL 的 CURLOPT_TCP_NODELAY 选项 (swoole/library#65) (@sy-records) (@deminy)

修复

  • 修复同步客户端连接信息错误 (#3784) (@twose)
  • 修复 hook scandir 函数的问题 (#3793) (@twose)
  • 修复协程屏障 barrier 中的错误 (swoole/library#68) (@sy-records)

内核

  • 使用 boost.stacktrace 优化 print-backtrace (#3788) (@matyhtf)

猜你喜欢

转载自www.oschina.net/news/120120/swoole-4-5-7-released