Skip to content

Commit

Permalink
Update version for Swoole 4.4.17
Browse files Browse the repository at this point in the history
  • Loading branch information
twose committed Apr 1, 2020
1 parent 6188cb9 commit 360e8b2
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 32 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.4.16)
SET(SWOOLE_VERSION 4.4.17)
SET(SWOOLE_CLFLAGS pthread rt dl ssl crypt crypto)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
Expand Down
6 changes: 3 additions & 3 deletions include/swoole.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ int clock_gettime(clock_id_t which_clock, struct timespec *t);

#define SWOOLE_MAJOR_VERSION 4
#define SWOOLE_MINOR_VERSION 4
#define SWOOLE_RELEASE_VERSION 16
#define SWOOLE_RELEASE_VERSION 17
#define SWOOLE_EXTRA_VERSION ""
#define SWOOLE_VERSION "4.4.16"
#define SWOOLE_VERSION_ID 40416
#define SWOOLE_VERSION "4.4.17"
#define SWOOLE_VERSION_ID 40417
#define SWOOLE_BUG_REPORT \
"A bug occurred in Swoole-v" SWOOLE_VERSION ", please report it.\n"\
"The Swoole developers probably don't know about it,\n"\
Expand Down
62 changes: 40 additions & 22 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-02-19</date>
<date>2020-04-01</date>
<time>12:00:00</time>
<version>
<release>4.4.16</release>
<release>4.4.17</release>
<api>4.0</api>
</version>
<stability>
Expand All @@ -56,25 +56,34 @@
<notes>
Enhancement
---
+ Now you can get [Supported Versions of Swoole](https://github.com/swoole/swoole-src/blob/master/SUPPORTED.md) (@twose)
+ More friendly error messages (0412f442) (09a48835) (@twose)
+ Prevent endless loops that may occur in some special systems (069a0092) (@matyhtf)
+ Add driver in PDOConfig (swoole/library#8) (@jcheron)
+ Improve SSL Server performance (#3077) (85a9a595) (@matyhtf)
+ Remove SW_HTTP_HEADER_VALUE_SIZE, SW_HTTP_HEADER_BUFFER_SIZE (#3187) limitation (@twose)
+ Support MIPS (#3196) (@ekongyun)
+ Support CURLOPT_HTTPAUTH (swoole/library@570318be) (@twose)

Fixed
---
* Fixed http2_session.default_ctx double free (bddbb9b1) (@twose)
* Fixed uninitialized http_context (ce77c641) (@twose)
* Fixed typo in Table (may lead to memory errors) (db4eec17) (@twose)
* Fixed status error when kill USR2 and no set task_num (e4378278) (@GXhua)
* Fixed incomplete raw-content of HTTP request (#3079) (#3085) (@hantaohuang)
* Fixed static handler (when the file content is empty, server should respond 404) (#3084) (@Yurunsoft)
* Fixed http_compression_level not work (16f9274e) (@twose)
* Fixed null pointer error of Coroutine HTTP2 Server caused by no handle (ed680989) (@twose)
* Fixed option socket_dontwait not work (27589376) (@matyhtf)
* Fixed double zend::eval (#3099) (@GXhua)
* Fixed HTTP2 Server null pointer error (respond after connection is closed) (#3110) (@twose)
* Fixed PDOStatementProxy::setFetchMode missing arguments (swoole/library#13) (@jcheron)
* Fixed behavior of package_length_func and memory leak (#3111) (@twose)
* Fixed HTTP 304 error (#3118) (#3120) (@twose)
* Fixed incorrect macro expansion (#3142) (@twose)
* Fixed OpenSSL function signature (#3154) (#3155) (@twose)
* Fixed SSL error msg (#3172) (@matyhtf) (@twose)
* Fixed PHP-7.4 compatibility (@twose) (@matyhtf)
* Fixed HTTP chunk length parser (19a1c712) (@twose)
* Fixed chunked multipart parser (3692d9de) (@twose)
* Fixed ZEND_ASSUME failed (fc0982be) (@twose)
* Fixed Socket address error (d72c5e3a) (@twose)
* Fixed Socket get name #3177 (#3179) (@matyhtf)
* Fixed static handler with empty file (#3182) (@twose)
* Fixed upload file handler on Coroutine\Http\Client (#3189) (#3191) (@twose)
* Fixed possible memory error on shutdown (44aef60a) (@matyhtf)
* Fixed Server->heartbeat (#3203) (@matyhtf)
* Fixed reactor defer task (only tasks of the current round will be called) (#3207) (@twose)
* Fixed invalid write on immutable array (#3212) (@twose)
* Fixed double wait, improve error message (swoole/library@537a82e1) (@twose)
* Fixed empty header (keep same with cURL) (swoole/library@7c92ed5a) (@twose)
* Fixed non-IO methods error handler (swoole/library@f6997394) (@twose)
* Fixed wrong proxy header (swoole/library@5e94e5da) (@twose)
</notes>
<contents>
<dir name="/">
Expand Down Expand Up @@ -173,6 +182,7 @@
<file role="doc" name="examples/coroutine/behavior/for.php" />
<file role="doc" name="examples/coroutine/behavior/foreach.php" />
<file role="doc" name="examples/coroutine/behavior/goto.php" />
<file role="doc" name="examples/coroutine/behavior/preemptive_timer.php" />
<file role="doc" name="examples/coroutine/behavior/tick.php" />
<file role="doc" name="examples/coroutine/behavior/while.php" />
<file role="doc" name="examples/coroutine/behavior/while2.php" />
Expand Down Expand Up @@ -791,6 +801,8 @@
<file role="test" name="tests/swoole_client_coro/eof_03.phpt" />
<file role="test" name="tests/swoole_client_coro/eof_04.phpt" />
<file role="test" name="tests/swoole_client_coro/fixed_package.phpt" />
<file role="test" name="tests/swoole_client_coro/getpeername.phpt" />
<file role="test" name="tests/swoole_client_coro/getsockname.phpt" />
<file role="test" name="tests/swoole_client_coro/isConnected.phpt" />
<file role="test" name="tests/swoole_client_coro/length_01.phpt" />
<file role="test" name="tests/swoole_client_coro/length_02.phpt" />
Expand Down Expand Up @@ -930,6 +942,7 @@
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/for2.phpt" />
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/goto.phpt" />
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/goto2.phpt" />
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/timer.phpt" />
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/while.phpt" />
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/while2.phpt" />
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/while3.phpt" />
Expand Down Expand Up @@ -1037,6 +1050,7 @@
<file role="test" name="tests/swoole_http_client_coro/auto_reconnect.phpt" />
<file role="test" name="tests/swoole_http_client_coro/buffer.phpt" />
<file role="test" name="tests/swoole_http_client_coro/bug_2661.phpt" />
<file role="test" name="tests/swoole_http_client_coro/bug_3118.phpt" />
<file role="test" name="tests/swoole_http_client_coro/compression_with_big_data.phpt" />
<file role="test" name="tests/swoole_http_client_coro/connect_timeout.phpt" />
<file role="test" name="tests/swoole_http_client_coro/construct_failed.phpt" />
Expand Down Expand Up @@ -1160,6 +1174,7 @@
<file role="test" name="tests/swoole_http_server_coro/rawContent_get_big_data.phpt" />
<file role="test" name="tests/swoole_http_server_coro/reuse_port.phpt" />
<file role="test" name="tests/swoole_http_server_coro/sendfile.phpt" />
<file role="test" name="tests/swoole_http_server_coro/ssl_bad_client.phpt" />
<file role="test" name="tests/swoole_http_server_coro/tcp_nodelay.phpt" />
<file role="test" name="tests/swoole_http_server_coro/upload.phpt" />
<file role="test" name="tests/swoole_http_server_coro/websocket.phpt" />
Expand Down Expand Up @@ -1498,10 +1513,11 @@
<file role="test" name="tests/swoole_server/sigint_with_base.phpt" />
<file role="test" name="tests/swoole_server/sigint_with_process.phpt" />
<file role="test" name="tests/swoole_server/slow_client.phpt" />
<file role="test" name="tests/swoole_server/ssl.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" />
<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/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" />
<file role="test" name="tests/swoole_server/stats.phpt" />
<file role="test" name="tests/swoole_server/stop.phpt" />
<file role="test" name="tests/swoole_server/task/base.phpt" />
Expand Down Expand Up @@ -1559,7 +1575,9 @@
<file role="test" name="tests/swoole_socket_coro/construct_parse_args_failed.phpt" />
<file role="test" name="tests/swoole_socket_coro/fd.phpt" />
<file role="test" name="tests/swoole_socket_coro/getopt/get.phpt" />
<file role="test" name="tests/swoole_socket_coro/getpeername.phpt" />
<file role="test" name="tests/swoole_socket_coro/getsockname.phpt" />
<file role="test" name="tests/swoole_socket_coro/protocol/package_length_func.phpt" />
<file role="test" name="tests/swoole_socket_coro/recvAll_timeout.phpt" />
<file role="test" name="tests/swoole_socket_coro/recv_timeout.phpt" />
<file role="test" name="tests/swoole_socket_coro/reuse.phpt" />
Expand Down
43 changes: 38 additions & 5 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: b5c9cede8c6150feba50d0e28d56de355fa69d16 */
/* $Id: 5e94e5da86146151014c7ab9069f3bb4d2d20177 */

static const char* swoole_library_source_constants =
"\n"
Expand Down Expand Up @@ -235,6 +235,8 @@ static const char* swoole_library_source_core_constant =
"\n"
" public const OPTION_HOOK_FLAGS = 'hook_flags';\n"
"\n"
" public const OPTION_ENABLE_PREEMPTIVE_SCHEDULER = 'enable_preemptive_scheduler';\n"
"\n"
" public const OPTION_C_STACK_SIZE = 'c_stack_size';\n"
"\n"
" public const OPTION_STACK_SIZE = 'stack_size';\n"
Expand Down Expand Up @@ -1430,7 +1432,7 @@ static const char* swoole_library_source_core_coroutine_wait_group =
" }\n"
" $count = $this->count + $delta;\n"
" if ($count < 0) {\n"
" throw new InvalidArgumentException('negative WaitGroup counter');\n"
" throw new InvalidArgumentException('WaitGroup misuse: negative counter');\n"
" }\n"
" $this->count = $count;\n"
" }\n"
Expand All @@ -1439,7 +1441,7 @@ static const char* swoole_library_source_core_coroutine_wait_group =
" {\n"
" $count = $this->count - 1;\n"
" if ($count < 0) {\n"
" throw new BadMethodCallException('negative WaitGroup counter');\n"
" throw new BadMethodCallException('WaitGroup misuse: negative counter');\n"
" }\n"
" $this->count = $count;\n"
" if ($count === 0 && $this->waiting) {\n"
Expand All @@ -1449,6 +1451,9 @@ static const char* swoole_library_source_core_coroutine_wait_group =
"\n"
" public function wait(float $timeout = -1): bool\n"
" {\n"
" if ($this->waiting) {\n"
" throw new BadMethodCallException('WaitGroup misuse: reused before previous wait has returned');\n"
" }\n"
" if ($this->count > 0) {\n"
" $this->waiting = true;\n"
" $done = $this->chan->pop($timeout);\n"
Expand Down Expand Up @@ -1996,8 +2001,13 @@ static const char* swoole_library_source_core_database_mysqli_proxy =
" public function __call(string $name, array $arguments)\n"
" {\n"
" for ($n = 3; $n--;) {\n"
" $this->__object->errno = 0;\n"
" $ret = @$this->__object->{$name}(...$arguments);\n"
" if ($ret === false) {\n"
" /* no error */\n"
" if ($this->__object->errno === 0) {\n"
" break;\n"
" }\n"
" /* no more chances or non-IO failures */\n"
" if (\n"
" !in_array($this->__object->errno, static::IO_ERRORS, true) ||\n"
Expand Down Expand Up @@ -2114,8 +2124,13 @@ static const char* swoole_library_source_core_database_mysqli_statement_proxy =
" public function __call(string $name, array $arguments)\n"
" {\n"
" for ($n = 3; $n--;) {\n"
" $this->__object->errno = 0;\n"
" $ret = @$this->__object->{$name}(...$arguments);\n"
" if ($ret === false) {\n"
" /* no error */\n"
" if ($this->__object->errno === 0) {\n"
" break;\n"
" }\n"
" /* no more chances or non-IO failures or in transaction */\n"
" if (\n"
" !in_array($this->__object->errno, $this->parent::IO_ERRORS, true) ||\n"
Expand Down Expand Up @@ -2408,6 +2423,7 @@ static const char* swoole_library_source_core_database_pdo_proxy =
"\n"
"class PDOProxy extends ObjectProxy\n"
"{\n"
" public const IO_METHOD_REGEX = '/^query|prepare|exec|beginTransaction|commit|rollback$/i';\n"
" public const IO_ERRORS = [\n"
" 2002, // MYSQLND_CR_CONNECTION_ERROR\n"
" 2006, // MYSQLND_CR_SERVER_GONE_ERROR\n"
Expand Down Expand Up @@ -2438,8 +2454,12 @@ static const char* swoole_library_source_core_database_pdo_proxy =
" for ($n = 3; $n--;) {\n"
" $ret = @$this->__object->{$name}(...$arguments);\n"
" if ($ret === false) {\n"
" /* no more chances or non-IO failures */\n"
" /* non-IO method */\n"
" if (!preg_match(static::IO_METHOD_REGEX, $name)) {\n"
" break;\n"
" }\n"
" $errorInfo = $this->__object->errorInfo();\n"
" /* no more chances or non-IO failures */\n"
" if (\n"
" !in_array($errorInfo[1], static::IO_ERRORS, true) ||\n"
" $n === 0 ||\n"
Expand Down Expand Up @@ -2551,6 +2571,10 @@ static const char* swoole_library_source_core_database_pdo_statement_proxy =
" for ($n = 3; $n--;) {\n"
" $ret = @$this->__object->{$name}(...$arguments);\n"
" if ($ret === false) {\n"
" /* no IO */\n"
" if (strtolower($name) !== 'execute') {\n"
" break;\n"
" }\n"
" /* no more chances or non-IO failures or in transaction */\n"
" if (\n"
" !in_array($this->__object->errorInfo()[1], $this->parent::IO_ERRORS, true) ||\n"
Expand Down Expand Up @@ -3502,6 +3526,9 @@ static const char* swoole_library_source_core_curl_handler =
" $header = explode(':', $header, 2);\n"
" $headerName = $header[0];\n"
" $headerValue = trim($header[1] ?? '');\n"
" if (strlen($headerValue) === 0) {\n"
" continue;\n"
" }\n"
" $this->headers[$headerName] = $headerValue;\n"
" }\n"
" break;\n"
Expand Down Expand Up @@ -3567,6 +3594,12 @@ static const char* swoole_library_source_core_curl_handler =
" case CURLOPT_PROGRESSFUNCTION:\n"
" $this->progressFunction = $value;\n"
" break;\n"
" case CURLOPT_HTTPAUTH:\n"
" if (!($value & CURLAUTH_BASIC)) {\n"
" trigger_error(\"swoole_curl_setopt(): CURLOPT_HTTPAUTH[{$value}] is not supported\", E_USER_WARNING);\n"
" return false;\n"
" }\n"
" break;\n"
" case CURLOPT_USERPWD:\n"
" $this->headers['Authorization'] = 'Basic ' . base64_encode($value);\n"
" break;\n"
Expand Down Expand Up @@ -3705,7 +3738,7 @@ static const char* swoole_library_source_core_curl_handler =
" /*\n"
" * Http Headers\n"
" */\n"
" $this->headers['Host'] = $this->urlInfo['host'] . (isset($this->urlInfo['port']) ? (':' . $this->urlInfo['port']) : ''); /* TODO: remove it (built-in support) */\n"
" $this->headers['Host'] = $this->urlInfo['host'];\n"
" // remove empty headers (keep same with raw cURL)\n"
" foreach ($this->headers as $headerName => $headerValue) {\n"
" if ($headerValue === '') {\n"
Expand Down
2 changes: 1 addition & 1 deletion tools/build-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
);
$file_change = (int) ($file_change[1] ?? 0);
if ($file_change > 0) {
swoole_error($file_change . ' file changed in [' . LIBRARY_DIR . ']');
swoole_warn($file_change . ' file changed in [' . LIBRARY_DIR . ']');
}
$commit_id = trim(shell_exec('cd ' . LIBRARY_DIR . ' && git rev-parse HEAD'));
if (!$commit_id || strlen($commit_id) != 40) {
Expand Down

0 comments on commit 360e8b2

Please sign in to comment.