Skip to content

Commit

Permalink
Fix a few errors in the code.
Browse files Browse the repository at this point in the history
Also add action-handlers.c to the list of files to compile.
  • Loading branch information
Nicolas Cornu committed Jun 7, 2010
1 parent 2bdab0e commit 85368ee
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion jingle/CMakeLists.txt
@@ -1,4 +1,4 @@
add_library(jingle MODULE jingle.c check.c register.c)
add_library(jingle MODULE jingle.c check.c action-handlers.c register.c)
set_target_properties(jingle PROPERTIES COMPILE_FLAGS "-Wall")
include_directories(${LM_INCLUDE_DIRS} ..)
target_link_libraries(jingle ${LM_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion jingle/action-handlers.c
Expand Up @@ -29,7 +29,7 @@ void handle_session_initiate(LmMessage *m, JingleNode *jn)
{
// a session-initiate message must contains at least one <content> element
if (g_list_length(jn->content) < 1) {
jingle_send_iq_error(message, "cancel", "bad-request", NULL);
jingle_send_iq_error(m, "cancel", "bad-request", NULL);
}

}
4 changes: 2 additions & 2 deletions jingle/check.c
Expand Up @@ -88,7 +88,7 @@ gboolean check_jingle(LmMessageNode *node, JingleNode *jn, GError **err)

for (child = node->children; child; child = child->next) {
if (!g_strcmp0(child->name, "content")) {
cn = check_content(node, err);
cn = check_content(child, err);
if(cn == NULL) {
g_assert (*err != NULL);
return FALSE;
Expand All @@ -106,7 +106,7 @@ JingleContentNode *check_content(LmMessageNode *node, GError **err)
const gchar *creatorstr, *sendersstr;
gint tmp, tmp2;

creatorstr = lm_message_node_get_attribute(node, "action");
creatorstr = lm_message_node_get_attribute(node, "creator");
cn->disposition = lm_message_node_get_attribute(node, "disposition");
cn->name = lm_message_node_get_attribute(node, "name");
sendersstr = lm_message_node_get_attribute(node, "senders");
Expand Down
10 changes: 5 additions & 5 deletions jingle/jingle.c
Expand Up @@ -96,18 +96,18 @@ LmHandlerResult jingle_handle_iq(LmMessageHandler *handler,

JingleNode *jn = g_new0(JingleNode, 1);
GError *error = NULL;
LmMessageNode *root = lm_message_get_node(message)->children;
LmMessageNode *node = lm_message_node_get_child(root, "jingle");
LmMessageNode *root = lm_message_get_node(message);
LmMessageNode *jnode = lm_message_node_get_child(root, "jingle");

if (!node) // no <jingle> element found
if (!jnode) // no <jingle> element found
return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;

if (g_strcmp0(lm_message_node_get_attribute(node, "xmlns"), NS_JINGLE)) {
if (g_strcmp0(lm_message_node_get_attribute(jnode, "xmlns"), NS_JINGLE)) {
scr_log_print(LPRINT_DEBUG, "jingle: Received a jingle IQ with an invalid namespace");
return LM_HANDLER_RESULT_REMOVE_MESSAGE;
}

check_jingle(node, jn, &error);
check_jingle(jnode, jn, &error);
if (error != NULL) {
if (error->domain == JINGLE_CHECK_ERROR) {
// request malformed, we reply with a bad-request
Expand Down

0 comments on commit 85368ee

Please sign in to comment.