Skip to content

Commit 360e8b2

Browse files
committed
Update version for Swoole 4.4.17
1 parent 6188cb9 commit 360e8b2

File tree

5 files changed

+83
-32
lines changed

5 files changed

+83
-32
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PROJECT(libswoole)
22

33
ENABLE_LANGUAGE(ASM)
4-
SET(SWOOLE_VERSION 4.4.16)
4+
SET(SWOOLE_VERSION 4.4.17)
55
SET(SWOOLE_CLFLAGS pthread rt dl ssl crypt crypto)
66
set(CMAKE_CXX_STANDARD 11)
77
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")

include/swoole.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ int clock_gettime(clock_id_t which_clock, struct timespec *t);
102102

103103
#define SWOOLE_MAJOR_VERSION 4
104104
#define SWOOLE_MINOR_VERSION 4
105-
#define SWOOLE_RELEASE_VERSION 16
105+
#define SWOOLE_RELEASE_VERSION 17
106106
#define SWOOLE_EXTRA_VERSION ""
107-
#define SWOOLE_VERSION "4.4.16"
108-
#define SWOOLE_VERSION_ID 40416
107+
#define SWOOLE_VERSION "4.4.17"
108+
#define SWOOLE_VERSION_ID 40417
109109
#define SWOOLE_BUG_REPORT \
110110
"A bug occurred in Swoole-v" SWOOLE_VERSION ", please report it.\n"\
111111
"The Swoole developers probably don't know about it,\n"\

