Skip to content

Commit 571043f

Browse files
chundonglinlinwinlinvipchen-guanghua
authored
WebRTC: Error message carries the SDP when failed. v5.0.151, v6.0.39 (#3450)
Co-authored-by: winlin <[email protected]> Co-authored-by: ChenGH <[email protected]>
1 parent b34255c commit 571043f

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

trunk/doc/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The changelog for SRS.
88

99
## SRS 6.0 Changelog
1010

11+
* v6.0, 2023-03-27, Merge [#3450](https://github.com/ossrs/srs/pull/3450): WebRTC: Error message carries the SDP when failed. v6.0.39 (#3450)
1112
* v6.0, 2023-03-25, Merge [#3477](https://github.com/ossrs/srs/pull/3477): Remove unneccessary NULL check in srs_freep. v6.0.38 (#3477)
1213
* v6.0, 2023-03-25, Merge [#3455](https://github.com/ossrs/srs/pull/3455): RTC: Call on_play before create session, for it might be freed for timeout. v6.0.37 (#3455)
1314
* v6.0, 2023-03-22, Merge [#3427](https://github.com/ossrs/srs/pull/3427): WHIP: Support DELETE resource for Larix Broadcaster. v6.0.36 (#3427)
@@ -52,6 +53,7 @@ The changelog for SRS.
5253

5354
## SRS 5.0 Changelog
5455

56+
* v5.0, 2023-03-27, Merge [#3450](https://github.com/ossrs/srs/pull/3450): WebRTC: Error message carries the SDP when failed. v5.0.151 (#3450)
5557
* v5.0, 2023-03-25, Merge [#3477](https://github.com/ossrs/srs/pull/3477): Remove unneccessary NULL check in srs_freep. v5.0.150 (#3477)
5658
* v5.0, 2023-03-25, Merge [#3455](https://github.com/ossrs/srs/pull/3455): RTC: Call on_play before create session, for it might be freed for timeout. v5.0.149 (#3455)
5759
* v5.0, 2023-03-22, Merge [#3427](https://github.com/ossrs/srs/pull/3427): WHIP: Support DELETE resource for Larix Broadcaster. v5.0.148 (#3427)

trunk/src/app/srs_app_rtc_conn.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,7 @@ srs_error_t SrsRtcConnection::add_publisher(SrsRtcUserConfig* ruc, SrsSdp& local
18961896

18971897
// TODO: FIXME: Change to api of stream desc.
18981898
if ((err = negotiate_publish_capability(ruc, stream_desc)) != srs_success) {
1899-
return srs_error_wrap(err, "publish negotiate, offer=%s", ruc->remote_sdp_str_.c_str());
1899+
return srs_error_wrap(err, "publish negotiate, offer=%s", srs_string_replace(ruc->remote_sdp_str_.c_str(), "\r\n", "\\r\\n").c_str());
19001900
}
19011901

19021902
if ((err = generate_publish_local_sdp(req, local_sdp, stream_desc, ruc->remote_sdp_.is_unified(), ruc->audio_before_video_)) != srs_success) {
@@ -1935,7 +1935,7 @@ srs_error_t SrsRtcConnection::add_player(SrsRtcUserConfig* ruc, SrsSdp& local_sd
19351935

19361936
std::map<uint32_t, SrsRtcTrackDescription*> play_sub_relations;
19371937
if ((err = negotiate_play_capability(ruc, play_sub_relations)) != srs_success) {
1938-
return srs_error_wrap(err, "play negotiate, offer=%s", ruc->remote_sdp_str_.c_str());
1938+
return srs_error_wrap(err, "play negotiate, offer=%s", srs_string_replace(ruc->remote_sdp_str_.c_str(), "\r\n", "\\r\\n").c_str());
19391939
}
19401940

19411941
if (!play_sub_relations.size()) {

trunk/src/core/srs_core_version5.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
#define VERSION_MAJOR 5
1111
#define VERSION_MINOR 0
12-
#define VERSION_REVISION 150
12+
#define VERSION_REVISION 151
1313

1414
#endif

trunk/src/core/srs_core_version6.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
#define VERSION_MAJOR 6
1111
#define VERSION_MINOR 0
12-
#define VERSION_REVISION 38
12+
#define VERSION_REVISION 39
1313

1414
#endif

trunk/src/kernel/srs_kernel_error.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <vector>
2020
using namespace std;
2121

22+
const int maxLogBuf = 4 * 1024 * 1024;
23+
2224
#if defined(SRS_BACKTRACE) && defined(__linux)
2325
#include <execinfo.h>
2426
#include <dlfcn.h>
@@ -264,8 +266,8 @@ SrsCplxError* SrsCplxError::create(const char* func, const char* file, int line,
264266

265267
va_list ap;
266268
va_start(ap, fmt);
267-
static char buffer[4096];
268-
int r0 = vsnprintf(buffer, sizeof(buffer), fmt, ap);
269+
static char* buffer = new char[maxLogBuf];
270+
int r0 = vsnprintf(buffer, maxLogBuf, fmt, ap);
269271
va_end(ap);
270272

271273
SrsCplxError* err = new SrsCplxError();
@@ -275,7 +277,7 @@ SrsCplxError* SrsCplxError::create(const char* func, const char* file, int line,
275277
err->line = line;
276278
err->code = code;
277279
err->rerrno = rerrno;
278-
if (r0 > 0 && r0 < (int)sizeof(buffer)) {
280+
if (r0 > 0 && r0 < maxLogBuf) {
279281
err->msg = string(buffer, r0);
280282
}
281283
err->wrapped = NULL;
@@ -291,8 +293,8 @@ SrsCplxError* SrsCplxError::wrap(const char* func, const char* file, int line, S
291293

292294
va_list ap;
293295
va_start(ap, fmt);
294-
static char buffer[4096];
295-
int r0 = vsnprintf(buffer, sizeof(buffer), fmt, ap);
296+
static char* buffer = new char[maxLogBuf];
297+
int r0 = vsnprintf(buffer, maxLogBuf, fmt, ap);
296298
va_end(ap);
297299

298300
SrsCplxError* err = new SrsCplxError();
@@ -304,7 +306,7 @@ SrsCplxError* SrsCplxError::wrap(const char* func, const char* file, int line, S
304306
err->code = v->code;
305307
}
306308
err->rerrno = rerrno;
307-
if (r0 > 0 && r0 < (int)sizeof(buffer)) {
309+
if (r0 > 0 && r0 < maxLogBuf) {
308310
err->msg = string(buffer, r0);
309311
}
310312
err->wrapped = v;

0 commit comments

Comments
 (0)