Skip to content

Commit

Permalink
Optimize code, Fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Oct 30, 2024
1 parent 834637c commit cd7ff6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ext-src/swoole_async_coro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct DNSCacheEntity {
time_t update_time;
};

static std::unordered_map<std::string, DNSCacheEntity *> request_cache_map;
static SW_THREAD_LOCAL std::unordered_map<std::string, DNSCacheEntity *> request_cache_map;

void php_swoole_async_coro_rshutdown() {
for (auto i = request_cache_map.begin(); i != request_cache_map.end(); i++) {
Expand Down
4 changes: 2 additions & 2 deletions ext-src/swoole_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ static PHP_METHOD(swoole_client, __construct) {
}

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

Expand Down Expand Up @@ -1215,6 +1215,7 @@ static PHP_METHOD(swoole_client, close) {
SW_CHECK_RETURN(ret);
}

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

#ifdef SW_USE_OPENSSL
static PHP_METHOD(swoole_client, enableSSL) {
Client *cli = php_swoole_client_get_cli_safe(ZEND_THIS);
if (!cli) {
Expand Down

0 comments on commit cd7ff6f

Please sign in to comment.