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

Improve syntax

上级 7d62fea1
...@@ -6,8 +6,9 @@ const netstring = require('netstring'); ...@@ -6,8 +6,9 @@ const netstring = require('netstring');
const logger = require('../logger')('Channel'); const logger = require('../logger')('Channel');
const Request = require('./Request'); const Request = require('./Request');
// netstring length for a 65536 bytes payload
const MESSAGE_MAX_SIZE = 65543;
// Max time waiting for a response from the worker subprocess // Max time waiting for a response from the worker subprocess
const MESSAGE_MAX_SIZE = 65536;
const REQUEST_TIMEOUT = 5000; const REQUEST_TIMEOUT = 5000;
class Channel extends EventEmitter class Channel extends EventEmitter
......
...@@ -26,12 +26,12 @@ namespace Channel ...@@ -26,12 +26,12 @@ namespace Channel
void Reject(unsigned int status, const char* reason = nullptr); void Reject(unsigned int status, const char* reason = nullptr);
public: public:
// Passed by argument: // Passed by argument.
Channel::UnixStreamSocket* channel = nullptr; Channel::UnixStreamSocket* channel = nullptr;
unsigned int id; unsigned int id;
std::string method; std::string method;
Json::Value data; Json::Value data;
// Others: // Others.
bool replied = false; bool replied = false;
}; };
} }
......
...@@ -36,9 +36,9 @@ namespace Channel ...@@ -36,9 +36,9 @@ namespace Channel
virtual void userOnUnixStreamSocketClosed(bool is_closed_by_peer) override; virtual void userOnUnixStreamSocketClosed(bool is_closed_by_peer) override;
private: private:
// Passed by argument: // Passed by argument.
Listener* listener = nullptr; Listener* listener = nullptr;
// Others: // Others.
size_t msgStart = 0; // Where the latest message starts. size_t msgStart = 0; // Where the latest message starts.
}; };
} }
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "handles/SignalsHandler.h" #include "handles/SignalsHandler.h"
#include "Channel/UnixStreamSocket.h" #include "Channel/UnixStreamSocket.h"
#include "Channel/Request.h" #include "Channel/Request.h"
#include "RTC/Room.h"
#include <unordered_map>
class Loop : class Loop :
public SignalsHandler::Listener, public SignalsHandler::Listener,
...@@ -14,7 +16,7 @@ public: ...@@ -14,7 +16,7 @@ public:
Loop(); Loop();
~Loop(); ~Loop();
// TODO: IMHO this can be private. private:
void Close(); void Close();
/* Methods inherited from SignalsHandler::Listener. */ /* Methods inherited from SignalsHandler::Listener. */
...@@ -33,6 +35,8 @@ private: ...@@ -33,6 +35,8 @@ private:
Channel::UnixStreamSocket* channel = nullptr; Channel::UnixStreamSocket* channel = nullptr;
// Others. // Others.
bool closed = false; bool closed = false;
typedef std::unordered_map<unsigned int, RTC::Room*> Rooms;
Rooms rooms;
}; };
#endif #endif
...@@ -94,14 +94,14 @@ namespace RTC ...@@ -94,14 +94,14 @@ namespace RTC
virtual void onTimer(Timer* timer) override; virtual void onTimer(Timer* timer) override;
private: private:
// Passed by argument: // Passed by argument.
Listener* listener = nullptr; Listener* listener = nullptr;
// Allocated by this: // Allocated by this.
SSL* ssl = nullptr; SSL* ssl = nullptr;
BIO* sslBioFromNetwork = nullptr; // The BIO from which ssl reads. BIO* sslBioFromNetwork = nullptr; // The BIO from which ssl reads.
BIO* sslBioToNetwork = nullptr; // The BIO in which ssl writes. BIO* sslBioToNetwork = nullptr; // The BIO in which ssl writes.
Timer* timer = nullptr; Timer* timer = nullptr;
// Others: // Others.
RTC::DTLSRole role; RTC::DTLSRole role;
RTC::FingerprintHash remoteFingerprintHash = RTC::FingerprintHash::NONE; RTC::FingerprintHash remoteFingerprintHash = RTC::FingerprintHash::NONE;
std::string remoteFingerprint; std::string remoteFingerprint;
...@@ -140,6 +140,6 @@ namespace RTC ...@@ -140,6 +140,6 @@ namespace RTC
{ {
return this->isRunning; return this->isRunning;
} }
} // namespace RTC }
#endif #endif
...@@ -12,6 +12,6 @@ namespace RTC ...@@ -12,6 +12,6 @@ namespace RTC
SHA384, SHA384,
SHA512 SHA512
}; };
} // namespace RTC }
#endif #endif
...@@ -35,10 +35,10 @@ namespace RTC ...@@ -35,10 +35,10 @@ namespace RTC
void Close(); void Close();
private: private:
// Passed by argument: // Passed by argument.
Listener* listener = nullptr; Listener* listener = nullptr;
void* userData = nullptr; void* userData = nullptr;
// Others: // Others.
std::string localUsername; std::string localUsername;
std::string localPassword; std::string localPassword;
}; };
...@@ -68,6 +68,6 @@ namespace RTC ...@@ -68,6 +68,6 @@ namespace RTC
{ {
return this->userData; return this->userData;
} }
} // namespace RTC }
#endif #endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
namespace RTC namespace RTC
{ {
class Peer : RTC::Transport::Listener class Peer : public RTC::Transport::Listener
{ {
public: public:
class Listener class Listener
...@@ -34,10 +34,10 @@ namespace RTC ...@@ -34,10 +34,10 @@ namespace RTC
virtual void onRTCPPacket(RTC::Transport* transport, RTC::RTCPPacket* packet) override; virtual void onRTCPPacket(RTC::Transport* transport, RTC::RTCPPacket* packet) override;
private: private:
// Passed by argument: // Passed by argument.
Listener* listener = nullptr; Listener* listener = nullptr;
void* userData = nullptr; void* userData = nullptr;
// Others: // Others.
RTC::Transport* transport = nullptr; RTC::Transport* transport = nullptr;
}; };
...@@ -54,6 +54,6 @@ namespace RTC ...@@ -54,6 +54,6 @@ namespace RTC
{ {
return this->userData; return this->userData;
} }
} // namespace RTC }
#endif #endif
...@@ -36,7 +36,7 @@ namespace RTC ...@@ -36,7 +36,7 @@ namespace RTC
size_t GetLength(); size_t GetLength();
private: private:
// Passed by argument: // Passed by argument.
CommonHeader* header = nullptr; CommonHeader* header = nullptr;
MS_BYTE* raw = nullptr; MS_BYTE* raw = nullptr;
size_t length = 0; size_t length = 0;
...@@ -75,6 +75,6 @@ namespace RTC ...@@ -75,6 +75,6 @@ namespace RTC
{ {
return this->length; return this->length;
} }
} // namespace RTC }
#endif #endif
...@@ -66,7 +66,7 @@ namespace RTC ...@@ -66,7 +66,7 @@ namespace RTC
void Dump(); void Dump();
private: private:
// Passed by argument: // Passed by argument.
Header* header = nullptr; Header* header = nullptr;
MS_BYTE* csrcList = nullptr; MS_BYTE* csrcList = nullptr;
ExtensionHeader* extensionHeader = nullptr; ExtensionHeader* extensionHeader = nullptr;
...@@ -75,7 +75,7 @@ namespace RTC ...@@ -75,7 +75,7 @@ namespace RTC
MS_BYTE payloadPadding = 0; MS_BYTE payloadPadding = 0;
MS_BYTE* raw = nullptr; // Allocated when Serialize(). MS_BYTE* raw = nullptr; // Allocated when Serialize().
size_t length = 0; size_t length = 0;
// Others: // Others.
bool isSerialized = false; bool isSerialized = false;
}; };
...@@ -195,6 +195,6 @@ namespace RTC ...@@ -195,6 +195,6 @@ namespace RTC
{ {
return this->payloadLength; return this->payloadLength;
} }
} // namespace RTC }
#endif #endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
namespace RTC namespace RTC
{ {
class Room : RTC::Peer::Listener class Room : public RTC::Peer::Listener
{ {
public: public:
Room(); Room();
...@@ -22,10 +22,10 @@ namespace RTC ...@@ -22,10 +22,10 @@ namespace RTC
virtual void onRTCPPacket(RTC::Peer* peer, RTC::RTCPPacket* packet) override; virtual void onRTCPPacket(RTC::Peer* peer, RTC::RTCPPacket* packet) override;
private: private:
// Others: // Others.
typedef std::vector<RTC::Peer*> Peers; typedef std::vector<RTC::Peer*> Peers;
Peers peers; Peers peers;
}; };
} // namespace RTC }
#endif #endif
...@@ -9,6 +9,6 @@ namespace RTC ...@@ -9,6 +9,6 @@ namespace RTC
AES_CM_128_HMAC_SHA1_80 = 1, AES_CM_128_HMAC_SHA1_80 = 1,
AES_CM_128_HMAC_SHA1_32 AES_CM_128_HMAC_SHA1_32
}; };
} // namespace RTC }
#endif #endif
...@@ -38,7 +38,7 @@ namespace RTC ...@@ -38,7 +38,7 @@ namespace RTC
void Close(); void Close();
private: private:
// Allocated by this: // Allocated by this.
srtp_t session = nullptr; srtp_t session = nullptr;
// Others: // Others:
err_status_t lastError = (err_status_t)0; err_status_t lastError = (err_status_t)0;
...@@ -56,6 +56,6 @@ namespace RTC ...@@ -56,6 +56,6 @@ namespace RTC
return error_string; return error_string;
} }
} // namespace RTC }
#endif #endif
...@@ -93,13 +93,13 @@ namespace RTC ...@@ -93,13 +93,13 @@ namespace RTC
void Dump(); void Dump();
private: private:
// Passed by argument: // Passed by argument.
Class klass; // 2 bytes. Class klass; // 2 bytes.
Method method; // 2 bytes. Method method; // 2 bytes.
const MS_BYTE* transactionId = nullptr; // 12 bytes. const MS_BYTE* transactionId = nullptr; // 12 bytes.
MS_BYTE* raw = nullptr; // Allocated when Serialize(). MS_BYTE* raw = nullptr; // Allocated when Serialize().
size_t length = 0; // The full message size (including header). size_t length = 0; // The full message size (including header).
// Others: // Others.
bool isSerialized = false; bool isSerialized = false;
// STUN attributes. // STUN attributes.
std::string username; // Less than 513 bytes. std::string username; // Less than 513 bytes.
...@@ -269,6 +269,6 @@ namespace RTC ...@@ -269,6 +269,6 @@ namespace RTC
{ {
return this->hasFingerprint; return this->hasFingerprint;
} }
} // namespace RTC }
#endif #endif
...@@ -20,6 +20,6 @@ namespace RTC ...@@ -20,6 +20,6 @@ namespace RTC
MS_4BYTES ssrc = 0; MS_4BYTES ssrc = 0;
std::unordered_set<MS_BYTE> payloads; std::unordered_set<MS_BYTE> payloads;
}; };
} // namespace RTC }
#endif #endif
...@@ -29,11 +29,11 @@ namespace RTC ...@@ -29,11 +29,11 @@ namespace RTC
virtual void userOnTCPConnectionRead() override; virtual void userOnTCPConnectionRead() override;
private: private:
// Passed by argument: // Passed by argument.
Reader* reader = nullptr; Reader* reader = nullptr;
// Others: // Others.
size_t frameStart = 0; // Where the latest frame starts. size_t frameStart = 0; // Where the latest frame starts.
}; };
} // namespace RTC }
#endif #endif
...@@ -49,7 +49,7 @@ namespace RTC ...@@ -49,7 +49,7 @@ namespace RTC
virtual void userOnTCPServerClosed() override; virtual void userOnTCPServerClosed() override;
private: private:
// Passed by argument: // Passed by argument.
Listener* listener = nullptr; Listener* listener = nullptr;
RTC::TCPConnection::Reader* reader = nullptr; RTC::TCPConnection::Reader* reader = nullptr;
}; };
...@@ -62,6 +62,6 @@ namespace RTC ...@@ -62,6 +62,6 @@ namespace RTC
this->listener = listener; this->listener = listener;
this->reader = reader; this->reader = reader;
} }
} // namespace RTC }
#endif #endif
...@@ -141,17 +141,17 @@ namespace RTC ...@@ -141,17 +141,17 @@ namespace RTC
virtual void onDTLSApplicationData(RTC::DTLSHandler* dtlsHandler, const MS_BYTE* data, size_t len) override; virtual void onDTLSApplicationData(RTC::DTLSHandler* dtlsHandler, const MS_BYTE* data, size_t len) override;
private: private:
// Allocated by this: // Allocated by this.
RTC::ICEServer* iceServer = nullptr; RTC::ICEServer* iceServer = nullptr;
RTC::DTLSHandler* dtlsHandler = nullptr; RTC::DTLSHandler* dtlsHandler = nullptr;
RTC::SRTPSession* srtpRecvSession = nullptr; RTC::SRTPSession* srtpRecvSession = nullptr;
RTC::SRTPSession* srtpSendSession = nullptr; RTC::SRTPSession* srtpSendSession = nullptr;
// Passed by argument: // Passed by argument.
Listener* listener = nullptr; Listener* listener = nullptr;
std::vector<RTC::UDPSocket*> udpSockets; std::vector<RTC::UDPSocket*> udpSockets;
std::vector<RTC::TCPServer*> tcpServers; std::vector<RTC::TCPServer*> tcpServers;
void* userData = nullptr; void* userData = nullptr;
// Others: // Others.
int flags = 0; int flags = 0;
std::list<RTC::TransportSource> sources; std::list<RTC::TransportSource> sources;
RTC::TransportSource* sendingSource = nullptr; RTC::TransportSource* sendingSource = nullptr;
...@@ -326,6 +326,6 @@ namespace RTC ...@@ -326,6 +326,6 @@ namespace RTC
return false; return false;
} }
} // namespace RTC }
#endif #endif
...@@ -32,12 +32,12 @@ namespace RTC ...@@ -32,12 +32,12 @@ namespace RTC
void Dump(); void Dump();
private: private:
// Passed by argument: // Passed by argument.
RTC::UDPSocket* udpSocket = nullptr; RTC::UDPSocket* udpSocket = nullptr;
struct sockaddr* udpRemoteAddr = nullptr; struct sockaddr* udpRemoteAddr = nullptr;
sockaddr_storage udpRemoteAddrStorage; sockaddr_storage udpRemoteAddrStorage;
RTC::TCPConnection* tcpConnection = nullptr; RTC::TCPConnection* tcpConnection = nullptr;
// Others: // Others.
Type type; Type type;
}; };
...@@ -118,6 +118,6 @@ namespace RTC ...@@ -118,6 +118,6 @@ namespace RTC
if (this->type == Type::TCP) if (this->type == Type::TCP)
this->tcpConnection->Close(); this->tcpConnection->Close();
} }
} // namespace RTC }
#endif #endif
...@@ -49,7 +49,7 @@ namespace RTC ...@@ -49,7 +49,7 @@ namespace RTC
virtual void userOnUDPSocketClosed() override; virtual void userOnUDPSocketClosed() override;
private: private:
// Passed by argument: // Passed by argument.
Listener* listener = nullptr; Listener* listener = nullptr;
}; };
...@@ -60,6 +60,6 @@ namespace RTC ...@@ -60,6 +60,6 @@ namespace RTC
{ {
this->listener = listener; this->listener = listener;
} }
} // namespace RTC }
#endif #endif
...@@ -26,10 +26,10 @@ public: ...@@ -26,10 +26,10 @@ public:
void onUvSignal(int signum); void onUvSignal(int signum);
private: private:
// Allocated by this: // Allocated by this.
typedef std::vector<uv_signal_t*> UvHandles; typedef std::vector<uv_signal_t*> UvHandles;
UvHandles uvHandles; UvHandles uvHandles;
// Passed by argument: // Passed by argument.
Listener* listener = nullptr; Listener* listener = nullptr;
}; };
......
...@@ -70,9 +70,9 @@ private: ...@@ -70,9 +70,9 @@ private:
bool hasError = false; bool hasError = false;
protected: protected:
// Allocated by this: // Allocated by this.
MS_BYTE* buffer = nullptr; MS_BYTE* buffer = nullptr;
// Passed by argument: // Passed by argument.
size_t bufferSize = 0; size_t bufferSize = 0;
// Others. // Others.
size_t bufferDataLen = 0; size_t bufferDataLen = 0;
......
...@@ -47,11 +47,11 @@ public: ...@@ -47,11 +47,11 @@ public:
virtual void onTCPConnectionClosed(TCPConnection* connection, bool is_closed_by_peer); virtual void onTCPConnectionClosed(TCPConnection* connection, bool is_closed_by_peer);
private: private:
// Allocated by this (may be passed by argument): // Allocated by this (may be passed by argument).
uv_tcp_t* uvHandle = nullptr; uv_tcp_t* uvHandle = nullptr;
// Passed by argument: // Passed by argument.
void* userData = nullptr; void* userData = nullptr;
// Others: // Others.
typedef std::unordered_set<TCPConnection*> TCPConnections; typedef std::unordered_set<TCPConnection*> TCPConnections;
TCPConnections connections; TCPConnections connections;
bool isClosing = false; bool isClosing = false;
......
...@@ -25,9 +25,9 @@ public: ...@@ -25,9 +25,9 @@ public:
void onUvTimer(); void onUvTimer();
private: private:
// Allocated by this: // Allocated by this.
uv_timer_t* uvHandle = nullptr; uv_timer_t* uvHandle = nullptr;
// Passed by argument: // Passed by argument.
Listener* listener = nullptr; Listener* listener = nullptr;
}; };
......
...@@ -55,11 +55,11 @@ protected: ...@@ -55,11 +55,11 @@ protected:
virtual void userOnUDPSocketClosed() = 0; virtual void userOnUDPSocketClosed() = 0;
private: private:
// Allocated by this (may be passed by argument): // Allocated by this (may be passed by argument).
uv_udp_t* uvHandle = nullptr; uv_udp_t* uvHandle = nullptr;
// Passed by argument: // Passed by argument.
void* userData = nullptr; void* userData = nullptr;
// Others: // Others.
bool isClosing = false; bool isClosing = false;
protected: protected:
......
...@@ -51,11 +51,11 @@ private: ...@@ -51,11 +51,11 @@ private:
bool hasError = false; bool hasError = false;
protected: protected:
// Allocated by this: // Allocated by this.
MS_BYTE* buffer = nullptr; MS_BYTE* buffer = nullptr;
// Passed by argument: // Passed by argument.
size_t bufferSize = 0; size_t bufferSize = 0;
// Others: // Others.
size_t bufferDataLen = 0; size_t bufferDataLen = 0;
}; };
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
#include <cmath> // std::ceil() #include <cmath> // std::ceil()
#include <cstdio> // sprintf() #include <cstdio> // sprintf()
#define MESSAGE_MAX_SIZE 65536 // netstring length for a 65536 bytes payload
#define MESSAGE_MAX_SIZE 65543
namespace Channel namespace Channel
{ {
...@@ -23,6 +24,8 @@ namespace Channel ...@@ -23,6 +24,8 @@ namespace Channel
listener(listener) listener(listener)
{ {
MS_TRACE(); MS_TRACE();
MS_ERROR("---- MAX NS: %lu", netstring_buffer_size(MESSAGE_MAX_SIZE));
} }
UnixStreamSocket::~UnixStreamSocket() UnixStreamSocket::~UnixStreamSocket()
...@@ -115,23 +118,23 @@ namespace Channel ...@@ -115,23 +118,23 @@ namespace Channel
return; return;
case NETSTRING_ERROR_TOO_LONG: case NETSTRING_ERROR_TOO_LONG:
MS_THROW_ERROR("NETSTRING_ERROR_TOO_LONG"); MS_ERROR("NETSTRING_ERROR_TOO_LONG");
break; break;
case NETSTRING_ERROR_NO_COLON: case NETSTRING_ERROR_NO_COLON:
MS_THROW_ERROR("NETSTRING_ERROR_NO_COLON"); MS_ERROR("NETSTRING_ERROR_NO_COLON");
break; break;
case NETSTRING_ERROR_NO_COMMA: case NETSTRING_ERROR_NO_COMMA:
MS_THROW_ERROR("NETSTRING_ERROR_NO_COMMA"); MS_ERROR("NETSTRING_ERROR_NO_COMMA");
break; break;
case NETSTRING_ERROR_LEADING_ZERO: case NETSTRING_ERROR_LEADING_ZERO:
MS_THROW_ERROR("NETSTRING_ERROR_LEADING_ZERO"); MS_ERROR("NETSTRING_ERROR_LEADING_ZERO");
break; break;
case NETSTRING_ERROR_NO_LENGTH: case NETSTRING_ERROR_NO_LENGTH:
MS_THROW_ERROR("NETSTRING_ERROR_NO_LENGTH"); MS_ERROR("NETSTRING_ERROR_NO_LENGTH");
break; break;
} }
...@@ -149,11 +152,8 @@ namespace Channel ...@@ -149,11 +152,8 @@ namespace Channel
Json::Value json; Json::Value json;
Json::Reader reader; Json::Reader reader;
if (!reader.parse((const char*)json_start, (const char*)json_start + json_len, json)) if (reader.parse((const char*)json_start, (const char*)json_start + json_len, json))
{ {
MS_THROW_ERROR("invalid JSON");
}
Channel::Request* request = Request::Factory(this, json); Channel::Request* request = Request::Factory(this, json);
if (request) if (request)
...@@ -166,9 +166,13 @@ namespace Channel ...@@ -166,9 +166,13 @@ namespace Channel
} }
else else
{ {
// TODO: throw?
MS_ERROR("discarding wrong Channel request"); MS_ERROR("discarding wrong Channel request");
} }
}
else
{
MS_ERROR("invalid JSON");
}
// If there is no more space available in the buffer and that is because // If there is no more space available in the buffer and that is because
// the latest parsed message filled it, then empty the full buffer. // the latest parsed message filled it, then empty the full buffer.
......
...@@ -60,8 +60,16 @@ void Loop::Close() ...@@ -60,8 +60,16 @@ void Loop::Close()
// Close the SignalsHandler. // Close the SignalsHandler.
this->signalsHandler->Close(); this->signalsHandler->Close();
// Close the Channel socket // Close the Channel socket.
this->channel->Close(); this->channel->Close();
// Close all the Rooms.
for (auto& kv : this->rooms)
{
RTC::Room* room = kv.second;
room->Close();
}
} }
void Loop::onSignal(SignalsHandler* signalsHandler, int signum) void Loop::onSignal(SignalsHandler* signalsHandler, int signum)
......
...@@ -185,4 +185,4 @@ namespace RTC ...@@ -185,4 +185,4 @@ namespace RTC
delete this; delete this;
} }
} // namespace RTC }
...@@ -36,4 +36,4 @@ namespace RTC ...@@ -36,4 +36,4 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
} }
} // namespace RTC }
...@@ -233,4 +233,4 @@ namespace RTC ...@@ -233,4 +233,4 @@ namespace RTC
MS_DEBUG("- Payload size: %zu bytes", GetPayloadLength()); MS_DEBUG("- Payload size: %zu bytes", GetPayloadLength());
MS_DEBUG("[/RTPPacket]"); MS_DEBUG("[/RTPPacket]");
} }
} // namespace RTC }
...@@ -20,17 +20,16 @@ namespace RTC ...@@ -20,17 +20,16 @@ namespace RTC
MS_TRACE(); MS_TRACE();
// TMP // TMP
// for (int i = 1; i <= NUM_PEERS; i++)
// {
// RTC::Peer* peer = new RTC::Peer(this);
for (int i = 1; i <= NUM_PEERS; i++) // // TODO: this is not being freed
{ // int* data = new int(i);
RTC::Peer* peer = new RTC::Peer(this); // peer->SetUserData((void*)data);
// TODO: this is not being freed
int* data = new int(i);
peer->SetUserData((void*)data);
this->peers.push_back(peer); // this->peers.push_back(peer);
} // }
} }
Room::~Room() Room::~Room()
...@@ -42,6 +41,7 @@ namespace RTC ...@@ -42,6 +41,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
// Close all the Peers.
for (auto peer : this->peers) for (auto peer : this->peers)
peer->Close(); peer->Close();
...@@ -114,4 +114,4 @@ namespace RTC ...@@ -114,4 +114,4 @@ namespace RTC
// dst_peer->SendRTCPPacket(packet); // dst_peer->SendRTCPPacket(packet);
// } // }
} }
} // namespace RTC }
...@@ -213,4 +213,4 @@ namespace RTC ...@@ -213,4 +213,4 @@ namespace RTC
delete this; delete this;
} }
} // namespace RTC }
...@@ -629,4 +629,4 @@ namespace RTC ...@@ -629,4 +629,4 @@ namespace RTC
MS_DEBUG("- has Fingerprint"); MS_DEBUG("- has Fingerprint");
MS_DEBUG("[/STUNMessage]"); MS_DEBUG("[/STUNMessage]");
} }
} // namespace RTC }
...@@ -21,7 +21,6 @@ namespace RTC ...@@ -21,7 +21,6 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
// TODO: sure I want this?
delete this; delete this;
} }
} // namespace RTC }
...@@ -163,7 +163,7 @@ namespace RTC ...@@ -163,7 +163,7 @@ namespace RTC
// Exit the parsing loop. // Exit the parsing loop.
break; break;
} }
} // while() }
} }
void TCPConnection::Send(const MS_BYTE* data, size_t len) void TCPConnection::Send(const MS_BYTE* data, size_t len)
...@@ -178,4 +178,4 @@ namespace RTC ...@@ -178,4 +178,4 @@ namespace RTC
Write(frame_len, 2, data, len); Write(frame_len, 2, data, len);
} }
} // namespace RTC }
...@@ -365,4 +365,4 @@ namespace RTC ...@@ -365,4 +365,4 @@ namespace RTC
else if (this->localAddr.ss_family == AF_INET6) else if (this->localAddr.ss_family == AF_INET6)
RTC::TCPServer::availableIPv6Ports[this->localPort] = true; RTC::TCPServer::availableIPv6Ports[this->localPort] = true;
} }
} // namespace RTC }
...@@ -658,4 +658,4 @@ namespace RTC ...@@ -658,4 +658,4 @@ namespace RTC
// TMP // TMP
dtlsHandler->SendApplicationData(data, len); dtlsHandler->SendApplicationData(data, len);
} }
} // namespace RTC }
...@@ -39,4 +39,4 @@ namespace RTC ...@@ -39,4 +39,4 @@ namespace RTC
} }
} }
} }
} // namespace RTC }
...@@ -386,4 +386,4 @@ namespace RTC ...@@ -386,4 +386,4 @@ namespace RTC
else if (this->localAddr.ss_family == AF_INET6) else if (this->localAddr.ss_family == AF_INET6)
RTC::UDPSocket::availableIPv6Ports[this->localPort] = true; RTC::UDPSocket::availableIPv6Ports[this->localPort] = true;
} }
} // namespace RTC }
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论