Skip to content

Commit

Permalink
Optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Sep 15, 2021
1 parent 1c02a87 commit 86708d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion ext-src/swoole_coroutine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ using swoole::PHPContext;
using swoole::PHPCoroutine;
using swoole::coroutine::Socket;
using swoole::coroutine::System;
using swoole::CallbackManager;

#define PHP_CORO_TASK_SLOT \
((int) ((ZEND_MM_ALIGNED_SIZE(sizeof(PHPContext)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval)) - 1) / \
Expand Down
6 changes: 3 additions & 3 deletions ext-src/swoole_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3685,9 +3685,9 @@ static PHP_METHOD(swoole_server, getClientInfo) {
}
#endif
// server socket
Connection *from_sock = serv->get_connection(conn->server_fd);
if (from_sock) {
add_assoc_long(return_value, "server_port", from_sock->info.get_port());
Connection *server_socket = serv->get_connection(conn->server_fd);
if (server_socket) {
add_assoc_long(return_value, "server_port", server_socket->info.get_port());
}
add_assoc_long(return_value, "server_fd", conn->server_fd);
add_assoc_long(return_value, "socket_fd", conn->fd);
Expand Down

0 comments on commit 86708d6

Please sign in to comment.