Module: sems
Branch: master
Commit: cef53213506a7abbaedad30c1289828a0782b1c6
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=cef53213506a7abbaedad30c1289828a0782b1c6

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 7c6ec51..255a213 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

Reply via email to