[sr-dev] git:4.3:3a9c5494: erlang: fix build on squeeze and precise

Victor Seva linuxmaniac at torreviejawireless.org
Fri May 29 10:51:32 CEST 2015


Module: kamailio
Branch: 4.3
Commit: 3a9c5494958fd0a9d9072804860c19474af14432
URL: https://github.com/kamailio/kamailio/commit/3a9c5494958fd0a9d9072804860c19474af14432

Author: Seudin Kasumovic <seudin.kasumovic at gmail.com>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2015-05-29T10:51:10+02:00

erlang: fix build on squeeze and precise

Check if defined decode of unicode atoms type.

(cherry picked from commit 63127b261668e0efdea5b0ddb5f16a03dd9f02bc)

---

Modified: modules/erlang/handle_emsg.c
Modified: modules/erlang/pv_xbuff.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3a9c5494958fd0a9d9072804860c19474af14432.diff
Patch: https://github.com/kamailio/kamailio/commit/3a9c5494958fd0a9d9072804860c19474af14432.patch

---

diff --git a/modules/erlang/handle_emsg.c b/modules/erlang/handle_emsg.c
index a599f9f..e43bb1f 100644
--- a/modules/erlang/handle_emsg.c
+++ b/modules/erlang/handle_emsg.c
@@ -460,9 +460,13 @@ int handle_rex_call(cnode_handler_t *phandler,erlang_ref_ex_t *ref, erlang_pid *
 	 */
 
 	ei_get_type(request->buff,&request->index,&type,&size);
-
+#ifdef ERL_SMALL_ATOM_EXT
 	if (type == ERL_ATOM_EXT || type == ERL_SMALL_ATOM_EXT)
 	{
+#else
+	if (type == ERL_ATOM_EXT)
+	{
+#endif
 		if (ei_decode_atom(request->buff,&request->index,module))
 		{
 			encode_error_msg(response, ref, "error", "Failed to decode module name");
@@ -477,8 +481,13 @@ int handle_rex_call(cnode_handler_t *phandler,erlang_ref_ex_t *ref, erlang_pid *
 
 	ei_get_type(request->buff,&request->index,&type,&size);
 
+#ifdef ERL_SMALL_ATOM_EXT
 	if (type == ERL_ATOM_EXT || type == ERL_SMALL_ATOM_EXT)
 	{
+#else
+	if (type == ERL_ATOM_EXT)
+	{
+#endif
 		if (ei_decode_atom(request->buff,&request->index,method))
 		{
 			encode_error_msg(response, ref, "error", "Failed to decode method name");
diff --git a/modules/erlang/pv_xbuff.c b/modules/erlang/pv_xbuff.c
index 7e80e92..cdfbd58 100644
--- a/modules/erlang/pv_xbuff.c
+++ b/modules/erlang/pv_xbuff.c
@@ -977,7 +977,9 @@ int xavp_decode(ei_x_buff *xbuff, int *index, sr_xavp_t **xavp,int level)
 
 	switch (type) {
 	case ERL_ATOM_EXT:
-
+#ifdef ERL_SMALL_ATOM_EXT
+	case ERL_SMALL_ATOM_EXT:
+#endif
 		name.len = snprintf(_s,sizeof(_s),"a%d",counter++);
 		pbuf = (char*)pkg_realloc(pbuf,size+1);
 




More information about the sr-dev mailing list