提交 4bf4f0f4 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Minimal style changes

上级 5ee6def4
...@@ -4,3 +4,4 @@ ...@@ -4,3 +4,4 @@
/etc/*.pem /etc/*.pem
/mediasoup-tester.sh /mediasoup-tester.sh
/cldoc/ /cldoc/
/TODO
...@@ -138,7 +138,7 @@ void Daemon::Daemonize() ...@@ -138,7 +138,7 @@ void Daemon::Daemonize()
// Close all the possible fds inherited from the ancestor process (all but // Close all the possible fds inherited from the ancestor process (all but
// the write side of the pipe as the daemonized process must use it). // the write side of the pipe as the daemonized process must use it).
for (int fd=3; fd<32; fd++) for (int fd = 3; fd < 32; fd++)
{ {
if (fd != Daemon::statusPipe[1]) if (fd != Daemon::statusPipe[1])
close(fd); close(fd);
......
...@@ -54,7 +54,7 @@ Dispatcher::Dispatcher() ...@@ -54,7 +54,7 @@ Dispatcher::Dispatcher()
// since the first entry will be in position 1. // since the first entry will be in position 1.
this->controlProtocolUnixStreamSockets.push_back(nullptr); this->controlProtocolUnixStreamSockets.push_back(nullptr);
for (int workerId=1; workerId <= num_workers; workerId++) for (int workerId = 1; workerId <= num_workers; workerId++)
{ {
int fd = Worker::GetControlProtocolRemoteSocket(workerId); int fd = Worker::GetControlProtocolRemoteSocket(workerId);
ControlProtocol::UnixStreamSocket* controlProtocolUnixStreamSocket; ControlProtocol::UnixStreamSocket* controlProtocolUnixStreamSocket;
...@@ -128,7 +128,7 @@ void Dispatcher::Close() ...@@ -128,7 +128,7 @@ void Dispatcher::Close()
// Close the ControlProtocol UnixStream sockets. // Close the ControlProtocol UnixStream sockets.
int num_workers = Worker::CountWorkers(); int num_workers = Worker::CountWorkers();
for (int workerId=1; workerId <= num_workers; workerId++) for (int workerId = 1; workerId <= num_workers; workerId++)
this->controlProtocolUnixStreamSockets[workerId]->Close(); this->controlProtocolUnixStreamSockets[workerId]->Close();
} }
...@@ -216,7 +216,7 @@ void Dispatcher::onControlProtocolMessage(ControlProtocol::TCPConnection* connec ...@@ -216,7 +216,7 @@ void Dispatcher::onControlProtocolMessage(ControlProtocol::TCPConnection* connec
if (relayToAllWorkers) if (relayToAllWorkers)
{ {
int num_workers = Worker::CountWorkers(); int num_workers = Worker::CountWorkers();
for (int workerId=1; workerId <= num_workers; workerId++) for (int workerId = 1; workerId <= num_workers; workerId++)
{ {
ControlProtocol::UnixStreamSocket* controlProtocolUnixStreamSocket = controlProtocolUnixStreamSockets[workerId]; ControlProtocol::UnixStreamSocket* controlProtocolUnixStreamSocket = controlProtocolUnixStreamSockets[workerId];
......
...@@ -74,7 +74,7 @@ void MediaSoup::Run() ...@@ -74,7 +74,7 @@ void MediaSoup::Run()
// A vector for holding the workerId value for each thread. // A vector for holding the workerId value for each thread.
std::vector<int> worker_ids; std::vector<int> worker_ids;
for (int workerId=1; workerId <= Settings::configuration.numWorkers; workerId++) for (int workerId = 1; workerId <= Settings::configuration.numWorkers; workerId++)
{ {
worker_ids.push_back(workerId); worker_ids.push_back(workerId);
Worker::SetWorker(workerId, nullptr); Worker::SetWorker(workerId, nullptr);
...@@ -105,7 +105,7 @@ void MediaSoup::Run() ...@@ -105,7 +105,7 @@ void MediaSoup::Run()
waiting.tv_sec = 0; waiting.tv_sec = 0;
waiting.tv_nsec = 10000000; // 10 ms. waiting.tv_nsec = 10000000; // 10 ms.
for (int i=1; i<=300; i++) for (int i = 1; i <= 300; i++)
{ {
if (Worker::AreAllWorkersRunning()) if (Worker::AreAllWorkersRunning())
{ {
......
...@@ -32,7 +32,7 @@ void OpenSSL::ClassInit() ...@@ -32,7 +32,7 @@ void OpenSSL::ClassInit()
OpenSSL::numMutexes = CRYPTO_num_locks(); OpenSSL::numMutexes = CRYPTO_num_locks();
for (int i=0; i<OpenSSL::numMutexes; i++) for (int i = 0; i < OpenSSL::numMutexes; i++)
{ {
int err = pthread_mutex_init(&OpenSSL::mutexes[i], nullptr); int err = pthread_mutex_init(&OpenSSL::mutexes[i], nullptr);
if (err) if (err)
...@@ -70,7 +70,7 @@ void OpenSSL::ClassDestroy() ...@@ -70,7 +70,7 @@ void OpenSSL::ClassDestroy()
sk_SSL_COMP_free(SSL_COMP_get_compression_methods()); sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
// Free mutexes. // Free mutexes.
for (int i=0; i<OpenSSL::numMutexes; i++) for (int i = 0; i < OpenSSL::numMutexes; i++)
{ {
int err = pthread_mutex_destroy(&OpenSSL::mutexes[i]); int err = pthread_mutex_destroy(&OpenSSL::mutexes[i]);
if (err) if (err)
......
...@@ -25,6 +25,7 @@ namespace RTC ...@@ -25,6 +25,7 @@ namespace RTC
{ {
RTC::Peer* peer = new RTC::Peer(this); RTC::Peer* peer = new RTC::Peer(this);
// TODO: this is not being freed
int* data = new int(i); int* data = new int(i);
peer->SetUserData((void*)data); peer->SetUserData((void*)data);
......
...@@ -21,6 +21,7 @@ namespace RTC ...@@ -21,6 +21,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
// TODO: sure I want this?
delete this; delete this;
} }
} // namespace RTC } // namespace RTC
...@@ -571,7 +571,7 @@ void Settings::SetDefaultRTClistenIP(int requested_family) ...@@ -571,7 +571,7 @@ void Settings::SetDefaultRTClistenIP(int requested_family)
if (err) if (err)
MS_ABORT("uv_interface_addresses() failed: %s", uv_strerror(err)); MS_ABORT("uv_interface_addresses() failed: %s", uv_strerror(err));
for (int i=0; i<num_addresses; i++) for (int i = 0; i < num_addresses; i++)
{ {
uv_interface_address_t address = addresses[i]; uv_interface_address_t address = addresses[i];
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论