equal
deleted
inserted
replaced
285 connection_stream_received (connection, m); |
285 connection_stream_received (connection, m); |
286 goto out; |
286 goto out; |
287 } |
287 } |
288 else if (lm_message_get_type (m) == LM_MESSAGE_TYPE_STREAM_ERROR) { |
288 else if (lm_message_get_type (m) == LM_MESSAGE_TYPE_STREAM_ERROR) { |
289 connection_stream_error (connection, m); |
289 connection_stream_error (connection, m); |
290 goto out; |
290 goto run_global_handlers; |
291 } |
291 } |
292 |
292 |
293 id = lm_message_node_get_attribute (m->node, "id"); |
293 id = lm_message_node_get_attribute (m->node, "id"); |
294 |
294 |
295 if (id) { |
295 if (id) { |
304 |
304 |
305 if (result == LM_HANDLER_RESULT_REMOVE_MESSAGE) { |
305 if (result == LM_HANDLER_RESULT_REMOVE_MESSAGE) { |
306 goto out; |
306 goto out; |
307 } |
307 } |
308 |
308 |
|
309 run_global_handlers: |
309 for (l = connection->handlers[lm_message_get_type (m)]; |
310 for (l = connection->handlers[lm_message_get_type (m)]; |
310 l && result == LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; |
311 l && result == LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; |
311 l = l->next) { |
312 l = l->next) { |
312 HandlerData *hd = (HandlerData *) l->data; |
313 HandlerData *hd = (HandlerData *) l->data; |
313 |
314 |
1461 } |
1462 } |
1462 |
1463 |
1463 static void |
1464 static void |
1464 connection_stream_error (LmConnection *connection, LmMessage *m) |
1465 connection_stream_error (LmConnection *connection, LmMessage *m) |
1465 { |
1466 { |
1466 LmMessageNode *node; |
1467 LmMessageNode *node, *child; |
1467 |
1468 |
1468 g_return_if_fail (connection != NULL); |
1469 g_return_if_fail (connection != NULL); |
1469 g_return_if_fail (m != NULL); |
1470 g_return_if_fail (m != NULL); |
1470 |
1471 |
1471 node = m->node; |
1472 node = m->node; |
1472 |
1473 |
1473 /* Resource conflict */ |
1474 /* Resource conflict */ |
1474 node = lm_message_node_get_child (node, "conflict"); |
1475 child = lm_message_node_get_child (node, "conflict"); |
1475 if (node) { |
1476 if (child) { |
1476 lm_verbose ("Stream error: Conflict (resource connected elsewhere)\n"); |
1477 lm_verbose ("Stream error: Conflict (resource connected elsewhere)\n"); |
1477 connection->disconnect_reason = LM_DISCONNECT_REASON_RESOURCE_CONFLICT; |
1478 connection->disconnect_reason = LM_DISCONNECT_REASON_RESOURCE_CONFLICT; |
1478 return; |
1479 return; |
1479 } |
1480 } |
1480 |
1481 |
1481 /* XML is crack */ |
1482 /* XML is crack */ |
1482 node = lm_message_node_get_child (node, "xml-not-well-formed"); |
1483 child = lm_message_node_get_child (node, "xml-not-well-formed"); |
1483 if (node) { |
1484 if (child) { |
1484 lm_verbose ("Stream error: XML not well formed\n"); |
1485 lm_verbose ("Stream error: XML not well formed\n"); |
1485 connection->disconnect_reason = LM_DISCONNECT_REASON_INVALID_XML; |
1486 connection->disconnect_reason = LM_DISCONNECT_REASON_INVALID_XML; |
1486 return; |
1487 return; |
1487 } |
1488 } |
1488 |
1489 |