Browse code

b/f: align UACAuth::onSendRequest() to the current API.

Raphael Coeffic authored on 24/02/2012 10:01:03
Showing 2 changed files
... ...
@@ -219,34 +219,30 @@ bool UACAuth::onSipReply(const AmSipReply& reply, AmSipDialog::Status old_dlg_st
219 219
   return processed;
220 220
 }
221 221
 
222
-bool UACAuth::onSendRequest(const string& method, 
223
-			    const AmMimeBody* body,
224
-			    string& hdrs,
225
-			    int flags,
226
-			    unsigned int cseq)
222
+bool UACAuth::onSendRequest(AmSipRequest& req, int flags)
227 223
 {
228 224
   // add authentication header if nonce is already there
229 225
   string result;
230 226
   if (!(flags & SIP_FLAGS_NOAUTH) &&
231 227
       !challenge.nonce.empty() &&
232 228
       do_auth(challenge, challenge_code,
233
-	      method, dlg->remote_uri, body, result)) {
229
+	      req.method, dlg->remote_uri, &req.body, result)) {
234 230
     // add headers
235
-    if (hdrs == "\r\n" || hdrs == "\r" || hdrs == "\n")
236
-      hdrs = result;
231
+    if (req.hdrs == "\r\n" || req.hdrs == "\r" || req.hdrs == "\n")
232
+      req.hdrs = result;
237 233
     else
238
-      hdrs += result;
234
+      req.hdrs += result;
239 235
 
240 236
     nonce_reuse = true;
241 237
   } else {
242 238
     nonce_reuse = false;
243 239
   }
244 240
 
245
-  DBG("adding %d to list of sent requests.\n", cseq);
246
-  sent_requests[cseq] = SIPRequestInfo(method, 
247
-				       body,
248
-				       hdrs,
249
-				       dlg->getOAState());
241
+  DBG("adding %d to list of sent requests.\n", req.cseq);
242
+  sent_requests[req.cseq] = SIPRequestInfo(req.method, 
243
+					   &req.body,
244
+					   req.hdrs,
245
+					   dlg->getOAState());
250 246
   return false;
251 247
 }
252 248
 
... ...
@@ -159,12 +159,7 @@ class UACAuth : public AmSessionEventHandler
159 159
   virtual bool onSipRequest(const AmSipRequest&);
160 160
   virtual bool onSipReply(const AmSipReply&, AmSipDialog::Status old_dlg_status);
161 161
 	
162
-  virtual bool onSendRequest(const string& method, 
163
-			     const AmMimeBody* body,
164
-			     string& hdrs,
165
-			     int flags,
166
-			     unsigned int cseq);
167
-	
162
+  virtual bool onSendRequest(AmSipRequest& req, int flags);
168 163
   virtual bool onSendReply(AmSipReply& reply, int flags);
169 164
 };
170 165