Skip to content

Commit

Permalink
Update version for Swoole 4.7.0 (#4321)
Browse files Browse the repository at this point in the history
  • Loading branch information
huanghantao committed Jul 16, 2021
1 parent 3f2e960 commit db6deb0
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 31 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.7.0-dev)
set(SWOOLE_VERSION 4.7.0)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -g")
Expand Down
3 changes: 3 additions & 0 deletions ext-src/php_swoole.cc
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ PHP_MINIT_FUNCTION(swoole) {
SW_REGISTER_LONG_CONSTANT("SWOOLE_ERROR_DNSLOOKUP_DUPLICATE_REQUEST", SW_ERROR_DNSLOOKUP_DUPLICATE_REQUEST);
SW_REGISTER_LONG_CONSTANT("SWOOLE_ERROR_DNSLOOKUP_RESOLVE_FAILED", SW_ERROR_DNSLOOKUP_RESOLVE_FAILED);
SW_REGISTER_LONG_CONSTANT("SWOOLE_ERROR_DNSLOOKUP_RESOLVE_TIMEOUT", SW_ERROR_DNSLOOKUP_RESOLVE_TIMEOUT);
SW_REGISTER_LONG_CONSTANT("SWOOLE_ERROR_DNSLOOKUP_UNSUPPORTED", SW_ERROR_DNSLOOKUP_UNSUPPORTED);
SW_REGISTER_LONG_CONSTANT("SWOOLE_ERROR_DNSLOOKUP_NO_SERVER", SW_ERROR_DNSLOOKUP_NO_SERVER);
SW_REGISTER_LONG_CONSTANT("SWOOLE_ERROR_BAD_IPV6_ADDRESS", SW_ERROR_BAD_IPV6_ADDRESS);
SW_REGISTER_LONG_CONSTANT("SWOOLE_ERROR_UNREGISTERED_SIGNAL", SW_ERROR_UNREGISTERED_SIGNAL);
SW_REGISTER_LONG_CONSTANT("SWOOLE_ERROR_EVENT_SOCKET_REMOVED", SW_ERROR_EVENT_SOCKET_REMOVED);
Expand Down Expand Up @@ -703,6 +705,7 @@ PHP_MINIT_FUNCTION(swoole) {
SW_REGISTER_LONG_CONSTANT("SWOOLE_TRACE_CO_HTTP_SERVER", SW_TRACE_CO_HTTP_SERVER);
SW_REGISTER_LONG_CONSTANT("SWOOLE_TRACE_TABLE", SW_TRACE_TABLE);
SW_REGISTER_LONG_CONSTANT("SWOOLE_TRACE_CO_CURL", SW_TRACE_CO_CURL);
SW_REGISTER_LONG_CONSTANT("SWOOLE_TRACE_CARES", SW_TRACE_CARES);
SW_REGISTER_LONG_CONSTANT("SWOOLE_TRACE_ALL", SW_TRACE_ALL);

/**
Expand Down
59 changes: 47 additions & 12 deletions ext-src/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: e07037baef45ea64d334257e203fe2ca82914c93 */
/* $Id: 05b8161677541803bf1644f9a57057863c67937b */

static const char* swoole_library_source_constants =
"\n"
Expand All @@ -19,7 +19,8 @@ static const char* swoole_library_source_constants =
"define('SWOOLE_LIBRARY', true);\n"
"\n"
"!defined('CURLOPT_HEADEROPT') && define('CURLOPT_HEADEROPT', 229);\n"
"!defined('CURLOPT_PROXYHEADER') && define('CURLOPT_PROXYHEADER', 10228);\n";
"!defined('CURLOPT_PROXYHEADER') && define('CURLOPT_PROXYHEADER', 10228);\n"
"!defined('CURLOPT_RESOLVE') && define('CURLOPT_RESOLVE', 10203);\n";

static const char* swoole_library_source_std_exec =
"\n"
Expand Down Expand Up @@ -305,6 +306,10 @@ static const char* swoole_library_source_core_constant =
"\n"
" public const OPTION_WEBSOCKET_MASK = 'websocket_mask';\n"
"\n"
" public const OPTION_HTTP_COMPRESSION = 'http_compression';\n"
"\n"
" public const OPTION_BODY_DECOMPRESSION = 'body_decompression';\n"
"\n"
" public const OPTION_WEBSOCKET_COMPRESSION = 'websocket_compression';\n"
"\n"
" public const OPTION_HTTP_PARSE_COOKIE = 'http_parse_cookie';\n"
Expand All @@ -313,8 +318,6 @@ static const char* swoole_library_source_core_constant =
"\n"
" public const OPTION_HTTP_PARSE_FILES = 'http_parse_files';\n"
"\n"
" public const OPTION_HTTP_COMPRESSION = 'http_compression';\n"
"\n"
" public const OPTION_HTTP_COMPRESSION_LEVEL = 'http_compression_level';\n"
"\n"
" public const OPTION_HTTP_GZIP_LEVEL = 'http_gzip_level';\n"
Expand Down Expand Up @@ -3005,13 +3008,10 @@ static const char* swoole_library_source_core_database_pdo_statement_proxy =
" return $this->__object->setAttribute($attribute, $value);\n"
" }\n"
"\n"
" public function setFetchMode(int $mode, $classNameObject = null, array $ctorarfg = []): bool\n"
" public function setFetchMode(int $mode, ...$args): bool\n"
" {\n"
" $this->setFetchModeContext = [$mode, $classNameObject, $ctorarfg];\n"
" if (!isset($classNameObject)) {\n"
" return $this->__object->setFetchMode($mode);\n"
" }\n"
" return $this->__object->setFetchMode($mode, $classNameObject, $ctorarfg);\n"
" $this->setFetchModeContext = func_get_args();\n"
" return $this->__object->setFetchMode(...$this->setFetchModeContext);\n"
" }\n"
"\n"
" public function bindParam($parameter, &$variable, $data_type = PDO::PARAM_STR, $length = null, $driver_options = null): bool\n"
Expand Down Expand Up @@ -3587,6 +3587,8 @@ static const char* swoole_library_source_core_curl_handler =
"\n"
" private $cookieJar = '';\n"
"\n"
" private $resolve = [];\n"
"\n"
" public function __construct(string $url = '')\n"
" {\n"
" if ($url) {\n"
Expand Down Expand Up @@ -3673,7 +3675,15 @@ static const char* swoole_library_source_core_curl_handler =
" if ($urlInfo === null) {\n"
" $urlInfo = $this->urlInfo;\n"
" }\n"
" $this->client = new Client($urlInfo['host'], $urlInfo['port'], $urlInfo['scheme'] === 'https');\n"
" $host = $urlInfo['host'];\n"
" $port = $urlInfo['port'];\n"
" if (isset($this->resolve[$host])) {\n"
" if (!$this->hasHeader('Host')) {\n"
" $this->setHeader('Host', $host);\n"
" }\n"
" $this->urlInfo['host'] = $host = $this->resolve[$host][$port] ?? null ?: $host;\n"
" }\n"
" $this->client = new Client($host, $port, $urlInfo['scheme'] === 'https');\n"
" }\n"
"\n"
" private function getUrl(): string\n"
Expand Down Expand Up @@ -3761,7 +3771,7 @@ static const char* swoole_library_source_core_curl_handler =
" private function setError($code, $msg = ''): void\n"
" {\n"
" $this->errCode = $code;\n"
" $this->errMsg = $msg ? $msg : curl_strerror($code);\n"
" $this->errMsg = $msg ?: curl_strerror($code);\n"
" }\n"
"\n"
" private function hasHeader(string $headerName): bool\n"
Expand Down Expand Up @@ -3870,6 +3880,25 @@ static const char* swoole_library_source_core_curl_handler =
" $this->nobody = boolval($value);\n"
" $this->method = 'HEAD';\n"
" break;\n"
" case CURLOPT_RESOLVE:\n"
" foreach ((array) $value as $resolve) {\n"
" $flag = substr($resolve, 0, 1);\n"
" if ($flag === '+' || $flag === '-') {\n"
" // TODO: [+]HOST:PORT:ADDRESS\n"
" $resolve = substr($resolve, 1);\n"
" }\n"
" $tmpResolve = explode(':', $resolve, 3);\n"
" $host = $tmpResolve[0] ?? '';\n"
" $port = $tmpResolve[1] ?? 0;\n"
" $ip = $tmpResolve[2] ?? '';\n"
" if ($flag === '-') {\n"
" unset($this->resolve[$host][$port]);\n"
" } else {\n"
" // TODO: HOST:PORT:ADDRESS[,ADDRESS]...\n"
" $this->resolve[$host][$port] = explode(',', $ip)[0];\n"
" }\n"
" }\n"
" break;\n"
" case CURLOPT_IPRESOLVE:\n"
" if ($value !== CURL_IPRESOLVE_WHATEVER and $value !== CURL_IPRESOLVE_V4) {\n"
" throw new Swoole\\Curl\\Exception(\n"
Expand Down Expand Up @@ -4260,6 +4289,10 @@ static const char* swoole_library_source_core_curl_handler =
" $this->info['redirect_time'] = microtime(true) - $redirectBeginTime;\n"
" }\n"
"\n"
" if (filter_var($this->urlInfo['host'], FILTER_VALIDATE_IP)) {\n"
" $this->info['primary_ip'] = $this->urlInfo['host'];\n"
" }\n"
"\n"
" $headerContent = '';\n"
" if ($client->headers) {\n"
" $cb = $this->headerFunction;\n"
Expand Down Expand Up @@ -7118,6 +7151,8 @@ static const char* swoole_library_source_ext_curl =
" return $info['redirect_time'];\n"
" case CURLINFO_HEADER_SIZE:\n"
" return $info['header_size'];\n"
" case CURLINFO_PRIMARY_IP:\n"
" return $info['primary_ip'];\n"
" case CURLINFO_PRIVATE:\n"
" return $info['private'];\n"
" default:\n"
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 7
#define SWOOLE_RELEASE_VERSION 0
#define SWOOLE_EXTRA_VERSION "dev"
#define SWOOLE_VERSION "4.7.0-dev"
#define SWOOLE_EXTRA_VERSION ""
#define SWOOLE_VERSION "4.7.0"
#define SWOOLE_VERSION_ID 40700
#define SWOOLE_API_VERSION_ID 0x202107a

Expand Down
Loading

0 comments on commit db6deb0

Please sign in to comment.