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

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Wed Mar  9 11:58:31 2011 +0100

b/f: uac auth with \r\n headers

---

 core/plug-in/uac_auth/UACAuth.cpp |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/core/plug-in/uac_auth/UACAuth.cpp 
b/core/plug-in/uac_auth/UACAuth.cpp
index 82bbdd7..829387a 100644
--- a/core/plug-in/uac_auth/UACAuth.cpp
+++ b/core/plug-in/uac_auth/UACAuth.cpp
@@ -146,7 +146,7 @@ bool UACAuth::onSipReply(const AmSipReply& reply, int 
old_dlg_status, const stri
          DBG("Authorization failed!\n");
        } else {
          string auth_hdr = (reply.code==407) ? 
-      getHeader(reply.hdrs, SIP_HDR_PROXY_AUTHENTICATE, true) : 
+           getHeader(reply.hdrs, SIP_HDR_PROXY_AUTHENTICATE, true) : 
            getHeader(reply.hdrs, SIP_HDR_WWW_AUTHENTICATE, true);
          string result; 
                        
@@ -156,11 +156,15 @@ bool UACAuth::onSipReply(const AmSipReply& reply, int 
old_dlg_status, const stri
          if (do_auth(reply.code, auth_hdr,  
                      ri->second.method,
                      auth_uri, result)) {
-           string hdrs = ri->second.hdrs; 
-           // TODO: strip headers 
+           string hdrs = ri->second.hdrs;
+           // TODO(?): strip headers 
            // ((code==401) ? stripHeader(ri->second.hdrs, "Authorization")  :
            //                      stripHeader(ri->second.hdrs, 
"Proxy-Authorization"));
-           hdrs += result;
+
+           if (hdrs == "\r\n" || hdrs == "\r" || hdrs == "\n")
+             hdrs = result;
+           else
+             hdrs += result;
 
            if (dlg->getStatus() < AmSipDialog::Connected && 
                ri->second.method != SIP_METH_BYE) {

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

Reply via email to