Skip to content

Commit cd7ff6f

Browse files
committedOct 30, 2024·
Optimize code, Fix compile error
1 parent 834637c commit cd7ff6f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎ext-src/swoole_async_coro.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct DNSCacheEntity {
3333
time_t update_time;
3434
};
3535

36-
static std::unordered_map<std::string, DNSCacheEntity *> request_cache_map;
36+
static SW_THREAD_LOCAL std::unordered_map<std::string, DNSCacheEntity *> request_cache_map;
3737

3838
void php_swoole_async_coro_rshutdown() {
3939
for (auto i = request_cache_map.begin(); i != request_cache_map.end(); i++) {

‎ext-src/swoole_client.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static PHP_METHOD(swoole_client, __construct) {
614614
}
615615

616616
if (async) {
617-
zend_throw_error(NULL, "please install the ext-async extension, using Swoole\\Async\\Client");
617+
zend_throw_error(NULL, "The $async parameter is not supported");
618618
RETURN_FALSE;
619619
}
620620

@@ -1215,6 +1215,7 @@ static PHP_METHOD(swoole_client, close) {
12151215
SW_CHECK_RETURN(ret);
12161216
}
12171217

1218+
#ifdef SW_USE_OPENSSL
12181219
bool php_swoole_client_enable_ssl_encryption(Client *cli, zval *zobject) {
12191220
if (cli->socket->socket_type != SW_SOCK_TCP && cli->socket->socket_type != SW_SOCK_TCP6) {
12201221
php_swoole_fatal_error(E_WARNING, "cannot use enableSSL");
@@ -1232,7 +1233,6 @@ bool php_swoole_client_enable_ssl_encryption(Client *cli, zval *zobject) {
12321233
return cli->enable_ssl_encrypt() == SW_OK;
12331234
}
12341235

1235-
#ifdef SW_USE_OPENSSL
12361236
static PHP_METHOD(swoole_client, enableSSL) {
12371237
Client *cli = php_swoole_client_get_cli_safe(ZEND_THIS);
12381238
if (!cli) {

0 commit comments

Comments
 (0)
Please sign in to comment.