package.xml

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
<email>[email protected]</email>
4343
<active>yes</active>
4444
</developer>
45-
<date>2020-02-19</date>
45+
<date>2020-04-01</date>
4646
<time>12:00:00</time>
4747
<version>
48-
<release>4.4.16</release>
48+
<release>4.4.17</release>
4949
<api>4.0</api>
5050
</version>
5151
<stability>
@@ -56,25 +56,34 @@
5656
<notes>
5757
Enhancement
5858
---
59-
+ Now you can get [Supported Versions of Swoole](https://github.com/swoole/swoole-src/blob/master/SUPPORTED.md) (@twose)
60-
+ More friendly error messages (0412f442) (09a48835) (@twose)
61-
+ Prevent endless loops that may occur in some special systems (069a0092) (@matyhtf)
62-
+ Add driver in PDOConfig (swoole/library#8) (@jcheron)
59+
+ Improve SSL Server performance (#3077) (85a9a595) (@matyhtf)
60+
+ Remove SW_HTTP_HEADER_VALUE_SIZE, SW_HTTP_HEADER_BUFFER_SIZE (#3187) limitation (@twose)
61+
+ Support MIPS (#3196) (@ekongyun)
62+
+ Support CURLOPT_HTTPAUTH (swoole/library@570318be) (@twose)
6363

6464
Fixed
6565
---
66-
* Fixed http2_session.default_ctx double free (bddbb9b1) (@twose)
67-
* Fixed uninitialized http_context (ce77c641) (@twose)
68-
* Fixed typo in Table (may lead to memory errors) (db4eec17) (@twose)
69-
* Fixed status error when kill USR2 and no set task_num (e4378278) (@GXhua)
70-
* Fixed incomplete raw-content of HTTP request (#3079) (#3085) (@hantaohuang)
71-
* Fixed static handler (when the file content is empty, server should respond 404) (#3084) (@Yurunsoft)
72-
* Fixed http_compression_level not work (16f9274e) (@twose)
73-
* Fixed null pointer error of Coroutine HTTP2 Server caused by no handle (ed680989) (@twose)
74-
* Fixed option socket_dontwait not work (27589376) (@matyhtf)
75-
* Fixed double zend::eval (#3099) (@GXhua)
76-
* Fixed HTTP2 Server null pointer error (respond after connection is closed) (#3110) (@twose)
77-
* Fixed PDOStatementProxy::setFetchMode missing arguments (swoole/library#13) (@jcheron)
66+
* Fixed behavior of package_length_func and memory leak (#3111) (@twose)
67+
* Fixed HTTP 304 error (#3118) (#3120) (@twose)
68+
* Fixed incorrect macro expansion (#3142) (@twose)
69+
* Fixed OpenSSL function signature (#3154) (#3155) (@twose)
70+
* Fixed SSL error msg (#3172) (@matyhtf) (@twose)
71+
* Fixed PHP-7.4 compatibility (@twose) (@matyhtf)
72+
* Fixed HTTP chunk length parser (19a1c712) (@twose)
73+
* Fixed chunked multipart parser (3692d9de) (@twose)
74+
* Fixed ZEND_ASSUME failed (fc0982be) (@twose)
75+
* Fixed Socket address error (d72c5e3a) (@twose)
76+
* Fixed Socket get name #3177 (#3179) (@matyhtf)
77+
* Fixed static handler with empty file (#3182) (@twose)
78+
* Fixed upload file handler on Coroutine\Http\Client (#3189) (#3191) (@twose)
79+
* Fixed possible memory error on shutdown (44aef60a) (@matyhtf)
80+
* Fixed Server->heartbeat (#3203) (@matyhtf)
81+
* Fixed reactor defer task (only tasks of the current round will be called) (#3207) (@twose)
82+
* Fixed invalid write on immutable array (#3212) (@twose)
83+
* Fixed double wait, improve error message (swoole/library@537a82e1) (@twose)
84+
* Fixed empty header (keep same with cURL) (swoole/library@7c92ed5a) (@twose)
85+
* Fixed non-IO methods error handler (swoole/library@f6997394) (@twose)
86+
* Fixed wrong proxy header (swoole/library@5e94e5da) (@twose)
7887
</notes>
7988
<contents>
8089
<dir name="/">
@@ -173,6 +182,7 @@
173182
<file role="doc" name="examples/coroutine/behavior/for.php" />
174183
<file role="doc" name="examples/coroutine/behavior/foreach.php" />
175184
<file role="doc" name="examples/coroutine/behavior/goto.php" />
185+
<file role="doc" name="examples/coroutine/behavior/preemptive_timer.php" />
176186
<file role="doc" name="examples/coroutine/behavior/tick.php" />
177187
<file role="doc" name="examples/coroutine/behavior/while.php" />
178188
<file role="doc" name="examples/coroutine/behavior/while2.php" />
@@ -791,6 +801,8 @@
791801
<file role="test" name="tests/swoole_client_coro/eof_03.phpt" />
792802
<file role="test" name="tests/swoole_client_coro/eof_04.phpt" />
793803
<file role="test" name="tests/swoole_client_coro/fixed_package.phpt" />
804+
<file role="test" name="tests/swoole_client_coro/getpeername.phpt" />
805+
<file role="test" name="tests/swoole_client_coro/getsockname.phpt" />
794806
<file role="test" name="tests/swoole_client_coro/isConnected.phpt" />
795807
<file role="test" name="tests/swoole_client_coro/length_01.phpt" />
796808
<file role="test" name="tests/swoole_client_coro/length_02.phpt" />
@@ -930,6 +942,7 @@
930942
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/for2.phpt" />
931943
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/goto.phpt" />
932944
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/goto2.phpt" />
945+
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/timer.phpt" />
933946
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/while.phpt" />
934947
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/while2.phpt" />
935948
<file role="test" name="tests/swoole_coroutine_scheduler/preemptive/while3.phpt" />
@@ -1037,6 +1050,7 @@
10371050
<file role="test" name="tests/swoole_http_client_coro/auto_reconnect.phpt" />
10381051
<file role="test" name="tests/swoole_http_client_coro/buffer.phpt" />
10391052
<file role="test" name="tests/swoole_http_client_coro/bug_2661.phpt" />
1053+
<file role="test" name="tests/swoole_http_client_coro/bug_3118.phpt" />
10401054
<file role="test" name="tests/swoole_http_client_coro/compression_with_big_data.phpt" />
10411055
<file role="test" name="tests/swoole_http_client_coro/connect_timeout.phpt" />
10421056
<file role="test" name="tests/swoole_http_client_coro/construct_failed.phpt" />
@@ -1160,6 +1174,7 @@
11601174
<file role="test" name="tests/swoole_http_server_coro/rawContent_get_big_data.phpt" />
11611175
<file role="test" name="tests/swoole_http_server_coro/reuse_port.phpt" />
11621176
<file role="test" name="tests/swoole_http_server_coro/sendfile.phpt" />
1177+
<file role="test" name="tests/swoole_http_server_coro/ssl_bad_client.phpt" />
11631178
<file role="test" name="tests/swoole_http_server_coro/tcp_nodelay.phpt" />
11641179
<file role="test" name="tests/swoole_http_server_coro/upload.phpt" />
11651180
<file role="test" name="tests/swoole_http_server_coro/websocket.phpt" />
@@ -1498,10 +1513,11 @@
14981513
<file role="test" name="tests/swoole_server/sigint_with_base.phpt" />
14991514
<file role="test" name="tests/swoole_server/sigint_with_process.phpt" />
15001515
<file role="test" name="tests/swoole_server/slow_client.phpt" />
1501-
<file role="test" name="tests/swoole_server/ssl.phpt" />
1502-
<file role="test" name="tests/swoole_server/ssl_verify_01.phpt" />
1503-
<file role="test" name="tests/swoole_server/ssl_verify_02.phpt" />
1504-
<file role="test" name="tests/swoole_server/ssl_verify_03.phpt" />
1516+
<file role="test" name="tests/swoole_server/ssl/00.phpt" />
1517+
<file role="test" name="tests/swoole_server/ssl/bad_client.phpt" />
1518+
<file role="test" name="tests/swoole_server/ssl/verify_01.phpt" />
1519+
<file role="test" name="tests/swoole_server/ssl/verify_02.phpt" />
1520+
<file role="test" name="tests/swoole_server/ssl/verify_03.phpt" />
15051521
<file role="test" name="tests/swoole_server/stats.phpt" />
15061522
<file role="test" name="tests/swoole_server/stop.phpt" />
15071523
<file role="test" name="tests/swoole_server/task/base.phpt" />
@@ -1559,7 +1575,9 @@
15591575
<file role="test" name="tests/swoole_socket_coro/construct_parse_args_failed.phpt" />
15601576
<file role="test" name="tests/swoole_socket_coro/fd.phpt" />
15611577
<file role="test" name="tests/swoole_socket_coro/getopt/get.phpt" />
1578+
<file role="test" name="tests/swoole_socket_coro/getpeername.phpt" />
15621579
<file role="test" name="tests/swoole_socket_coro/getsockname.phpt" />
1580+
<file role="test" name="tests/swoole_socket_coro/protocol/package_length_func.phpt" />
15631581
<file role="test" name="tests/swoole_socket_coro/recvAll_timeout.phpt" />
15641582
<file role="test" name="tests/swoole_socket_coro/recv_timeout.phpt" />
15651583
<file role="test" name="tests/swoole_socket_coro/reuse.phpt" />

php_swoole_library.h

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Generated by build-library.php, Please DO NOT modify!
33
*/
44

5-
/* $Id: b5c9cede8c6150feba50d0e28d56de355fa69d16 */
5+
/* $Id: 5e94e5da86146151014c7ab9069f3bb4d2d20177 */
66

77
static const char* swoole_library_source_constants =
88
"\n"
@@ -235,6 +235,8 @@ static const char* swoole_library_source_core_constant =
235235
"\n"
236236
" public const OPTION_HOOK_FLAGS = 'hook_flags';\n"
237237
"\n"
238+
" public const OPTION_ENABLE_PREEMPTIVE_SCHEDULER = 'enable_preemptive_scheduler';\n"
239+
"\n"
238240
" public const OPTION_C_STACK_SIZE = 'c_stack_size';\n"
239241
"\n"
240242
" public const OPTION_STACK_SIZE = 'stack_size';\n"
@@ -1430,7 +1432,7 @@ static const char* swoole_library_source_core_coroutine_wait_group =
14301432
" }\n"
14311433
" $count = $this->count + $delta;\n"
14321434
" if ($count < 0) {\n"
1433-
" throw new InvalidArgumentException('negative WaitGroup counter');\n"
1435+
" throw new InvalidArgumentException('WaitGroup misuse: negative counter');\n"
14341436
" }\n"
14351437
" $this->count = $count;\n"
14361438
" }\n"
@@ -1439,7 +1441,7 @@ static const char* swoole_library_source_core_coroutine_wait_group =
14391441
" {\n"
14401442
" $count = $this->count - 1;\n"
14411443
" if ($count < 0) {\n"
1442-
" throw new BadMethodCallException('negative WaitGroup counter');\n"
1444+
" throw new BadMethodCallException('WaitGroup misuse: negative counter');\n"
14431445
" }\n"
14441446
" $this->count = $count;\n"
14451447
" if ($count === 0 && $this->waiting) {\n"
@@ -1449,6 +1451,9 @@ static const char* swoole_library_source_core_coroutine_wait_group =
14491451
"\n"
14501452
" public function wait(float $timeout = -1): bool\n"
14511453
" {\n"
1454+
" if ($this->waiting) {\n"
1455+
" throw new BadMethodCallException('WaitGroup misuse: reused before previous wait has returned');\n"
1456+
" }\n"
14521457
" if ($this->count > 0) {\n"
14531458
" $this->waiting = true;\n"
14541459
" $done = $this->chan->pop($timeout);\n"
@@ -1996,8 +2001,13 @@ static const char* swoole_library_source_core_database_mysqli_proxy =
19962001
" public function __call(string $name, array $arguments)\n"
19972002
" {\n"
19982003
" for ($n = 3; $n--;) {\n"
2004+
" $this->__object->errno = 0;\n"
19992005
" $ret = @$this->__object->{$name}(...$arguments);\n"
20002006
" if ($ret === false) {\n"
2007+
" /* no error */\n"
2008+
" if ($this->__object->errno === 0) {\n"
2009+
" break;\n"
2010+
" }\n"
20012011
" /* no more chances or non-IO failures */\n"
20022012
" if (\n"
20032013
" !in_array($this->__object->errno, static::IO_ERRORS, true) ||\n"
@@ -2114,8 +2124,13 @@ static const char* swoole_library_source_core_database_mysqli_statement_proxy =
21142124
" public function __call(string $name, array $arguments)\n"
21152125
" {\n"
21162126
" for ($n = 3; $n--;) {\n"
2127+
" $this->__object->errno = 0;\n"
21172128
" $ret = @$this->__object->{$name}(...$arguments);\n"
21182129
" if ($ret === false) {\n"
2130+
" /* no error */\n"
2131+
" if ($this->__object->errno === 0) {\n"
2132+
" break;\n"
2133+
" }\n"
21192134
" /* no more chances or non-IO failures or in transaction */\n"
21202135
" if (\n"
21212136
" !in_array($this->__object->errno, $this->parent::IO_ERRORS, true) ||\n"
@@ -2408,6 +2423,7 @@ static const char* swoole_library_source_core_database_pdo_proxy =
24082423
"\n"
24092424
"class PDOProxy extends ObjectProxy\n"
24102425
"{\n"
2426+
" public const IO_METHOD_REGEX = '/^query|prepare|exec|beginTransaction|commit|rollback$/i';\n"
24112427
" public const IO_ERRORS = [\n"
24122428
" 2002, // MYSQLND_CR_CONNECTION_ERROR\n"
24132429
" 2006, // MYSQLND_CR_SERVER_GONE_ERROR\n"
@@ -2438,8 +2454,12 @@ static const char* swoole_library_source_core_database_pdo_proxy =
24382454
" for ($n = 3; $n--;) {\n"
24392455
" $ret = @$this->__object->{$name}(...$arguments);\n"
24402456
" if ($ret === false) {\n"
2441-
" /* no more chances or non-IO failures */\n"
2457+
" /* non-IO method */\n"
2458+
" if (!preg_match(static::IO_METHOD_REGEX, $name)) {\n"
2459+
" break;\n"
2460+
" }\n"
24422461
" $errorInfo = $this->__object->errorInfo();\n"
2462+
" /* no more chances or non-IO failures */\n"
24432463
" if (\n"
24442464
" !in_array($errorInfo[1], static::IO_ERRORS, true) ||\n"
24452465
" $n === 0 ||\n"
@@ -2551,6 +2571,10 @@ static const char* swoole_library_source_core_database_pdo_statement_proxy =
25512571
" for ($n = 3; $n--;) {\n"
25522572
" $ret = @$this->__object->{$name}(...$arguments);\n"
25532573
" if ($ret === false) {\n"
2574+
" /* no IO */\n"
2575+
" if (strtolower($name) !== 'execute') {\n"
2576+
" break;\n"
2577+
" }\n"
25542578
" /* no more chances or non-IO failures or in transaction */\n"
25552579
" if (\n"
25562580
" !in_array($this->__object->errorInfo()[1], $this->parent::IO_ERRORS, true) ||\n"
@@ -3502,6 +3526,9 @@ static const char* swoole_library_source_core_curl_handler =
35023526
" $header = explode(':', $header, 2);\n"
35033527
" $headerName = $header[0];\n"
35043528
" $headerValue = trim($header[1] ?? '');\n"
3529+
" if (strlen($headerValue) === 0) {\n"
3530+
" continue;\n"
3531+
" }\n"
35053532
" $this->headers[$headerName] = $headerValue;\n"
35063533
" }\n"
35073534
" break;\n"
@@ -3567,6 +3594,12 @@ static const char* swoole_library_source_core_curl_handler =
35673594
" case CURLOPT_PROGRESSFUNCTION:\n"
35683595
" $this->progressFunction = $value;\n"
35693596
" break;\n"
3597+
" case CURLOPT_HTTPAUTH:\n"
3598+
" if (!($value & CURLAUTH_BASIC)) {\n"
3599+
" trigger_error(\"swoole_curl_setopt(): CURLOPT_HTTPAUTH[{$value}] is not supported\", E_USER_WARNING);\n"
3600+
" return false;\n"
3601+
" }\n"
3602+
" break;\n"
35703603
" case CURLOPT_USERPWD:\n"
35713604
" $this->headers['Authorization'] = 'Basic ' . base64_encode($value);\n"
35723605
" break;\n"
@@ -3705,7 +3738,7 @@ static const char* swoole_library_source_core_curl_handler =
37053738
" /*\n"
37063739
" * Http Headers\n"
37073740
" */\n"
3708-
" $this->headers['Host'] = $this->urlInfo['host'] . (isset($this->urlInfo['port']) ? (':' . $this->urlInfo['port']) : ''); /* TODO: remove it (built-in support) */\n"
3741+
" $this->headers['Host'] = $this->urlInfo['host'];\n"
37093742
" // remove empty headers (keep same with raw cURL)\n"
37103743
" foreach ($this->headers as $headerName => $headerValue) {\n"
37113744
" if ($headerValue === '') {\n"

tools/build-library.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
);
1313
$file_change = (int) ($file_change[1] ?? 0);
1414
if ($file_change > 0) {
15-
swoole_error($file_change . ' file changed in [' . LIBRARY_DIR . ']');
15+
swoole_warn($file_change . ' file changed in [' . LIBRARY_DIR . ']');
1616
}
1717
$commit_id = trim(shell_exec('cd ' . LIBRARY_DIR . ' && git rev-parse HEAD'));
1818
if (!$commit_id || strlen($commit_id) != 40) {

0 commit comments

Comments
 (0)