Swoole is participating in the 2020 OSC China Open Source Project Selection. The selection has come to the last week. For those who have not voted for Swoole, please click the link below to vote for your article: https://www.oschina.net/p/ swoole-server
In the swoole_substr_json_decode function added in the previous version , due to a small number of users’ extended dependency order issues, a compilation option was added --enable-swoole-json
to enable swoole_substr_json_decode
support
If you need to use this function in this version, you need to add this option when compiling. At the same time this version also supports negative offset
$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));
The update content is as follows:
New API
- Coroutine\Socket client adds writeVector, writeVectorAll, readVector, readVectorAll methods (#3764) (@huanghantao)
Enhance
- Add task_worker_num and dispatch_count to server->stats (#3771) (#3806) (@sy-records) (@matyhtf)
- Added extended dependencies, including json, mysqlnd, sockets (#3789) (@remicollet)
- Restrict the minimum uid of server->bind to INT32_MIN (#3785) (@sy-records)
- Added a compilation option for swoole_substr_json_decode to support negative offset (#3809) (@matyhtf)
- Support CURLOPT_TCP_NODELAY option of CURL (swoole/library#65) (@sy-records) (@deminy)
repair
- Fix the synchronization client connection information error (#3784) (@twose)
- Fix the problem of hook scandir function (#3793) (@twose)
- Fix a bug in the barrier of the coroutine barrier (swoole/library#68) (@sy-records)
Kernel
- Use boost.stacktrace to optimize print-backtrace (#3788) (@matyhtf)