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

Remove Syslog stuff.

上级 d899c399
...@@ -5,3 +5,4 @@ ...@@ -5,3 +5,4 @@
/worker/cldoc/ /worker/cldoc/
/worker/mediasoup-tester.sh /worker/mediasoup-tester.sh
/TODO /TODO
/test.js
...@@ -17,8 +17,8 @@ const WORKER_BIN_PATH = path.join(__dirname, '..', 'worker', 'bin', 'mediasoup-w ...@@ -17,8 +17,8 @@ const WORKER_BIN_PATH = path.join(__dirname, '..', 'worker', 'bin', 'mediasoup-w
const DEFAULT_NUM_WORKERS = Object.keys(os.cpus()).length; const DEFAULT_NUM_WORKERS = Object.keys(os.cpus()).length;
const VALID_PARAMETERS = const VALID_PARAMETERS =
[ [
'logLevel', 'useSyslog', 'syslogFacility', 'rtcListenIPv4', 'rtcListenIPv6', 'logLevel', 'rtcListenIPv4', 'rtcListenIPv6', 'rtcMinPort', 'rtcMaxPort',
'rtcMinPort', 'rtcMaxPort', 'dtlsCertificateFile', 'dtlsPrivateKeyFile' 'dtlsCertificateFile', 'dtlsPrivateKeyFile'
]; ];
var servers = new Set(); var servers = new Set();
...@@ -67,12 +67,19 @@ class Server ...@@ -67,12 +67,19 @@ class Server
// Create mediasoup-worker child processes // Create mediasoup-worker child processes
for (let i = 1; i <= numWorkers; i++) for (let i = 1; i <= numWorkers; i++)
{ {
let workerId = serverId + '#' + i;
let worker; let worker;
let workerId = serverId + '#' + i;
let spawnArgs = [ workerId ].concat(parameters);
let spawnOptions =
{
detached : false,
stdio : [ 'pipe', 'pipe', 'pipe', 'ipc' ]
};
debug('constructor() | creating worker [workerId:%s]', workerId); debug('constructor() | creating worker [workerId:%s]', workerId);
worker = spawn(WORKER_BIN_PATH, [ workerId ].concat(parameters)); // Create the worker child process
worker = spawn(WORKER_BIN_PATH, spawnArgs, spawnOptions);
// Store worker id within the worker process // Store worker id within the worker process
worker.workerId = workerId; worker.workerId = workerId;
...@@ -102,6 +109,8 @@ class Server ...@@ -102,6 +109,8 @@ class Server
worker.on('exit', (code, signal) => worker.on('exit', (code, signal) =>
{ {
debug('worker process closed [workerId:%s, code:%s, signal:%s]', worker.workerId, code, signal); debug('worker process closed [workerId:%s, code:%s, signal:%s]', worker.workerId, code, signal);
this._workers.delete(worker.workerId);
}); });
worker.on('error', (error) => worker.on('error', (error) =>
......
...@@ -8,10 +8,6 @@ ...@@ -8,10 +8,6 @@
#include <cstring> #include <cstring>
#include <cstdlib> // std::_Exit(), std::abort() #include <cstdlib> // std::_Exit(), std::abort()
#include <uv.h> #include <uv.h>
extern "C"
{
#include <syslog.h>
}
/* /*
* Logger facility. * Logger facility.
...@@ -24,10 +20,8 @@ extern "C" ...@@ -24,10 +20,8 @@ extern "C"
* - MS_TRACE() Shows current file/line/class/function. * - MS_TRACE() Shows current file/line/class/function.
* - MS_DEBUG(...) * - MS_DEBUG(...)
* - MS_INFO(...) * - MS_INFO(...)
* - MS_NOTICE(...)
* - MS_WARN(...) * - MS_WARN(...)
* - MS_ERROR(...) * - MS_ERROR(...)
* - MS_CRIT(...)
* - MS_ABORT(...) * - MS_ABORT(...)
* *
* Arguments to those macros (except MS_TRACE) have the same format as printf. * Arguments to those macros (except MS_TRACE) have the same format as printf.
...@@ -45,7 +39,7 @@ extern "C" ...@@ -45,7 +39,7 @@ extern "C"
/* /*
* This macro must point to a unsigned int function, method or variable that * This macro must point to a unsigned int function, method or variable that
* returns the Syslog logging level. * returns the logging level.
*/ */
#define MS_GET_LOG_LEVEL Settings::configuration.logLevel #define MS_GET_LOG_LEVEL Settings::configuration.logLevel
...@@ -55,14 +49,11 @@ public: ...@@ -55,14 +49,11 @@ public:
static void Init(const std::string id); static void Init(const std::string id);
static const char* GetProcessName(); static const char* GetProcessName();
static const char* GetProcessMinName(); static const char* GetProcessMinName();
static void EnableSyslog();
static bool IsSyslogEnabled();
static bool HasDebugLevel(); static bool HasDebugLevel();
private: private:
static std::string processName; static std::string processName;
static std::string processMinName; static std::string processMinName;
static bool isSyslogEnabled;
}; };
/* Inline static methods. */ /* Inline static methods. */
...@@ -79,16 +70,10 @@ const char* Logger::GetProcessMinName() ...@@ -79,16 +70,10 @@ const char* Logger::GetProcessMinName()
return Logger::processMinName.c_str(); return Logger::processMinName.c_str();
} }
inline
bool Logger::IsSyslogEnabled()
{
return Logger::isSyslogEnabled;
}
inline inline
bool Logger::HasDebugLevel() bool Logger::HasDebugLevel()
{ {
return (LOG_DEBUG == MS_GET_LOG_LEVEL); return (MS_LOG_LEVEL_DEBUG == MS_GET_LOG_LEVEL);
} }
// NOTE: Each file including Logger.h MUST define its own MS_CLASS macro. // NOTE: Each file including Logger.h MUST define its own MS_CLASS macro.
...@@ -105,53 +90,22 @@ bool Logger::HasDebugLevel() ...@@ -105,53 +90,22 @@ bool Logger::HasDebugLevel()
#endif #endif
#define _MS_TO_STDOUT() \ #define _MS_TO_STDOUT() \
if (!Logger::IsSyslogEnabled()) \ std::fprintf(stdout, _MS_LOG_STR "\n", _MS_LOG_ARG); \
{ \ fflush(stdout);
std::fprintf(stdout, _MS_LOG_STR "\n", _MS_LOG_ARG); \
fflush(stdout); \
}
#define _MS_TO_STDOUT_DESC(desc, ...) \ #define _MS_TO_STDOUT_DESC(desc, ...) \
if (!Logger::IsSyslogEnabled()) \ std::fprintf(stdout, _MS_LOG_STR_DESC desc "\n", _MS_LOG_ARG, ##__VA_ARGS__); \
{ \ fflush(stdout); \
std::fprintf(stdout, _MS_LOG_STR_DESC desc "\n", _MS_LOG_ARG, ##__VA_ARGS__); \
fflush(stdout); \
}
#define _MS_TO_STDERR_DESC(desc, ...) \ #define _MS_TO_STDERR_DESC(desc, ...) \
if (!Logger::IsSyslogEnabled()) \ std::fprintf(stderr, _MS_LOG_STR_DESC desc "\n", _MS_LOG_ARG, ##__VA_ARGS__); \
{ \ fflush(stderr); \
std::fprintf(stderr, _MS_LOG_STR_DESC desc "\n", _MS_LOG_ARG, ##__VA_ARGS__); \
fflush(stderr); \
}
#define _MS_TO_SYSLOG(severity, prefix) \
if (Logger::IsSyslogEnabled()) \
syslog(severity, prefix _MS_LOG_STR, _MS_LOG_ARG);
#define _MS_TO_SYSLOG_DESC(severity, prefix, desc, ...) \
if (Logger::IsSyslogEnabled()) \
syslog(severity, prefix _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__);
/*
* Log levels in syslog.h:
*
* LOG_EMERG 0 system is unusable
* LOG_ALERT 1 action must be taken immediately
* LOG_CRIT 2 critical conditions
* LOG_ERR 3 error conditions
* LOG_WARNING 4 warning conditions
* LOG_NOTICE 5 normal but significant condition
* LOG_INFO 6 informational
* LOG_DEBUG 7 debug-level messages
*/
#ifdef MS_DEVEL #ifdef MS_DEVEL
#define MS_TRACE() \ #define MS_TRACE() \
do \ do \
{ \ { \
_MS_TO_STDOUT(); \ _MS_TO_STDOUT(); \
_MS_TO_SYSLOG(LOG_DEBUG, "TRACE "); \
} \ } \
while (0) while (0)
#else #else
...@@ -161,10 +115,9 @@ bool Logger::HasDebugLevel() ...@@ -161,10 +115,9 @@ bool Logger::HasDebugLevel()
#define MS_DEBUG(desc, ...) \ #define MS_DEBUG(desc, ...) \
do \ do \
{ \ { \
if (LOG_DEBUG == MS_GET_LOG_LEVEL) \ if (MS_LOG_LEVEL_DEBUG == MS_GET_LOG_LEVEL) \
{ \ { \
_MS_TO_STDOUT_DESC(desc, ##__VA_ARGS__); \ _MS_TO_STDOUT_DESC(desc, ##__VA_ARGS__); \
_MS_TO_SYSLOG_DESC(LOG_DEBUG, "DEBUG ", desc, ##__VA_ARGS__); \
} \ } \
} \ } \
while (0) while (0)
...@@ -172,21 +125,9 @@ bool Logger::HasDebugLevel() ...@@ -172,21 +125,9 @@ bool Logger::HasDebugLevel()
#define MS_INFO(desc, ...) \ #define MS_INFO(desc, ...) \
do \ do \
{ \ { \
if (LOG_INFO <= MS_GET_LOG_LEVEL) \ if (MS_LOG_LEVEL_INFO <= MS_GET_LOG_LEVEL) \
{ \
_MS_TO_STDOUT_DESC(desc, ##__VA_ARGS__); \
_MS_TO_SYSLOG_DESC(LOG_INFO, "INFO ", desc, ##__VA_ARGS__); \
} \
} \
while (0)
#define MS_NOTICE(desc, ...) \
do \
{ \
if (LOG_NOTICE <= MS_GET_LOG_LEVEL) \
{ \ { \
_MS_TO_STDOUT_DESC(desc, ##__VA_ARGS__); \ _MS_TO_STDOUT_DESC(desc, ##__VA_ARGS__); \
_MS_TO_SYSLOG_DESC(LOG_NOTICE, "NOTICE ", desc, ##__VA_ARGS__); \
} \ } \
} \ } \
while (0) while (0)
...@@ -194,10 +135,9 @@ bool Logger::HasDebugLevel() ...@@ -194,10 +135,9 @@ bool Logger::HasDebugLevel()
#define MS_WARN(desc, ...) \ #define MS_WARN(desc, ...) \
do \ do \
{ \ { \
if (LOG_WARNING <= MS_GET_LOG_LEVEL) \ if (MS_LOG_LEVEL_WARN <= MS_GET_LOG_LEVEL) \
{ \ { \
_MS_TO_STDERR_DESC(desc, ##__VA_ARGS__); \ _MS_TO_STDERR_DESC(desc, ##__VA_ARGS__); \
_MS_TO_SYSLOG_DESC(LOG_WARNING, "WARN ", desc, ##__VA_ARGS__); \
} \ } \
} \ } \
while (0) while (0)
...@@ -206,22 +146,13 @@ bool Logger::HasDebugLevel() ...@@ -206,22 +146,13 @@ bool Logger::HasDebugLevel()
do \ do \
{ \ { \
_MS_TO_STDERR_DESC(desc, ##__VA_ARGS__); \ _MS_TO_STDERR_DESC(desc, ##__VA_ARGS__); \
_MS_TO_SYSLOG_DESC(LOG_ERR, "ERROR ", desc, ##__VA_ARGS__); \
} \
while (0)
#define MS_CRIT(desc, ...) \
do \
{ \
_MS_TO_STDERR_DESC(desc, ##__VA_ARGS__); \
_MS_TO_SYSLOG_DESC(LOG_ERR, "CRIT ", desc, ##__VA_ARGS__); \
} \ } \
while (0) while (0)
#define MS_EXIT_SUCCESS(desc, ...) \ #define MS_EXIT_SUCCESS(desc, ...) \
do \ do \
{ \ { \
MS_NOTICE("SUCCESS EXIT | " desc, ##__VA_ARGS__); \ MS_INFO("SUCCESS EXIT | " desc, ##__VA_ARGS__); \
std::_Exit(EXIT_SUCCESS); \ std::_Exit(EXIT_SUCCESS); \
} \ } \
while (0) while (0)
...@@ -229,7 +160,7 @@ bool Logger::HasDebugLevel() ...@@ -229,7 +160,7 @@ bool Logger::HasDebugLevel()
#define MS_EXIT_FAILURE(desc, ...) \ #define MS_EXIT_FAILURE(desc, ...) \
do \ do \
{ \ { \
MS_CRIT("FAILURE EXIT | " desc, ##__VA_ARGS__); \ MS_ERROR("FAILURE EXIT | " desc, ##__VA_ARGS__); \
std::_Exit(EXIT_FAILURE); \ std::_Exit(EXIT_FAILURE); \
} \ } \
while (0) while (0)
...@@ -237,7 +168,7 @@ bool Logger::HasDebugLevel() ...@@ -237,7 +168,7 @@ bool Logger::HasDebugLevel()
#define MS_ABORT(desc, ...) \ #define MS_ABORT(desc, ...) \
do \ do \
{ \ { \
MS_CRIT("ABORT | " desc, ##__VA_ARGS__); \ MS_ERROR("ABORT | " desc, ##__VA_ARGS__); \
std::abort(); \ std::abort(); \
} \ } \
while (0) while (0)
......
#ifndef MS_RTC_DTLS_ROLE_H #ifndef MS_RTC_DTLS_ROLE_H
#define MS_RTC_DTLS_ROLE_H #define MS_RTC_DTLS_ROLE_H
namespace RTC { namespace RTC
{
enum class DTLSRole enum class DTLSRole
{ {
NONE = 0, NONE = 0,
SERVER = 1, SERVER = 1,
CLIENT CLIENT
}; };
} // namespace RTC }
#endif #endif
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
#include "common.h" #include "common.h"
#include <map> #include <map>
#include <string> #include <string>
extern "C"
{
#include <syslog.h>
}
class Settings class Settings
{ {
...@@ -15,23 +11,16 @@ public: ...@@ -15,23 +11,16 @@ public:
// Struct holding the configuration. // Struct holding the configuration.
struct Configuration struct Configuration
{ {
unsigned int logLevel { LOG_DEBUG }; unsigned int logLevel { MS_LOG_LEVEL_DEBUG };
bool useSyslog { false }; std::string rtcListenIPv4;
unsigned int syslogFacility { LOG_USER }; std::string rtcListenIPv6;
MS_PORT rtcMinPort { 10000 };
struct MS_PORT rtcMaxPort { 59999 };
{ std::string dtlsCertificateFile;
std::string listenIPv4; std::string dtlsPrivateKeyFile;
std::string listenIPv6; // Private fields.
MS_PORT minPort { 10000 }; bool hasIPv4 { false };
MS_PORT maxPort { 59999 }; bool hasIPv6 { false };
std::string dtlsCertificateFile;
std::string dtlsPrivateKeyFile;
// Private fields.
bool hasIPv4 { false };
bool hasIPv6 { false };
} RTC;
}; };
public: public:
...@@ -41,7 +30,6 @@ public: ...@@ -41,7 +30,6 @@ public:
private: private:
static void SetDefaultRtcListenIP(int requested_family); static void SetDefaultRtcListenIP(int requested_family);
static void SetLogLevel(std::string &level); static void SetLogLevel(std::string &level);
static void SetSyslogFacility(std::string &facility);
static void SetRtcListenIPv4(const std::string &ip); static void SetRtcListenIPv4(const std::string &ip);
static void SetRtcListenIPv6(const std::string &ip); static void SetRtcListenIPv6(const std::string &ip);
static void SetRtcPorts(); static void SetRtcPorts();
...@@ -53,8 +41,6 @@ public: ...@@ -53,8 +41,6 @@ public:
private: private:
static std::map<std::string, unsigned int> string2LogLevel; static std::map<std::string, unsigned int> string2LogLevel;
static std::map<unsigned int, std::string> logLevel2String; static std::map<unsigned int, std::string> logLevel2String;
static std::map<std::string, unsigned int> string2SyslogFacility;
static std::map<unsigned int, std::string> syslogFacility2String;
}; };
#endif #endif
...@@ -7,9 +7,15 @@ ...@@ -7,9 +7,15 @@
#include <netinet/in.h> // sockaddr_in, sockaddr_in6 #include <netinet/in.h> // sockaddr_in, sockaddr_in6
#include <arpa/inet.h> // htonl(), htons(), ntohl(), ntohs() #include <arpa/inet.h> // htonl(), htons(), ntohl(), ntohs()
#define MS_APP_NAME "mediasoup"
#define MS_PROCESS_NAME "mediasoup-worker" #define MS_PROCESS_NAME "mediasoup-worker"
#define MS_PROCESS_MIN_NAME "worker" #define MS_PROCESS_MIN_NAME "worker"
#define MS_LOG_LEVEL_DEBUG 3
#define MS_LOG_LEVEL_INFO 2
#define MS_LOG_LEVEL_WARN 1
#define MS_LOG_LEVEL_ERROR 0
#define MS_BYTE uint8_t #define MS_BYTE uint8_t
#define MS_2BYTES uint16_t #define MS_2BYTES uint16_t
#define MS_4BYTES uint32_t #define MS_4BYTES uint32_t
......
...@@ -57,5 +57,5 @@ void DepLibSRTP::ClassDestroy() ...@@ -57,5 +57,5 @@ void DepLibSRTP::ClassDestroy()
err = srtp_shutdown(); err = srtp_shutdown();
if (DepLibSRTP::IsError(err)) if (DepLibSRTP::IsError(err))
MS_CRIT("srtp_shutdown() failed: %s", DepLibSRTP::GetErrorString(err)); MS_ERROR("srtp_shutdown() failed: %s", DepLibSRTP::GetErrorString(err));
} }
...@@ -25,5 +25,5 @@ void DepUsrSCTP::ClassDestroy() ...@@ -25,5 +25,5 @@ void DepUsrSCTP::ClassDestroy()
// Free usrsctp. // Free usrsctp.
err = usrsctp_finish(); err = usrsctp_finish();
if (err) if (err)
MS_CRIT("usrsctp_finish() failed"); MS_ERROR("usrsctp_finish() failed");
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
std::string Logger::processName; std::string Logger::processName;
std::string Logger::processMinName; std::string Logger::processMinName;
bool Logger::isSyslogEnabled = false;
/* Static methods. */ /* Static methods. */
...@@ -17,14 +16,3 @@ void Logger::Init(const std::string id) ...@@ -17,14 +16,3 @@ void Logger::Init(const std::string id)
MS_TRACE(); MS_TRACE();
} }
void Logger::EnableSyslog()
{
MS_TRACE();
MS_DEBUG("logging to Syslog");
openlog(MS_PROCESS_NAME, (LOG_PID), Settings::configuration.syslogFacility);
Logger::isSyslogEnabled = true;
}
...@@ -62,17 +62,17 @@ void Loop::onSignal(SignalsHandler* signalsHandler, int signum) ...@@ -62,17 +62,17 @@ void Loop::onSignal(SignalsHandler* signalsHandler, int signum)
switch (signum) switch (signum)
{ {
case SIGINT: case SIGINT:
MS_NOTICE("signal INT received, exiting"); MS_DEBUG("signal INT received, exiting");
Close(); Close();
break; break;
case SIGTERM: case SIGTERM:
MS_NOTICE("signal TERM received, exiting"); MS_DEBUG("signal TERM received, exiting");
Close(); Close();
break; break;
default: default:
MS_ERROR("received a signal (with signum %d) for which there is no handling code", signum); MS_WARN("received a signal (with signum %d) for which there is no handling code", signum);
} }
} }
......
...@@ -84,7 +84,7 @@ namespace RTC ...@@ -84,7 +84,7 @@ namespace RTC
MS_TRACE(); MS_TRACE();
// Generate a X509 certificate and private key (unless PEM files are provided). // Generate a X509 certificate and private key (unless PEM files are provided).
if (Settings::configuration.RTC.dtlsCertificateFile.empty() || Settings::configuration.RTC.dtlsPrivateKeyFile.empty()) if (Settings::configuration.dtlsCertificateFile.empty() || Settings::configuration.dtlsPrivateKeyFile.empty())
GenerateCertificateAndPrivateKey(); GenerateCertificateAndPrivateKey();
else else
ReadCertificateAndPrivateKeyFromFiles(); ReadCertificateAndPrivateKeyFromFiles();
...@@ -207,8 +207,8 @@ namespace RTC ...@@ -207,8 +207,8 @@ namespace RTC
LOG_OPENSSL_ERROR("X509_get_subject_name() failed"); LOG_OPENSSL_ERROR("X509_get_subject_name() failed");
goto error; goto error;
} }
X509_NAME_add_entry_by_txt(cert_name, "O", MBSTRING_ASC, (unsigned char *)MS_PROCESS_NAME, -1, -1, 0); X509_NAME_add_entry_by_txt(cert_name, "O", MBSTRING_ASC, (unsigned char *)MS_APP_NAME, -1, -1, 0);
X509_NAME_add_entry_by_txt(cert_name, "CN", MBSTRING_ASC, (unsigned char *)MS_PROCESS_NAME, -1, -1, 0); X509_NAME_add_entry_by_txt(cert_name, "CN", MBSTRING_ASC, (unsigned char *)MS_APP_NAME, -1, -1, 0);
// It is self signed so set the issuer name to be the same as the subject. // It is self signed so set the issuer name to be the same as the subject.
ret = X509_set_issuer_name(DTLSHandler::certificate, cert_name); ret = X509_set_issuer_name(DTLSHandler::certificate, cert_name);
...@@ -249,7 +249,7 @@ namespace RTC ...@@ -249,7 +249,7 @@ namespace RTC
FILE* file = nullptr; FILE* file = nullptr;
file = fopen(Settings::configuration.RTC.dtlsCertificateFile.c_str(), "r"); file = fopen(Settings::configuration.dtlsCertificateFile.c_str(), "r");
if (!file) if (!file)
{ {
MS_ERROR("error reading DTLS certificate file: %s", std::strerror(errno)); MS_ERROR("error reading DTLS certificate file: %s", std::strerror(errno));
...@@ -263,7 +263,7 @@ namespace RTC ...@@ -263,7 +263,7 @@ namespace RTC
} }
fclose(file); fclose(file);
file = fopen(Settings::configuration.RTC.dtlsPrivateKeyFile.c_str(), "r"); file = fopen(Settings::configuration.dtlsPrivateKeyFile.c_str(), "r");
if (!file) if (!file)
{ {
MS_ERROR("error reading DTLS private key file: %s", std::strerror(errno)); MS_ERROR("error reading DTLS private key file: %s", std::strerror(errno));
...@@ -694,7 +694,7 @@ namespace RTC ...@@ -694,7 +694,7 @@ namespace RTC
{ {
if (!this->isConnected) if (!this->isConnected)
{ {
MS_NOTICE("ignoring application data received while DTLS not fully connected"); MS_DEBUG("ignoring application data received while DTLS not fully connected");
return; return;
} }
...@@ -760,33 +760,28 @@ namespace RTC ...@@ -760,33 +760,28 @@ namespace RTC
switch (err) switch (err)
{ {
case SSL_ERROR_NONE: case SSL_ERROR_NONE:
// MS_DEBUG("SSL status: SSL_ERROR_NONE");
break; break;
case SSL_ERROR_SSL: case SSL_ERROR_SSL:
// MS_NOTICE("SSL status: SSL_ERROR_SSL");
LOG_OPENSSL_ERROR("SSL status: SSL_ERROR_SSL"); LOG_OPENSSL_ERROR("SSL status: SSL_ERROR_SSL");
break; break;
case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_READ:
// MS_DEBUG("SSL status: SSL_ERROR_WANT_READ");
break; break;
case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_WRITE:
MS_DEBUG("SSL status: SSL_ERROR_WANT_WRITE"); MS_DEBUG("SSL status: SSL_ERROR_WANT_WRITE");
break; break;
case SSL_ERROR_WANT_X509_LOOKUP: case SSL_ERROR_WANT_X509_LOOKUP:
MS_NOTICE("SSL status: SSL_ERROR_WANT_X509_LOOKUP"); MS_DEBUG("SSL status: SSL_ERROR_WANT_X509_LOOKUP");
break; break;
case SSL_ERROR_SYSCALL: case SSL_ERROR_SYSCALL:
// MS_WARN("SSL status: SSL_ERROR_SYSCALL");
LOG_OPENSSL_ERROR("SSL status: SSL_ERROR_SYSCALL"); LOG_OPENSSL_ERROR("SSL status: SSL_ERROR_SYSCALL");
break; break;
case SSL_ERROR_ZERO_RETURN: case SSL_ERROR_ZERO_RETURN:
// MS_DEBUG("SSL status: SSL_ERROR_ZERO_RETURN");
break; break;
case SSL_ERROR_WANT_CONNECT: case SSL_ERROR_WANT_CONNECT:
MS_WARN("SSL status: SSL_ERROR_WANT_CONNECT"); MS_DEBUG("SSL status: SSL_ERROR_WANT_CONNECT");
break; break;
case SSL_ERROR_WANT_ACCEPT: case SSL_ERROR_WANT_ACCEPT:
MS_WARN("SSL status: SSL_ERROR_WANT_ACCEPT"); MS_DEBUG("SSL status: SSL_ERROR_WANT_ACCEPT");
break; break;
} }
...@@ -822,7 +817,7 @@ namespace RTC ...@@ -822,7 +817,7 @@ namespace RTC
} }
else else
{ {
MS_NOTICE("DTLS connection failed"); MS_DEBUG("DTLS connection failed");
// Notify to the listener. // Notify to the listener.
this->listener->onDTLSFailed(this); this->listener->onDTLSFailed(this);
...@@ -949,7 +944,7 @@ namespace RTC ...@@ -949,7 +944,7 @@ namespace RTC
} }
else else
{ {
MS_NOTICE("SRTP profile not negotiated"); MS_DEBUG("SRTP profile not negotiated");
} }
} }
...@@ -1021,7 +1016,7 @@ namespace RTC ...@@ -1021,7 +1016,7 @@ namespace RTC
if (this->remoteFingerprint.compare(hex_fingerprint) != 0) if (this->remoteFingerprint.compare(hex_fingerprint) != 0)
{ {
MS_NOTICE("fingerprint in the remote certificate (%s) does not match the announced one (%s)", hex_fingerprint, this->remoteFingerprint.c_str()); MS_DEBUG("fingerprint in the remote certificate (%s) does not match the announced one (%s)", hex_fingerprint, this->remoteFingerprint.c_str());
return false; return false;
} }
...@@ -1145,7 +1140,7 @@ namespace RTC ...@@ -1145,7 +1140,7 @@ namespace RTC
else if (where & SSL_CB_EXIT) else if (where & SSL_CB_EXIT)
{ {
if (ret == 0) if (ret == 0)
MS_NOTICE("role: %s | failed in: %s", role, SSL_state_string_long(this->ssl)); MS_DEBUG("role: %s | failed in: %s", role, SSL_state_string_long(this->ssl));
else if (ret < 0) else if (ret < 0)
MS_DEBUG("role: %s | waiting for: %s", role, SSL_state_string_long(this->ssl)); MS_DEBUG("role: %s | waiting for: %s", role, SSL_state_string_long(this->ssl));
} }
......
...@@ -126,7 +126,7 @@ namespace RTC ...@@ -126,7 +126,7 @@ namespace RTC
// The remote peer must be ICE controlling. // The remote peer must be ICE controlling.
if (msg->GetIceControlled()) if (msg->GetIceControlled())
{ {
MS_NOTICE("peer indicates ICE-CONTROLLED in STUN Binding Request => 487"); MS_DEBUG("peer indicates ICE-CONTROLLED in STUN Binding Request => 487");
// Reply 487 (Role Conflict). // Reply 487 (Role Conflict).
RTC::STUNMessage* response = msg->CreateErrorResponse(487); RTC::STUNMessage* response = msg->CreateErrorResponse(487);
......
...@@ -36,7 +36,7 @@ namespace RTC ...@@ -36,7 +36,7 @@ namespace RTC
{ {
RTC::UDPSocket* socket = RTC::UDPSocket::New(AF_INET); RTC::UDPSocket* socket = RTC::UDPSocket::New(AF_INET);
this->transport->AddUDPSocket(socket); this->transport->AddUDPSocket(socket);
MS_NOTICE("---- TEST: transport listens in IPv4 UDP '%s' : %u", socket->GetLocalIP().c_str(), socket->GetLocalPort()); MS_INFO("---- TEST: transport listens in IPv4 UDP '%s' : %u", socket->GetLocalIP().c_str(), socket->GetLocalPort());
} }
catch (const MediaSoupError &error) catch (const MediaSoupError &error)
{ {
...@@ -47,7 +47,7 @@ namespace RTC ...@@ -47,7 +47,7 @@ namespace RTC
{ {
RTC::TCPServer* server = RTC::TCPServer::New(AF_INET); RTC::TCPServer* server = RTC::TCPServer::New(AF_INET);
this->transport->AddTCPServer(server); this->transport->AddTCPServer(server);
MS_NOTICE("---- TEST: transport listens in IPv4 TCP '%s' : %u", server->GetLocalIP().c_str(), server->GetLocalPort()); MS_INFO("---- TEST: transport listens in IPv4 TCP '%s' : %u", server->GetLocalIP().c_str(), server->GetLocalPort());
} }
catch (const MediaSoupError &error) catch (const MediaSoupError &error)
{ {
...@@ -112,4 +112,4 @@ namespace RTC ...@@ -112,4 +112,4 @@ namespace RTC
this->listener->onRTCPPacket(this, packet); this->listener->onRTCPPacket(this, packet);
} }
} // namespace RTC }
...@@ -51,7 +51,7 @@ namespace RTC ...@@ -51,7 +51,7 @@ namespace RTC
break; break;
} }
MS_NOTICE("SSRC %llu: %s", (unsigned long long)data->stream->ssrc, event_desc); MS_WARN("SSRC %llu: %s", (unsigned long long)data->stream->ssrc, event_desc);
} }
/* Instance methods. */ /* Instance methods. */
......
...@@ -41,22 +41,22 @@ namespace RTC ...@@ -41,22 +41,22 @@ namespace RTC
int err; int err;
if (!Settings::configuration.RTC.listenIPv4.empty()) if (!Settings::configuration.rtcListenIPv4.empty())
{ {
err = uv_ip4_addr(Settings::configuration.RTC.listenIPv4.c_str(), 0, (struct sockaddr_in*)&RTC::TCPServer::sockaddrStorageIPv4); err = uv_ip4_addr(Settings::configuration.rtcListenIPv4.c_str(), 0, (struct sockaddr_in*)&RTC::TCPServer::sockaddrStorageIPv4);
if (err) if (err)
MS_ABORT("uv_ipv4_addr() failed: %s", uv_strerror(err)); MS_ABORT("uv_ipv4_addr() failed: %s", uv_strerror(err));
} }
if (!Settings::configuration.RTC.listenIPv6.empty()) if (!Settings::configuration.rtcListenIPv6.empty())
{ {
err = uv_ip6_addr(Settings::configuration.RTC.listenIPv6.c_str(), 0, (struct sockaddr_in6*)&RTC::TCPServer::sockaddrStorageIPv6); err = uv_ip6_addr(Settings::configuration.rtcListenIPv6.c_str(), 0, (struct sockaddr_in6*)&RTC::TCPServer::sockaddrStorageIPv6);
if (err) if (err)
MS_ABORT("uv_ipv6_addr() failed: %s", uv_strerror(err)); MS_ABORT("uv_ipv6_addr() failed: %s", uv_strerror(err));
} }
TCPServer::minPort = Settings::configuration.RTC.minPort; TCPServer::minPort = Settings::configuration.rtcMinPort;
TCPServer::maxPort = Settings::configuration.RTC.maxPort; TCPServer::maxPort = Settings::configuration.rtcMaxPort;
MS_PORT i = RTC::TCPServer::minPort; MS_PORT i = RTC::TCPServer::minPort;
do do
...@@ -98,9 +98,9 @@ namespace RTC ...@@ -98,9 +98,9 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
if (address_family == AF_INET && !Settings::configuration.RTC.hasIPv4) if (address_family == AF_INET && !Settings::configuration.hasIPv4)
MS_THROW_ERROR("IPv4 family not available for RTC"); MS_THROW_ERROR("IPv4 family not available for RTC");
else if (address_family == AF_INET6 && !Settings::configuration.RTC.hasIPv6) else if (address_family == AF_INET6 && !Settings::configuration.hasIPv6)
MS_THROW_ERROR("IPv6 family not available for RTC"); MS_THROW_ERROR("IPv6 family not available for RTC");
int err; int err;
...@@ -121,14 +121,14 @@ namespace RTC ...@@ -121,14 +121,14 @@ namespace RTC
available_ports = &RTC::TCPServer::availableIPv4Ports; available_ports = &RTC::TCPServer::availableIPv4Ports;
first_bind_addr = RTC::TCPServer::sockaddrStorageIPv4; first_bind_addr = RTC::TCPServer::sockaddrStorageIPv4;
second_bind_addr = RTC::TCPServer::sockaddrStorageIPv4; second_bind_addr = RTC::TCPServer::sockaddrStorageIPv4;
listenIP = Settings::configuration.RTC.listenIPv4.c_str(); listenIP = Settings::configuration.rtcListenIPv4.c_str();
break; break;
case AF_INET6: case AF_INET6:
available_ports = &RTC::TCPServer::availableIPv6Ports; available_ports = &RTC::TCPServer::availableIPv6Ports;
first_bind_addr = RTC::TCPServer::sockaddrStorageIPv6; first_bind_addr = RTC::TCPServer::sockaddrStorageIPv6;
second_bind_addr = RTC::TCPServer::sockaddrStorageIPv6; second_bind_addr = RTC::TCPServer::sockaddrStorageIPv6;
listenIP = Settings::configuration.RTC.listenIPv6.c_str(); listenIP = Settings::configuration.rtcListenIPv6.c_str();
// Don't also bind into IPv4 when listening in IPv6. // Don't also bind into IPv4 when listening in IPv6.
flags |= UV_TCP_IPV6ONLY; flags |= UV_TCP_IPV6ONLY;
break; break;
......
...@@ -427,7 +427,7 @@ namespace RTC ...@@ -427,7 +427,7 @@ namespace RTC
RTC::RTPPacket* packet = RTC::RTPPacket::Parse(data, len); RTC::RTPPacket* packet = RTC::RTPPacket::Parse(data, len);
if (!packet) if (!packet)
{ {
MS_NOTICE("data received via %s is not a valid RTP packet", TRANSPORT_NAME(source)); MS_DEBUG("data received via %s is not a valid RTP packet", TRANSPORT_NAME(source));
return; return;
} }
// MS_DEBUG("valid RTP packet received via %s [ssrc: %llu | payload: %hu | size: %zu]", // MS_DEBUG("valid RTP packet received via %s [ssrc: %llu | payload: %hu | size: %zu]",
...@@ -460,7 +460,7 @@ namespace RTC ...@@ -460,7 +460,7 @@ namespace RTC
if (!this->srtpRecvSession->DecryptSRTCP(data, &len)) if (!this->srtpRecvSession->DecryptSRTCP(data, &len))
{ {
MS_WARN("error decrypting SRTCP packet received via %s: %s", TRANSPORT_NAME(source), this->srtpRecvSession->GetLastErrorDesc()); MS_DEBUG("error decrypting SRTCP packet received via %s: %s", TRANSPORT_NAME(source), this->srtpRecvSession->GetLastErrorDesc());
return; return;
} }
} }
...@@ -468,7 +468,7 @@ namespace RTC ...@@ -468,7 +468,7 @@ namespace RTC
RTC::RTCPPacket* packet = RTC::RTCPPacket::Parse(data, len); RTC::RTCPPacket* packet = RTC::RTCPPacket::Parse(data, len);
if (!packet) if (!packet)
{ {
MS_NOTICE("data received via %s is not a valid RTCP packet", TRANSPORT_NAME(source)); MS_DEBUG("data received via %s is not a valid RTCP packet", TRANSPORT_NAME(source));
return; return;
} }
// MS_DEBUG("valid RTCP packet received via %s", TRANSPORT_NAME(source)); // MS_DEBUG("valid RTCP packet received via %s", TRANSPORT_NAME(source));
...@@ -598,7 +598,7 @@ namespace RTC ...@@ -598,7 +598,7 @@ namespace RTC
if (!this->sendingSource) if (!this->sendingSource)
{ {
MS_ERROR("no sending address set, cannot send DTLS packet"); MS_WARN("no sending address set, cannot send DTLS packet");
return; return;
} }
...@@ -630,7 +630,7 @@ namespace RTC ...@@ -630,7 +630,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
MS_NOTICE("DTLS failed"); MS_DEBUG("DTLS failed");
Reset(); Reset();
Dump(); Dump();
......
...@@ -41,22 +41,22 @@ namespace RTC ...@@ -41,22 +41,22 @@ namespace RTC
int err; int err;
if (Settings::configuration.RTC.hasIPv4) if (Settings::configuration.hasIPv4)
{ {
err = uv_ip4_addr(Settings::configuration.RTC.listenIPv4.c_str(), 0, (struct sockaddr_in*)&RTC::UDPSocket::sockaddrStorageIPv4); err = uv_ip4_addr(Settings::configuration.rtcListenIPv4.c_str(), 0, (struct sockaddr_in*)&RTC::UDPSocket::sockaddrStorageIPv4);
if (err) if (err)
MS_ABORT("uv_ipv4_addr() failed: %s", uv_strerror(err)); MS_ABORT("uv_ipv4_addr() failed: %s", uv_strerror(err));
} }
if (Settings::configuration.RTC.hasIPv6) if (Settings::configuration.hasIPv6)
{ {
err = uv_ip6_addr(Settings::configuration.RTC.listenIPv6.c_str(), 0, (struct sockaddr_in6*)&RTC::UDPSocket::sockaddrStorageIPv6); err = uv_ip6_addr(Settings::configuration.rtcListenIPv6.c_str(), 0, (struct sockaddr_in6*)&RTC::UDPSocket::sockaddrStorageIPv6);
if (err) if (err)
MS_ABORT("uv_ipv6_addr() failed: %s", uv_strerror(err)); MS_ABORT("uv_ipv6_addr() failed: %s", uv_strerror(err));
} }
UDPSocket::minPort = Settings::configuration.RTC.minPort; UDPSocket::minPort = Settings::configuration.rtcMinPort;
UDPSocket::maxPort = Settings::configuration.RTC.maxPort; UDPSocket::maxPort = Settings::configuration.rtcMaxPort;
MS_PORT i = RTC::UDPSocket::minPort; MS_PORT i = RTC::UDPSocket::minPort;
do do
...@@ -98,9 +98,9 @@ namespace RTC ...@@ -98,9 +98,9 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
if (address_family == AF_INET && !Settings::configuration.RTC.hasIPv4) if (address_family == AF_INET && !Settings::configuration.hasIPv4)
MS_THROW_ERROR("IPv4 family not available for RTC"); MS_THROW_ERROR("IPv4 family not available for RTC");
else if (address_family == AF_INET6 && !Settings::configuration.RTC.hasIPv6) else if (address_family == AF_INET6 && !Settings::configuration.hasIPv6)
MS_THROW_ERROR("IPv6 family not available for RTC"); MS_THROW_ERROR("IPv6 family not available for RTC");
int err; int err;
...@@ -121,14 +121,14 @@ namespace RTC ...@@ -121,14 +121,14 @@ namespace RTC
available_ports = &RTC::UDPSocket::availableIPv4Ports; available_ports = &RTC::UDPSocket::availableIPv4Ports;
first_bind_addr = RTC::UDPSocket::sockaddrStorageIPv4; first_bind_addr = RTC::UDPSocket::sockaddrStorageIPv4;
second_bind_addr = RTC::UDPSocket::sockaddrStorageIPv4; second_bind_addr = RTC::UDPSocket::sockaddrStorageIPv4;
listenIP = Settings::configuration.RTC.listenIPv4.c_str(); listenIP = Settings::configuration.rtcListenIPv4.c_str();
break; break;
case AF_INET6: case AF_INET6:
available_ports = &RTC::UDPSocket::availableIPv6Ports; available_ports = &RTC::UDPSocket::availableIPv6Ports;
first_bind_addr = RTC::UDPSocket::sockaddrStorageIPv6; first_bind_addr = RTC::UDPSocket::sockaddrStorageIPv6;
second_bind_addr = RTC::UDPSocket::sockaddrStorageIPv6; second_bind_addr = RTC::UDPSocket::sockaddrStorageIPv6;
listenIP = Settings::configuration.RTC.listenIPv6.c_str(); listenIP = Settings::configuration.rtcListenIPv6.c_str();
// Don't also bind into IPv4 when listening in IPv6. // Don't also bind into IPv4 when listening in IPv6.
flags |= UV_UDP_IPV6ONLY; flags |= UV_UDP_IPV6ONLY;
break; break;
......
差异被折叠。
...@@ -154,7 +154,7 @@ void TCPConnection::Write(const MS_BYTE* data, size_t len) ...@@ -154,7 +154,7 @@ void TCPConnection::Write(const MS_BYTE* data, size_t len)
// Error. Should not happen. // Error. Should not happen.
else if (written < 0) else if (written < 0)
{ {
MS_NOTICE("uv_try_write() failed: %s | closing the connection", uv_strerror(written)); MS_WARN("uv_try_write() failed: %s | closing the connection", uv_strerror(written));
Close(); Close();
return; return;
} }
...@@ -216,7 +216,7 @@ void TCPConnection::Write(const MS_BYTE* data1, size_t len1, const MS_BYTE* data ...@@ -216,7 +216,7 @@ void TCPConnection::Write(const MS_BYTE* data1, size_t len1, const MS_BYTE* data
// Error. Should not happen. // Error. Should not happen.
else if (written < 0) else if (written < 0)
{ {
MS_NOTICE("uv_try_write() failed: %s | closing the connection", uv_strerror(written)); MS_WARN("uv_try_write() failed: %s | closing the connection", uv_strerror(written));
Close(); Close();
return; return;
} }
...@@ -366,7 +366,7 @@ void TCPConnection::onUvRead(ssize_t nread, const uv_buf_t* buf) ...@@ -366,7 +366,7 @@ void TCPConnection::onUvRead(ssize_t nread, const uv_buf_t* buf)
// Some error. // Some error.
else else
{ {
MS_NOTICE("read error: %s | closing the connection", uv_strerror(nread)); MS_INFO("read error: %s | closing the connection", uv_strerror(nread));
this->hasError = true; this->hasError = true;
// Close server side of the connection. // Close server side of the connection.
...@@ -389,7 +389,7 @@ void TCPConnection::onUvWriteError(int error) ...@@ -389,7 +389,7 @@ void TCPConnection::onUvWriteError(int error)
} }
else else
{ {
MS_NOTICE("write error: %s | closing the connection", uv_strerror(error)); MS_INFO("write error: %s | closing the connection", uv_strerror(error));
this->hasError = true; this->hasError = true;
} }
...@@ -406,7 +406,7 @@ void TCPConnection::onUvShutdown(uv_shutdown_t* req, int status) ...@@ -406,7 +406,7 @@ void TCPConnection::onUvShutdown(uv_shutdown_t* req, int status)
if (status == UV_EPIPE || status == UV_ENOTCONN || status == UV_ECANCELED) if (status == UV_EPIPE || status == UV_ENOTCONN || status == UV_ECANCELED)
MS_DEBUG("shutdown error: %s", uv_strerror(status)); MS_DEBUG("shutdown error: %s", uv_strerror(status));
else if (status) else if (status)
MS_NOTICE("shutdown error: %s", uv_strerror(status)); MS_INFO("shutdown error: %s", uv_strerror(status));
// Now do close the handle. // Now do close the handle.
uv_close((uv_handle_t*)this->uvHandle, (uv_close_cb)on_close); uv_close((uv_handle_t*)this->uvHandle, (uv_close_cb)on_close);
......
...@@ -192,7 +192,7 @@ void UDPSocket::Send(const MS_BYTE* data, size_t len, const struct sockaddr* add ...@@ -192,7 +192,7 @@ void UDPSocket::Send(const MS_BYTE* data, size_t len, const struct sockaddr* add
// Error, // Error,
else if (sent != UV_EAGAIN) else if (sent != UV_EAGAIN)
{ {
MS_ERROR("uv_udp_try_send() failed: %s", uv_strerror(sent)); MS_WARN("uv_udp_try_send() failed: %s", uv_strerror(sent));
return; return;
} }
// Otherwise UV_EAGAIN was returned so cannot send data at first time. Use uv_udp_send(). // Otherwise UV_EAGAIN was returned so cannot send data at first time. Use uv_udp_send().
...@@ -214,7 +214,7 @@ void UDPSocket::Send(const MS_BYTE* data, size_t len, const struct sockaddr* add ...@@ -214,7 +214,7 @@ void UDPSocket::Send(const MS_BYTE* data, size_t len, const struct sockaddr* add
{ {
// NOTE: uv_udp_send() returns error if a wrong INET family is given // NOTE: uv_udp_send() returns error if a wrong INET family is given
// (IPv6 destination on a IPv4 binded socket), so be ready. // (IPv6 destination on a IPv4 binded socket), so be ready.
MS_ERROR("uv_udp_send() failed: %s", uv_strerror(err)); MS_WARN("uv_udp_send() failed: %s", uv_strerror(err));
// Delete the UvSendData struct (which includes the uv_req_t and the store char[]). // Delete the UvSendData struct (which includes the uv_req_t and the store char[]).
std::free(send_data); std::free(send_data);
...@@ -344,7 +344,7 @@ void UDPSocket::onUvRecv(ssize_t nread, const uv_buf_t* buf, const struct sockad ...@@ -344,7 +344,7 @@ void UDPSocket::onUvRecv(ssize_t nread, const uv_buf_t* buf, const struct sockad
// Some error. // Some error.
else else
{ {
MS_NOTICE("read error: %s", uv_strerror(nread)); MS_INFO("read error: %s", uv_strerror(nread));
} }
} }
...@@ -356,7 +356,7 @@ void UDPSocket::onUvSendError(int error) ...@@ -356,7 +356,7 @@ void UDPSocket::onUvSendError(int error)
if (this->isClosing) if (this->isClosing)
return; return;
MS_NOTICE("send error: %s", uv_strerror(error)); MS_INFO("send error: %s", uv_strerror(error));
} }
inline inline
......
...@@ -144,7 +144,7 @@ void UnixStreamSocket::Write(const MS_BYTE* data, size_t len) ...@@ -144,7 +144,7 @@ void UnixStreamSocket::Write(const MS_BYTE* data, size_t len)
// Error. Should not happen. // Error. Should not happen.
else if (written < 0) else if (written < 0)
{ {
MS_NOTICE("uv_try_write() failed: %s | closing the connection", uv_strerror(written)); MS_WARN("uv_try_write() failed: %s | closing the connection", uv_strerror(written));
Close(); Close();
return; return;
} }
...@@ -257,7 +257,7 @@ void UnixStreamSocket::onUvRead(ssize_t nread, const uv_buf_t* buf) ...@@ -257,7 +257,7 @@ void UnixStreamSocket::onUvRead(ssize_t nread, const uv_buf_t* buf)
// Some error. // Some error.
else else
{ {
MS_NOTICE("read error: %s | closing the pipe", uv_strerror(nread)); MS_INFO("read error: %s | closing the pipe", uv_strerror(nread));
this->hasError = true; this->hasError = true;
// Close the socket. // Close the socket.
...@@ -280,7 +280,7 @@ void UnixStreamSocket::onUvWriteError(int error) ...@@ -280,7 +280,7 @@ void UnixStreamSocket::onUvWriteError(int error)
} }
else else
{ {
MS_NOTICE("write error: %s | closing the pipe", uv_strerror(error)); MS_INFO("write error: %s | closing the pipe", uv_strerror(error));
this->hasError = true; this->hasError = true;
} }
...@@ -297,7 +297,7 @@ void UnixStreamSocket::onUvShutdown(uv_shutdown_t* req, int status) ...@@ -297,7 +297,7 @@ void UnixStreamSocket::onUvShutdown(uv_shutdown_t* req, int status)
if (status == UV_EPIPE || status == UV_ENOTCONN || status == UV_ECANCELED) if (status == UV_EPIPE || status == UV_ENOTCONN || status == UV_ECANCELED)
MS_DEBUG("shutdown error: %s", uv_strerror(status)); MS_DEBUG("shutdown error: %s", uv_strerror(status));
else if (status) else if (status)
MS_NOTICE("shutdown error: %s", uv_strerror(status)); MS_INFO("shutdown error: %s", uv_strerror(status));
// Now do close the handle. // Now do close the handle.
uv_close((uv_handle_t*)this->uvHandle, (uv_close_cb)on_close); uv_close((uv_handle_t*)this->uvHandle, (uv_close_cb)on_close);
......
...@@ -24,8 +24,14 @@ static void init(); ...@@ -24,8 +24,14 @@ static void init();
static void ignoreSignals(); static void ignoreSignals();
static void destroy(); static void destroy();
int main(int argc, char* argv[]) int main(int argc, char* argv[], char** envp)
{ {
char** env;
for (env = envp; *env != 0; env++)
{
// printf("%s\n", *env);
}
std::string id; std::string id;
if (argc == 1) if (argc == 1)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论