Module: sems Branch: 1.4 Commit: f2cae49cab7014f6aa94d7bae2825c47189c8c2c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=f2cae49cab7014f6aa94d7bae2825c47189c8c2c
Author: Stefan Sayer <[email protected]> Committer: Stefan Sayer <[email protected]> Date: Fri May 6 17:57:41 2011 +0200 b/f: don't try to skip lines in empty SDP --- core/AmB2BSession.cpp | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp index 97fd6e5..684b0a7 100644 --- a/core/AmB2BSession.cpp +++ b/core/AmB2BSession.cpp @@ -528,14 +528,16 @@ void AmB2BSession::saveSessionDescription(const string& content_type, const char* cmp_body_begin = body.c_str(); size_t cmp_body_length = body.length(); - if (content_type == SIP_APPLICATION_SDP) { - // for SDP, skip v and o line - // (o might change even if SDP unchanged) + #define skip_line \ while (cmp_body_length-- && *cmp_body_begin != '\n') \ cmp_body_begin++; \ cmp_body_begin++; \ + if (body.length() && content_type == SIP_APPLICATION_SDP) { + // for SDP, skip v and o line + // (o might change even if SDP unchanged) + skip_line; skip_line; } @@ -547,7 +549,7 @@ bool AmB2BSession::updateSessionDescription(const string& content_type, const string& body) { const char* cmp_body_begin = body.c_str(); size_t cmp_body_length = body.length(); - if (content_type == SIP_APPLICATION_SDP) { + if (body.length() && content_type == SIP_APPLICATION_SDP) { // for SDP, skip v and o line // (o might change even if SDP unchanged) skip_line; _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
