Skip to content

Commit

Permalink
Update version for Swoole 4.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
twose committed May 11, 2020
1 parent f479a47 commit 3074d50
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 93 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJECT(libswoole)

ENABLE_LANGUAGE(ASM)
SET(SWOOLE_VERSION 4.5.1-alpha)
SET(SWOOLE_VERSION 4.5.1)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -g")
Expand Down
4 changes: 2 additions & 2 deletions include/swoole_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#define SWOOLE_MAJOR_VERSION 4
#define SWOOLE_MINOR_VERSION 5
#define SWOOLE_RELEASE_VERSION 1
#define SWOOLE_EXTRA_VERSION "alpha"
#define SWOOLE_VERSION "4.5.1-alpha"
#define SWOOLE_EXTRA_VERSION ""
#define SWOOLE_VERSION "4.5.1"
#define SWOOLE_VERSION_ID 40501
#define SWOOLE_API_VERSION_ID 0x202003a

Expand Down
88 changes: 29 additions & 59 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
<email>[email protected]</email>
<active>yes</active>
</developer>
<date>2020-04-26</date>
<date>2020-05-11</date>
<time>14:00:00</time>
<version>
<release>4.5.0</release>
<release>4.5.1</release>
<api>4.0</api>
</version>
<stability>
Expand All @@ -54,68 +54,34 @@
</stability>
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache2.0</license>
<notes>
New APIs
---
+ DTLS supports, we can build WebRTC applications now (#3188) (@matyhtf)
+ Built-in `FastCGI` client, we can proxy HTTP request to FPM with one line of code now (swoole/library#17) (@twose)
+ `Co::wait`, `Co::waitPid`, `Co::waitSignal` (#3158) (@twose)
+ `Co::waitEvent` (#3197) (@twose)
+ `Co::set(['exit_condition' => $callable])` to exit condition of reactor (#2918) (#3012) (@twose)
+ `Co::getElapsed` to get the coroutine elapsed time (#3162) (@doubaokun)
+ `Socket::checkLiveness`, `Socket::peek` (#3057) (@twose)
+ `Socket->setProtocol(['open_fastcgi_protocol' => $bool])` (#3103) (@twose)
+ `Server::getInstance`, `Server::get(Master|Manager|Worker)Pid`, `Server::getWorkerId` (#2793) (#3019) (@matyhtf)
+ `Server::getWorkerStatus` (SWOOLE_WORKER_BUSY, SWOOLE_WORKER_IDLE) (#3225) (@matyhtf)
+ `Server->on('beforeReload', $callable)` and `Server->on('afterReload', $callable)` (Server reload event on manager process) (#3130) (@huanghantao)
+ `Http\Server` support `http_index_files` and `http_autoindex` with static handler (#3171) (@huanghantao)
+ `Http2\Client->read(float $timeout = -1)`, support Coroutine\HTTP2\Client read more than once (#3011) (#3117) (@twose)
+ `Http\Request->getContent` (alias of rawContent) (#3128) (@huanghantao)
+ `swoole_mime_type_(add|set|delete|get|exists)` (mime APIs) (#3134) (@twose)

Enhancement
---
+ Optimize memory-copy between master and worker (4x faster) (#3075) (#3087) (@huanghantao)
+ Optimize websocket dispatch (1x faster) (#3076) (@matyhtf)
+ Optimize memory-copy in websocket_construct_frame (1x faster) (#3097) (@matyhtf)
+ Optimize SSL validation (#3226) (@matyhtf)
+ Separate SSL accept and SSL handshake (#3214) (@twose)
+ Support MIPS (#3196) (@ekongyun)
+ Resolve the domain name when use udp coroutine client (#3236) (#3239) (@huanghantao)
+ Do not close stdout and stderr (show error logs after shutdown) (#3249) (@twose)
+ Support some common options for Coroutine\Http\Server (#3257) (@twose)
+ Support set cookies when websocket handshake (#3270) (#3272) (@twose)
+ Support CURLOPT_FAILONERROR (swoole/library#20) (@sy-records)
+ Support CURLOPT_FAILONERROR (swoole/library#20) (@sy-records)
+ Support CURLOPT_SSLCERTTYPE, CURLOPT_SSLCERT, CURLOPT_SSLKEYTYPE, CURLOPT_SSLKEY (swoole/library#22) (@sy-records)
+ Support CURLOPT_HTTPGET (swoole/library@d730bd08) (@shiguangqi)
+ Compatible with different versions of Redis extension as much as possible (swoole/library#24) (@twose)
+ Disable Cloning of Database Proxy Objects (swoole/library#23) (@deminy)
+ Support socket context bindto in hook (#3275) (#3278) (@codinghuang)
+ Support dns resolve in client::sendto (#3292) (@codinghuang)
+ Process->exit(0) will call os.exit directly (a732fe56) (@matyhtf)
+ Support `log_date_format` to change format of log date, `log_date_with_microseconds` to show micro-time in log (baf895bc) (@matyhtf)
+ Support CURLOPT_CAINFO and CURLOPT_CAPATH (swoole/library#32) (@sy-records)
+ Support CURLOPT_FORBID_REUSE (swoole/library#33) (@sy-records)

Remove
Fixed
---
- Remove `Runtime::enableStrictMode` method (b45838e3) (@twose)
- Remove `Buffer` class (559a49a8) (@twose)
* Fixed 32-bit build (#3276) (#3277) (@remicollet) (@twose)
* Fixed missing error info (#3280) (@codinghuang)
* Fixed potential bugs in Table (d7b87b65) (@matyhtf)
* Fixed null ptr error in Server (defensive programming) (#3304) (#3305) (@twose)
* Fixed heartbeat timeout null ptr error (#3307) (@twose)
* Fixed mysqli options error (swoole/library#35)
* Fixed response header parsing when there is no space after the colon in the response header (swoole/library#27) (@Yurunsoft)

Kernel
Deprecated
---
* New C++ API: `coroutine::async` with lambda (#3127) (@matyhtf)
* Refactor event API and reactor fd to swSocket (#3030) (@matyhtf)
* Convert all source files to C++ (#3030) (71f987f3) (@matyhtf)
* Code optimizations (#3063) (#3067) (#3115) (#3135) (#3138) (#3139) (#3151) (#3168) (@huanghantao)
* Code optimization for header files (#3051) (@matyhtf)
* Refactor `enable_reuse_port` option (#3192) (@matyhtf)
* Reactor Socket API (#3193) (@matyhtf)
* Reduce one system call (3b5aa85d) (@matyhtf)
* Remove swServerGS::now (#3152) (@huanghantao)
* Improve protocol setter (#3108) (@twose)
* Use the Better way to init C object on stack (#3069) (@twose)
* Use type `uchar` for bit field (#3071) (@twose)
* Support parallel test (#3215) (@twose)
- Mark Coroutine\System::(fread/fgets/fwrite) as deprecated, please use runtime hook instead (it should have been included in v4.5.0) (c7c9bb40) (@twose)

Fixed
Kernel
---
* Fixed `enable_delay_receive` (#3221) (#3224) (@matyhtf)
* All other bug fix patches have already been merged into the v4.4.x branch, we will not reiterate them here
+ Use zend_object_alloc (cf1afb25) (@twose)
+ Add more options for log (#3296) (@matyhtf)
+ Improve code and add more tests (swoole/library) (@deminy)
</notes>
<contents>
<dir name="/">
Expand All @@ -129,15 +95,16 @@
<file role="src" name="code_stats.sh" />
<file role="src" name="config.m4" />
<file role="src" name="core-tests/CMakeLists.txt" />
<file role="src" name="core-tests/include/process.h" />
<file role="src" name="core-tests/include/test_coroutine.h" />
<file role="src" name="core-tests/include/test_process.h" />
<file role="src" name="core-tests/include/test_server.h" />
<file role="src" name="core-tests/include/tests.h" />
<file role="src" name="core-tests/include/wrapper/coroutine.h" />
<file role="src" name="core-tests/include/wrapper/server.h" />
<file role="src" name="core-tests/run.sh" />
<file role="src" name="core-tests/samples/CMakeLists.txt" />
<file role="doc" name="core-tests/samples/README.md" />
<file role="src" name="core-tests/samples/s1.cc" />
<file role="src" name="core-tests/src/client/client.cpp" />
<file role="src" name="core-tests/src/core/log.cpp" />
<file role="src" name="core-tests/src/coroutine/async.cpp" />
<file role="src" name="core-tests/src/coroutine/base.cpp" />
<file role="src" name="core-tests/src/coroutine/channel.cpp" />
Expand Down Expand Up @@ -826,6 +793,7 @@
<file role="test" name="tests/swoole_client_coro/length_protocol_func.phpt" />
<file role="test" name="tests/swoole_client_coro/length_types.phpt" />
<file role="test" name="tests/swoole_client_coro/read_and_write.phpt" />
<file role="test" name="tests/swoole_client_coro/reconnect.phpt" />
<file role="test" name="tests/swoole_client_coro/recv_after_close.phpt" />
<file role="test" name="tests/swoole_client_coro/recv_timeout.phpt" />
<file role="test" name="tests/swoole_client_coro/recv_timeout2.phpt" />
Expand Down Expand Up @@ -863,6 +831,7 @@
<file role="test" name="tests/swoole_client_sync/select_null.phpt" />
<file role="test" name="tests/swoole_client_sync/send_recv.phpt" />
<file role="test" name="tests/swoole_client_sync/sendfile.phpt" />
<file role="test" name="tests/swoole_client_sync/sendto.phpt" />
<file role="test" name="tests/swoole_client_sync/ssl_recv_timeout.phpt" />
<file role="test" name="tests/swoole_client_sync/sync_send_recv.phpt" />
<file role="test" name="tests/swoole_client_sync/udg_send_timeout.phpt" />
Expand Down Expand Up @@ -1398,6 +1367,7 @@
<file role="test" name="tests/swoole_runtime/accept.phpt" />
<file role="test" name="tests/swoole_runtime/accept_timeout.phpt" />
<file role="test" name="tests/swoole_runtime/base.phpt" />
<file role="test" name="tests/swoole_runtime/bindto.phpt" />
<file role="test" name="tests/swoole_runtime/block.phpt" />
<file role="test" name="tests/swoole_runtime/destruct.phpt" />
<file role="test" name="tests/swoole_runtime/enable_crypto.phpt" />
Expand Down
88 changes: 58 additions & 30 deletions php_swoole_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Generated by build-library.php, Please DO NOT modify!
*/

/* $Id: 1e586057e634264f664f7e261eab2dc68f462cf9 */
/* $Id: 023b832113193732b3e6d57a78489a0ab71cce87 */

static const char* swoole_library_source_constants =
"\n"
Expand Down Expand Up @@ -119,30 +119,40 @@ static const char* swoole_library_source_core_constant =
" public const EVENT_ERROR = 'error';\n"
"\n"
" /* {{{ OPTION */\n"
" public const OPTION_ENABLE_SIGNALFD = 'enable_signalfd';\n"
" public const OPTION_DEBUG_MODE = 'debug_mode';\n"
"\n"
" public const OPTION_DNS_CACHE_REFRESH_TIME = 'dns_cache_refresh_time';\n"
" public const OPTION_TRACE_FLAGS = 'trace_flags';\n"
"\n"
" public const OPTION_SOCKET_BUFFER_SIZE = 'socket_buffer_size';\n"
" public const OPTION_LOG_FILE = 'log_file';\n"
"\n"
" public const OPTION_LOG_LEVEL = 'log_level';\n"
"\n"
" public const OPTION_LOG_DATE_FORMAT = 'log_date_format';\n"
"\n"
" public const OPTION_LOG_DATE_WITH_MICROSECONDS = 'log_date_with_microseconds';\n"
"\n"
" public const OPTION_DISPLAY_ERRORS = 'display_errors';\n"
"\n"
" public const OPTION_DNS_SERVER = 'dns_server';\n"
"\n"
" public const OPTION_SOCKET_SEND_TIMEOUT = 'socket_send_timeout';\n"
"\n"
" public const OPTION_LOG_LEVEL = 'log_level';\n"
" public const OPTION_ENABLE_SIGNALFD = 'enable_signalfd';\n"
"\n"
" public const OPTION_DNS_CACHE_REFRESH_TIME = 'dns_cache_refresh_time';\n"
"\n"
" public const OPTION_SOCKET_BUFFER_SIZE = 'socket_buffer_size';\n"
"\n"
" public const OPTION_THREAD_NUM = 'thread_num';\n"
"\n"
" public const OPTION_MIN_THREAD_NUM = 'min_thread_num';\n"
"\n"
" public const OPTION_MAX_THREAD_NUM = 'max_thread_num';\n"
"\n"
" public const OPTION_DISPLAY_ERRORS = 'display_errors';\n"
"\n"
" public const OPTION_SOCKET_DONTWAIT = 'socket_dontwait';\n"
"\n"
" public const OPTION_DNS_LOOKUP_RANDOM = 'dns_lookup_random';\n"
"\n"
" public const OPTION_DNS_SERVER = 'dns_server';\n"
"\n"
" public const OPTION_USE_ASYNC_RESOLVER = 'use_async_resolver';\n"
"\n"
" public const OPTION_ENABLE_COROUTINE = 'enable_coroutine';\n"
Expand Down Expand Up @@ -249,8 +259,6 @@ static const char* swoole_library_source_core_constant =
"\n"
" public const OPTION_SOCKET_WRITE_TIMEOUT = 'socket_write_timeout';\n"
"\n"
" public const OPTION_TRACE_FLAGS = 'trace_flags';\n"
"\n"
" public const OPTION_DNS_CACHE_EXPIRE = 'dns_cache_expire';\n"
"\n"
" public const OPTION_DNS_CACHE_CAPACITY = 'dns_cache_capacity';\n"
Expand Down Expand Up @@ -315,8 +323,6 @@ static const char* swoole_library_source_core_constant =
"\n"
" public const OPTION_DAEMONIZE = 'daemonize';\n"
"\n"
" public const OPTION_DEBUG_MODE = 'debug_mode';\n"
"\n"
" public const OPTION_PID_FILE = 'pid_file';\n"
"\n"
" public const OPTION_REACTOR_NUM = 'reactor_num';\n"
Expand All @@ -339,8 +345,6 @@ static const char* swoole_library_source_core_constant =
"\n"
" public const OPTION_DISPATCH_FUNC = 'dispatch_func';\n"
"\n"
" public const OPTION_LOG_FILE = 'log_file';\n"
"\n"
" public const OPTION_DISCARD_TIMEOUT_REQUEST = 'discard_timeout_request';\n"
"\n"
" public const OPTION_ENABLE_UNSAFE_EVENT = 'enable_unsafe_event';\n"
Expand Down Expand Up @@ -1981,7 +1985,11 @@ static const char* swoole_library_source_core_database_mysqli_pool =
" {\n"
" $this->config = $config;\n"
" parent::__construct(function () {\n"
" $mysqli = new mysqli(\n"
" $mysqli = new mysqli();\n"
" foreach ($this->config->getOptions() as $option => $value) {\n"
" $mysqli->set_opt($option, $value);\n"
" }\n"
" $mysqli->real_connect(\n"
" $this->config->getHost(),\n"
" $this->config->getUsername(),\n"
" $this->config->getPassword(),\n"
Expand All @@ -1992,9 +2000,6 @@ static const char* swoole_library_source_core_database_mysqli_pool =
" if ($mysqli->connect_errno) {\n"
" throw new MysqliException($mysqli->connect_errno, $mysqli->connect_errno);\n"
" }\n"
" foreach ($this->config->getOptions() as $option => $value) {\n"
" $mysqli->set_opt($option, $value);\n"
" }\n"
" return $mysqli;\n"
" }, $size, MysqliProxy::class);\n"
" }\n"
Expand Down Expand Up @@ -3156,6 +3161,7 @@ static const char* swoole_library_source_core_curl_handler =
"use CURLFile;\n"
"use ReflectionClass;\n"
"use Swoole;\n"
"use Swoole\\Constant;\n"
"use Swoole\\Coroutine\\Http\\Client;\n"
"use Swoole\\Curl\\Exception as CurlException;\n"
"use Swoole\\Http\\Status;\n"
Expand Down Expand Up @@ -3466,6 +3472,9 @@ static const char* swoole_library_source_core_curl_handler =
" case CURLOPT_PORT:\n"
" $this->setPort((int) $value);\n"
" break;\n"
" case CURLOPT_FORBID_REUSE:\n"
" $this->clientOptions[Constant::OPTION_KEEP_ALIVE] = !$value;\n"
" break;\n"
" case CURLOPT_RETURNTRANSFER:\n"
" $this->returnTransfer = $value;\n"
" $this->transfer = '';\n"
Expand Down Expand Up @@ -3553,13 +3562,19 @@ static const char* swoole_library_source_core_curl_handler =
" case CURLOPT_SSL_VERIFYHOST:\n"
" break;\n"
" case CURLOPT_SSL_VERIFYPEER:\n"
" $this->clientOptions['ssl_verify_peer'] = $value;\n"
" $this->clientOptions[Constant::OPTION_SSL_VERIFY_PEER] = $value;\n"
" break;\n"
" case CURLOPT_SSLCERT:\n"
" $this->clientOptions['ssl_cert_file'] = $value;\n"
" $this->clientOptions[Constant::OPTION_SSL_CERT_FILE] = $value;\n"
" break;\n"
" case CURLOPT_SSLKEY:\n"
" $this->clientOptions['ssl_key_file'] = $value;\n"
" $this->clientOptions[Constant::OPTION_SSL_KEY_FILE] = $value;\n"
" break;\n"
" case CURLOPT_CAINFO:\n"
" $this->clientOptions[Constant::OPTION_SSL_CAFILE] = $value;\n"
" break;\n"
" case CURLOPT_CAPATH:\n"
" $this->clientOptions[Constant::OPTION_SSL_CAPATH] = $value;\n"
" break;\n"
" /*\n"
" * Http POST\n"
Expand Down Expand Up @@ -3636,16 +3651,16 @@ static const char* swoole_library_source_core_curl_handler =
" $this->headers['Cookie'] = $value;\n"
" break;\n"
" case CURLOPT_CONNECTTIMEOUT:\n"
" $this->clientOptions['connect_timeout'] = $value;\n"
" $this->clientOptions[Constant::OPTION_CONNECT_TIMEOUT] = $value;\n"
" break;\n"
" case CURLOPT_CONNECTTIMEOUT_MS:\n"
" $this->clientOptions['connect_timeout'] = $value / 1000;\n"
" $this->clientOptions[Constant::OPTION_CONNECT_TIMEOUT] = $value / 1000;\n"
" break;\n"
" case CURLOPT_TIMEOUT:\n"
" $this->clientOptions['timeout'] = $value;\n"
" $this->clientOptions[Constant::OPTION_TIMEOUT] = $value;\n"
" break;\n"
" case CURLOPT_TIMEOUT_MS:\n"
" $this->clientOptions['timeout'] = $value / 1000;\n"
" $this->clientOptions[Constant::OPTION_TIMEOUT] = $value / 1000;\n"
" break;\n"
" case CURLOPT_FILE:\n"
" $this->outputStream = $value;\n"
Expand Down Expand Up @@ -5242,6 +5257,7 @@ static const char* swoole_library_source_core_fast_cgi_response =
"\n"
"namespace Swoole\\FastCGI;\n"
"\n"
"use InvalidArgumentException;\n"
"use Swoole\\FastCGI\\Record\\EndRequest;\n"
"use Swoole\\FastCGI\\Record\\Stderr;\n"
"use Swoole\\FastCGI\\Record\\Stdout;\n"
Expand Down Expand Up @@ -5741,12 +5757,24 @@ static const char* swoole_library_source_core_fast_cgi_http_response =
" if (strlen($body) === 0) {\n"
" return;\n"
" }\n"
" [$headers, $body] = @explode(\"\\r\\n\\r\\n\", $body, 2);\n"
" $headers = explode(\"\\r\\n\", $headers);\n"
" $array = explode(\"\\r\\n\\r\\n\", $body, 2); // An array that contains the HTTP headers and the body.\n"
" if (count($array) != 2) {\n"
" $this->withStatusCode(Status::BAD_GATEWAY)->withReasonPhrase('Invalid FastCGI Response')->withError($body);\n"
" return;\n"
" }\n"
" $headers = explode(\"\\r\\n\", $array[0]);\n"
" $body = $array[1];\n"
" foreach ($headers as $header) {\n"
" [$name, $value] = @explode(': ', $header, 2);\n"
" $array = explode(':', $header, 2); // An array that contains the name and the value of an HTTP header.\n"
" if (count($array) != 2) {\n"
" continue; // Invalid HTTP header? Ignore it!\n"
" }\n"
" $name = trim($array[0]);\n"
" $value = trim($array[1]);\n"
" if (strcasecmp($name, 'Status') === 0) {\n"
" [$statusCode, $reasonPhrase] = @explode(' ', $value, 2);\n"
" $array = explode(' ', $value, 2); // An array that contains the status code (and the reason phrase).\n"
" $statusCode = $array[0];\n"
" $reasonPhrase = $array[1] ?? null;\n"
" } elseif (strcasecmp($name, 'Set-Cookie') === 0) {\n"
" $this->withSetCookieHeaderLine($value);\n"
" } else {\n"
Expand Down
2 changes: 1 addition & 1 deletion tests/swoole_runtime/bindto.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ $pm->childFirst();
$pm->run();
?>
--EXPECT--
Done
Done

0 comments on commit 3074d50

Please sign in to comment.