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

SctpAssociation.cpp: improve logs

上级 8b4a4809
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/debug": "^4.1.5", "@types/debug": "^4.1.5",
"@types/node": "^12.12.16", "@types/node": "^12.12.17",
"@types/random-number": "0.0.0", "@types/random-number": "0.0.0",
"@types/uuid": "^3.4.6", "@types/uuid": "^3.4.6",
"@typescript-eslint/eslint-plugin": "^2.11.0", "@typescript-eslint/eslint-plugin": "^2.11.0",
......
...@@ -302,7 +302,7 @@ namespace RTC ...@@ -302,7 +302,7 @@ namespace RTC
// This must be controlled by the DataConsumer. // This must be controlled by the DataConsumer.
MS_ASSERT( MS_ASSERT(
len <= this->maxSctpMessageSize, len <= this->maxSctpMessageSize,
"given message exceeds maxSctpMessageSize value [maxSctpMessageSize:%zu, len:%zu]", "given message exceeds max allowed message size [message size:%zu, max message size:%zu]",
len, len,
this->maxSctpMessageSize); this->maxSctpMessageSize);
...@@ -348,7 +348,7 @@ namespace RTC ...@@ -348,7 +348,7 @@ namespace RTC
{ {
MS_WARN_TAG( MS_WARN_TAG(
sctp, sctp,
"error sending SCTP message [sid:%" PRIu16 ", ppid:%" PRIu32 ", len:%zu]: %s", "error sending SCTP message [sid:%" PRIu16 ", ppid:%" PRIu32 ", message size:%zu]: %s",
parameters.streamId, parameters.streamId,
ppid, ppid,
len, len,
...@@ -470,7 +470,7 @@ namespace RTC ...@@ -470,7 +470,7 @@ namespace RTC
if (additionalOs == 0) if (additionalOs == 0)
{ {
MS_WARN_TAG(sctp, "cannot add more outgoing streams, [OS:%" PRIu16 "]", this->os); MS_WARN_TAG(sctp, "cannot add more outgoing streams [OS:%" PRIu16 "]", this->os);
return; return;
} }
...@@ -535,8 +535,8 @@ namespace RTC ...@@ -535,8 +535,8 @@ namespace RTC
{ {
MS_WARN_TAG( MS_WARN_TAG(
sctp, sctp,
"received different SSN while buffer not empty, buffer discarded [SSN:%" PRIu16 "message chunk received with different SSN while buffer not empty, buffer discarded [ssn:%" PRIu16
", lastSsnReceived:%" PRIu16 "]", ", last ssn received:%" PRIu16 "]",
ssn, ssn,
this->lastSsnReceived); this->lastSsnReceived);
...@@ -552,7 +552,7 @@ namespace RTC ...@@ -552,7 +552,7 @@ namespace RTC
{ {
MS_WARN_TAG( MS_WARN_TAG(
sctp, sctp,
"received message exceeds maxSctpMessageSize value [maxSctpMessageSize:%zu, len:%zu, EOR:%u]", "ongoing received message exceeds max allowed message size [message size:%zu, max message size:%zu, eor:%u]",
this->messageBufferLen + len, this->messageBufferLen + len,
this->maxSctpMessageSize, this->maxSctpMessageSize,
eor ? 1 : 0); eor ? 1 : 0);
...@@ -565,7 +565,7 @@ namespace RTC ...@@ -565,7 +565,7 @@ namespace RTC
// If end of message and there is no buffered data, notify it directly. // If end of message and there is no buffered data, notify it directly.
if (eor && this->messageBufferLen == 0) if (eor && this->messageBufferLen == 0)
{ {
MS_DEBUG_DEV("directly notifying listener [eor:1, messageBufferLen:0]"); MS_DEBUG_DEV("directly notifying listener [eor:1, buffer len:0]");
this->listener->OnSctpAssociationMessageReceived(this, streamId, ppid, data, len); this->listener->OnSctpAssociationMessageReceived(this, streamId, ppid, data, len);
} }
...@@ -575,7 +575,7 @@ namespace RTC ...@@ -575,7 +575,7 @@ namespace RTC
std::memcpy(this->messageBuffer + this->messageBufferLen, data, len); std::memcpy(this->messageBuffer + this->messageBufferLen, data, len);
this->messageBufferLen += len; this->messageBufferLen += len;
MS_DEBUG_DEV("notifying listener [eor:1, messageBufferLen:%zu]", this->messageBufferLen); MS_DEBUG_DEV("notifying listener [eor:1, buffer len:%zu]", this->messageBufferLen);
this->listener->OnSctpAssociationMessageReceived( this->listener->OnSctpAssociationMessageReceived(
this, streamId, ppid, this->messageBuffer, this->messageBufferLen); this, streamId, ppid, this->messageBuffer, this->messageBufferLen);
...@@ -592,7 +592,7 @@ namespace RTC ...@@ -592,7 +592,7 @@ namespace RTC
std::memcpy(this->messageBuffer + this->messageBufferLen, data, len); std::memcpy(this->messageBuffer + this->messageBufferLen, data, len);
this->messageBufferLen += len; this->messageBufferLen += len;
MS_DEBUG_DEV("data buffered [eor:0, messageBufferLen:%zu]", this->messageBufferLen); MS_DEBUG_DEV("data buffered [eor:0, buffer len:%zu]", this->messageBufferLen);
} }
} }
...@@ -917,7 +917,6 @@ namespace RTC ...@@ -917,7 +917,6 @@ namespace RTC
default: default:
{ {
// TODO: Move to MS_DEBUG_TAG once we know which the cases are.
MS_WARN_TAG( MS_WARN_TAG(
sctp, "unhandled SCTP event received [type:%" PRIu16 "]", notification->sn_header.sn_type); sctp, "unhandled SCTP event received [type:%" PRIu16 "]", notification->sn_header.sn_type);
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论