[svn-commits] mmichelson: trunk r103282 - /trunk/main/event.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Feb 10 20:47:26 CST 2008


Author: mmichelson
Date: Sun Feb 10 20:47:25 2008
New Revision: 103282

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103282
Log:
Fix a problem regarding network vs. host byte order
in the event API.

ast_event_iterator_get_ie_type should return the ie type in
host byte order. Furthermore, ast_event_get_ie_raw should already
have its ie type argument in host byte order since it could be called
externally (and it in fact is called in this way by ast_event_get_cached).


Modified:
    trunk/main/event.c

Modified: trunk/main/event.c
URL: http://svn.digium.com/view/asterisk/trunk/main/event.c?view=diff&rev=103282&r1=103281&r2=103282
==============================================================================
--- trunk/main/event.c (original)
+++ trunk/main/event.c Sun Feb 10 20:47:25 2008
@@ -388,7 +388,7 @@
 
 enum ast_event_ie_type ast_event_iterator_get_ie_type(struct ast_event_iterator *iterator)
 {
-	return iterator->ie->ie_type;
+	return ntohs(iterator->ie->ie_type);
 }
 
 uint32_t ast_event_iterator_get_ie_uint(struct ast_event_iterator *iterator)
@@ -429,8 +429,6 @@
 {
 	struct ast_event_iterator iterator;
 	int res = 0;
-
-	ie_type = ntohs(ie_type);
 
 	for (ast_event_iterator_init(&iterator, event); !res; res = ast_event_iterator_next(&iterator)) {
 		if (ast_event_iterator_get_ie_type(&iterator) == ie_type)




More information about the svn-commits mailing list