Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Mar 27, 2024
1 parent 684e419 commit afae718
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions ext-src/swoole_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ static bool php_swoole_server_task_unpack(zval *zresult, EventData *task_result)
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
if (!unserialized) {
swoole_warning("unserialize() failed, Error at offset " ZEND_LONG_FMT " of %zd bytes",
(zend_long)((char *) p - packet.data),
(zend_long) ((char *) p - packet.data),
l);
return false;
}
Expand Down Expand Up @@ -1768,15 +1768,13 @@ static int php_swoole_server_dispatch_func(Server *serv, Connection *conn, SendD

*zserv = *((zval *) serv->private_data_2);
ZVAL_LONG(zfd, conn ? conn->session_id : data->info.fd);
ZVAL_LONG(ztype, (zend_long)(data ? data->info.type : (int) SW_SERVER_EVENT_CLOSE));
ZVAL_LONG(ztype, (zend_long) (data ? data->info.type : (int) SW_SERVER_EVENT_CLOSE));
if (data && sw_zend_function_max_num_args(fci_cache->function_handler) > 3) {
// TODO: reduce memory copy
zdata = &args[3];
ZVAL_STRINGL(zdata, data->data, data->info.len > SW_IPC_BUFFER_SIZE ? SW_IPC_BUFFER_SIZE : data->info.len);
}
HOOK_PHP_CALL_STACK(
auto call_result = sw_zend_call_function_ex(nullptr, fci_cache, zdata ? 4 : 3, args, &retval);
);
HOOK_PHP_CALL_STACK(auto call_result = sw_zend_call_function_ex(nullptr, fci_cache, zdata ? 4 : 3, args, &retval););
if (UNEXPECTED(call_result != SUCCESS)) {
php_swoole_error(E_WARNING, "%s->onDispatch handler error", SW_Z_OBJCE_NAME_VAL_P(zserv));
} else if (!ZVAL_IS_NULL(&retval)) {
Expand Down
8 changes: 4 additions & 4 deletions src/server/master.cc
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ void Server::destroy() {
join_reactor_thread();
}

release_pipe_buffers();
release_pipe_buffers();

for (auto port : ports) {
port->close();
Expand Down Expand Up @@ -1515,7 +1515,7 @@ bool Server::sendfile(SessionId session_id, const char *file, uint32_t l_file, o
"sendfile name[%.8s...] length %u is exceed the max name len %u",
file,
l_file,
(uint32_t)(SW_IPC_BUFFER_SIZE - sizeof(SendfileTask) - 1));
(uint32_t) (SW_IPC_BUFFER_SIZE - sizeof(SendfileTask) - 1));
return false;
}
// string must be zero termination (for `state` system call)
Expand Down Expand Up @@ -1769,7 +1769,7 @@ ListenPort *Server::add_port(SocketType type, const char *host, int port) {

#ifdef SW_USE_OPENSSL
if (type & SW_SOCK_SSL) {
type = (SocketType)(type & (~SW_SOCK_SSL));
type = (SocketType) (type & (~SW_SOCK_SSL));
ls->type = type;
ls->ssl = 1;
ls->ssl_context = new SSLContext();
Expand Down Expand Up @@ -2016,7 +2016,7 @@ int Server::create_pipe_buffers() {
}

void Server::release_pipe_buffers() {
message_bus.free_buffer();
message_bus.free_buffer();
}

int Server::get_idle_worker_num() {
Expand Down

0 comments on commit afae718

Please sign in to comment.