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

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Sun Feb  5 00:08:34 2012 +0100

b/f: fixes 8a5e3da02.

---

 core/sip/cstring.h       |    5 -----
 core/sip/trans_layer.cpp |    6 +++---
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/core/sip/cstring.h b/core/sip/cstring.h
index 581dee3..6c323db 100644
--- a/core/sip/cstring.h
+++ b/core/sip/cstring.h
@@ -31,7 +31,6 @@
 #define _CSTRING_H
 
 #include <string.h>
-#include <string>
 
 struct cstring 
 {
@@ -68,10 +67,6 @@ struct cstring
       return memcmp(rhs_str.s,s,len <= rhs_str.len ? len : rhs_str.len) == 0;
     }
 
-    bool operator == (const std::string& rhs_str) {
-      return rhs_str.compare(1,rhs_str.size(),s,len) == 0;
-    }
-
     bool operator == (const char* rhs_str) {
       unsigned int rhs_len = strlen(rhs_str);
       return memcmp(rhs_str,s,len <= rhs_len ? len : rhs_len) == 0;
diff --git a/core/sip/trans_layer.cpp b/core/sip/trans_layer.cpp
index db05842..b3f6c3c 100644
--- a/core/sip/trans_layer.cpp
+++ b/core/sip/trans_layer.cpp
@@ -150,7 +150,7 @@ int _trans_layer::send_reply(trans_ticket* tt,
     unsigned int new_via1_len = copy_hdr_len(req->via1);
     string remote_ip_str = get_addr_str(&req->remote_ip);
 
-    bool append_received = !(req->via_p1->host == remote_ip_str);
+    bool append_received = !(req->via_p1->host == remote_ip_str.c_str());
     if(append_received) {
        new_via1_len += 10/*;received=*/ + remote_ip_str.length();
     }
@@ -307,15 +307,15 @@ int _trans_layer::send_reply(trans_ticket* tt,
                }
 
                if(append_received) {
+
                    memcpy(c,";received=",10);
                    c += 10;
-               }
 
-               if(!remote_ip_str.empty()) {
                    memcpy(c,remote_ip_str.c_str(),remote_ip_str.length());
                    c += remote_ip_str.length();
                }
 
+
                //copy the rest of the first Via header 
                len = req->via1->value.s + req->via1->value.len - 
req->via_p1->eop;
                memcpy(c,req->via_p1->eop,len);

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to