-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
97 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,10 +42,10 @@ | |
<email>[email protected]</email> | ||
<active>yes</active> | ||
</developer> | ||
<date>2020-04-25</date> | ||
<time>16:00:00</time> | ||
<date>2020-05-28</date> | ||
<time>15:00:00</time> | ||
<version> | ||
<release>4.4.18</release> | ||
<release>4.4.19</release> | ||
<api>4.0</api> | ||
</version> | ||
<stability> | ||
|
@@ -54,30 +54,11 @@ | |
</stability> | ||
<license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache2.0</license> | ||
<notes> | ||
Enhancement | ||
--- | ||
+ 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_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) | ||
Notice: v4.4.x is no longer the main maintenance branch, bug fixes only when necessary | ||
|
||
Fixed | ||
--- | ||
* Fixed SSL handshake failure (dc5ac29a) (@twose) | ||
* Fixed memory error when generate error message (#3229) (@twose) | ||
* Fixed empty proxy authorization info (#3243) (@twose) | ||
* Fixed channel unreal memory leak (#3260) (@twose) | ||
* Fixed memory leak of Co\Http\Server (#3271) (@twose) | ||
* Fixed `ConnectionPool->fill` (swoole/library#18) (@NHZEX) | ||
* Fixed use new client for the redirection requests (swoole/library#21) (@doubaokun) | ||
* Fixed null socket error in ioException (swoole/library@4d15a4c3) (@twose) | ||
* Fixed ConnectionPool@put when error happens (swoole/library#25) (@Sinute) | ||
* Fixed mysqli write_property error (swoole/library#26) (@twose) | ||
* Merged all the bugfix patches from v4.5.x | ||
</notes> | ||
<contents> | ||
<dir name="/"> | ||
|
@@ -720,6 +701,7 @@ | |
<file role="test" name="tests/include/lib/src/CurlManager.php" /> | ||
<file role="test" name="tests/include/lib/src/DbWrapper.php" /> | ||
<file role="test" name="tests/include/lib/src/LengthServer.php" /> | ||
<file role="test" name="tests/include/lib/src/MQTT/Helper.php" /> | ||
<file role="test" name="tests/include/lib/src/MysqlPool.php" /> | ||
<file role="test" name="tests/include/lib/src/ProcessManager.php" /> | ||
<file role="test" name="tests/include/lib/src/RandStr.php" /> | ||
|
@@ -806,6 +788,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" /> | ||
|
@@ -1019,6 +1002,7 @@ | |
<file role="test" name="tests/swoole_http2_client_coro/error.phpt" /> | ||
<file role="test" name="tests/swoole_http2_client_coro/goaway.phpt" /> | ||
<file role="test" name="tests/swoole_http2_client_coro/headers.phpt" /> | ||
<file role="test" name="tests/swoole_http2_client_coro/host.phpt" /> | ||
<file role="test" name="tests/swoole_http2_client_coro/huge_headers.phpt" /> | ||
<file role="test" name="tests/swoole_http2_client_coro/issues_2374.phpt" /> | ||
<file role="test" name="tests/swoole_http2_client_coro/multi.phpt" /> | ||
|
@@ -1363,6 +1347,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" /> | ||
|
@@ -1481,6 +1466,7 @@ | |
<file role="test" name="tests/swoole_server/max_request_grace_disabled.phpt" /> | ||
<file role="test" name="tests/swoole_server/max_request_grace_enabled.phpt" /> | ||
<file role="test" name="tests/swoole_server/max_request_threshold.phpt" /> | ||
<file role="test" name="tests/swoole_server/mqtt/length_offset.phpt" /> | ||
<file role="test" name="tests/swoole_server/pid_file.phpt" /> | ||
<file role="test" name="tests/swoole_server/protect.phpt" /> | ||
<file role="test" name="tests/swoole_server/protect_false.phpt" /> | ||
|
@@ -1510,6 +1496,7 @@ | |
<file role="test" name="tests/swoole_server/slow_client.phpt" /> | ||
<file role="test" name="tests/swoole_server/ssl/00.phpt" /> | ||
<file role="test" name="tests/swoole_server/ssl/bad_client.phpt" /> | ||
<file role="test" name="tests/swoole_server/ssl/golang.phpt" /> | ||
<file role="test" name="tests/swoole_server/ssl/verify_01.phpt" /> | ||
<file role="test" name="tests/swoole_server/ssl/verify_02.phpt" /> | ||
<file role="test" name="tests/swoole_server/ssl/verify_03.phpt" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* Generated by build-library.php, Please DO NOT modify! | ||
*/ | ||
|
||
/* $Id: 1e586057e634264f664f7e261eab2dc68f462cf9 */ | ||
/* $Id: ed192f6450e7ed1e5933a8808ecd829f41872bbd */ | ||
|
||
static const char* swoole_library_source_constants = | ||
"\n" | ||
|
@@ -1573,6 +1573,7 @@ static const char* swoole_library_source_core_coroutine_server = | |
"\n" | ||
" while ($this->running) {\n" | ||
" /** @var Socket $conn */\n" | ||
" $conn = null;\n" | ||
" $conn = $socket->accept();\n" | ||
" if ($conn) {\n" | ||
" $conn->setProtocol($this->setting);\n" | ||
|
@@ -1951,7 +1952,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" | ||
|
@@ -1962,9 +1967,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" | ||
|
@@ -3126,6 +3128,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" | ||
|
@@ -3436,6 +3439,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" | ||
|
@@ -3523,13 +3529,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" | ||
|
@@ -3606,16 +3618,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" | ||
|
@@ -3741,9 +3753,11 @@ static const char* swoole_library_source_core_curl_handler = | |
" $client->setMethod($this->method);\n" | ||
" }\n" | ||
" /*\n" | ||
" * Infile\n" | ||
" * Data\n" | ||
" */\n" | ||
" if ($this->infile) {\n" | ||
" // Infile\n" | ||
" // Notice: we make its priority higher than postData but raw cURL will send both of them\n" | ||
" $data = '';\n" | ||
" while (true) {\n" | ||
" $nLength = $this->infileSize - strlen($data);\n" | ||
|
@@ -3756,33 +3770,33 @@ static const char* swoole_library_source_core_curl_handler = | |
" $data .= fread($this->infile, $nLength);\n" | ||
" }\n" | ||
" $client->setData($data);\n" | ||
" // Notice: although we reset it, raw cURL never do this\n" | ||
" $this->infile = null;\n" | ||
" $this->infileSize = PHP_INT_MAX;\n" | ||
" }\n" | ||
" /*\n" | ||
" * Upload File\n" | ||
" */\n" | ||
" if ($this->postData and is_array($this->postData)) {\n" | ||
" foreach ($this->postData as $k => $v) {\n" | ||
" if ($v instanceof CURLFile) {\n" | ||
" $client->addFile($v->getFilename(), $k, $v->getMimeType() ?: 'application/octet-stream', $v->getPostFilename());\n" | ||
" unset($this->postData[$k]);\n" | ||
" } else {\n" | ||
" // POST data\n" | ||
" if ($this->postData) {\n" | ||
" if (is_string($this->postData)) {\n" | ||
" if (empty($this->headers['Content-Type'])) {\n" | ||
" $this->headers['Content-Type'] = 'application/x-www-form-urlencoded';\n" | ||
" }\n" | ||
" } elseif (is_array($this->postData)) {\n" | ||
" foreach ($this->postData as $k => $v) {\n" | ||
" if ($v instanceof CURLFile) {\n" | ||
" $client->addFile($v->getFilename(), $k, $v->getMimeType() ?: 'application/octet-stream', $v->getPostFilename());\n" | ||
" unset($this->postData[$k]);\n" | ||
" }\n" | ||
" }\n" | ||
" }\n" | ||
" }\n" | ||
" }\n" | ||
" /*\n" | ||
" * Post Data\n" | ||
" */\n" | ||
" if ($this->postData) {\n" | ||
" if (is_string($this->postData) and empty($this->headers['Content-Type'])) {\n" | ||
" $this->headers['Content-Type'] = 'application/x-www-form-urlencoded';\n" | ||
" }\n" | ||
" $client->setData($this->postData);\n" | ||
" $this->postData = [];\n" | ||
" }\n" | ||
" /*\n" | ||
" * Http Headers\n" | ||
" * Headers\n" | ||
" */\n" | ||
" // Notice: setHeaders must be placed last, because headers may be changed by other parts\n" | ||
" // As much as possible to ensure that Host is the first header.\n" | ||
" // See: http://tools.ietf.org/html/rfc7230#section-5.4\n" | ||
" $this->headers['Host'] = $this->urlInfo['host'];\n" | ||
" // remove empty headers (keep same with raw cURL)\n" | ||
" foreach ($this->headers as $headerName => $headerValue) {\n" | ||
|
@@ -3950,6 +3964,37 @@ static const char* swoole_library_source_core_curl_handler = | |
" }\n" | ||
"}\n"; | ||
|
||
static const char* swoole_library_source_core_coroutine_functions = | ||
"\n" | ||
"/**\n" | ||
" * This file is part of Swoole.\n" | ||
" *\n" | ||
" * @link https://www.swoole.com\n" | ||
" * @contact [email protected]\n" | ||
" * @license https://github.com/swoole/library/blob/master/LICENSE\n" | ||
" */\n" | ||
"\n" | ||
"declare(strict_types=1);\n" | ||
"\n" | ||
"namespace Swoole\\Coroutine;\n" | ||
"\n" | ||
"use Swoole\\Coroutine;\n" | ||
"\n" | ||
"function batch(array $tasks, float $timeout = -1): array\n" | ||
"{\n" | ||
" $wg = new WaitGroup();\n" | ||
" $wg->add(count($tasks));\n" | ||
" foreach ($tasks as $id => $task) {\n" | ||
" Coroutine::create(function () use ($wg, &$tasks, $id, $task) {\n" | ||
" $tasks[$id] = null;\n" | ||
" $tasks[$id] = $task();\n" | ||
" $wg->done();\n" | ||
" });\n" | ||
" }\n" | ||
" $wg->wait($timeout);\n" | ||
" return $tasks;\n" | ||
"}\n"; | ||
|
||
static const char* swoole_library_source_ext_curl = | ||
"\n" | ||
"/**\n" | ||
|
@@ -4173,6 +4218,7 @@ static void php_swoole_load_library() | |
zend::eval(swoole_library_source_core_http_status, "@swoole-src/library/core/Http/Status.php"); | ||
zend::eval(swoole_library_source_core_curl_exception, "@swoole-src/library/core/Curl/Exception.php"); | ||
zend::eval(swoole_library_source_core_curl_handler, "@swoole-src/library/core/Curl/Handler.php"); | ||
zend::eval(swoole_library_source_core_coroutine_functions, "@swoole-src/library/core/Coroutine/functions.php"); | ||
zend::eval(swoole_library_source_ext_curl, "@swoole-src/library/ext/curl.php"); | ||
zend::eval(swoole_library_source_functions, "@swoole-src/library/functions.php"); | ||
zend::eval(swoole_library_source_alias, "@swoole-src/library/alias.php"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,4 @@ $pm->childFirst(); | |
$pm->run(); | ||
?> | ||
--EXPECT-- | ||
Done | ||
Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,4 +43,4 @@ $pm->childFirst(); | |
$pm->run(); | ||
?> | ||
--EXPECT-- | ||
686 | ||
686 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.