Hi,
canceling a request fails in 64 bit system, because
hex(bucket_no)':'hex(pointer_to_transaction) is stored in transaction id
('serKey') of size 12, which obviously works only for sizeof(void*)==4.
Please have a look at attached patch - or should we use a better way to
blob the pointer into the string? Also, it is possibly not be
guaranteed that sizeof(long*)==long (i think i read somewhere).
Stefan
--
Stefan Sayer
VoIP Services
[EMAIL PROTECTED]
www.iptego.com
IPTEGO GmbH
Am Borsigturm 40
13507 Berlin
Germany
Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann
Index: trans_layer.h
===================================================================
--- trans_layer.h (revision 39763)
+++ trans_layer.h (working copy)
@@ -139,10 +139,11 @@
* Sends a UAC request.
* Caution: Route headers should not be added to the
* general header list (msg->hdrs).
- * @param msg Pre-built message.
- * @param tid buffer for the transaction key (char[12])
+ * @param [in] msg Pre-built message.
+ * @param [out] tid buffer for the transaction key (char*)
+ * @param [out] length of transaction key
*/
- int send_request(sip_msg* msg, char* tid);
+ int send_request(sip_msg* msg, char* tid, unsigned int& tid_len);
/**
* Cancels a request.
Index: SipCtrlInterface.cpp
===================================================================
--- SipCtrlInterface.cpp (revision 39763)
+++ SipCtrlInterface.cpp (working copy)
@@ -319,10 +319,9 @@
}
}
- int res = tl->send_request(msg,serKey);
+ int res = tl->send_request(msg,serKey,serKeyLen);
delete msg;
- serKeyLen=12;
return res;
}
Index: trans_layer.cpp
===================================================================
--- trans_layer.cpp (revision 39763)
+++ trans_layer.cpp (working copy)
@@ -467,7 +467,7 @@
bucket->remove_trans(t);
}
-int trans_layer::send_request(sip_msg* msg, char* tid)
+int trans_layer::send_request(sip_msg* msg, char* tid, unsigned int& tid_len)
{
// Request-URI
// To
@@ -482,6 +482,8 @@
assert(transport);
+ tid_len = 0;
+
if(set_next_hop(msg->route,msg->u.request->ruri_str,
&msg->remote_ip) < 0){
// TODO: error handling
@@ -588,7 +590,8 @@
string t_id = int2hex(bucket->get_id()).substr(5,string::npos)
+ ":" + long2hex((unsigned long)t);
- memcpy(tid,t_id.c_str(),12);
+ memcpy(tid,t_id.c_str(),t_id.length());
+ tid_len = t_id.length();
}
bucket->unlock();
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev