Don't append the 'id'-tag in opening stream headers. [#30]
authorWill Thompson <will.thompson@collabora.co.uk>
Wed, 05 Nov 2008 23:29:44 +0100
changeset 558 e5b7f24779c9
parent 554 df52d7a1a9af
child 560 f91deafed5b3
Don't append the 'id'-tag in opening stream headers. [#30] According to RFC 3920 (section 4.4) the id attribute SHOULD NOT be added by the initiating party. [#30 responsible:Hallski state:resolved milestone:Loudmouth 1.4.4 tagged:committed] committer: Mikael Hallendal <micke@imendio.com>
loudmouth/lm-message.c
--- a/loudmouth/lm-message.c	Wed Oct 29 17:54:25 2008 +0100
+++ b/loudmouth/lm-message.c	Wed Nov 05 23:29:44 2008 +0100
@@ -231,10 +231,12 @@
     
     m->node = _lm_message_node_new (_lm_message_type_to_string (type));
 
-    id = _lm_utils_generate_id ();
-    lm_message_node_set_attribute (m->node, "id", id);
-    g_free (id);
-    
+    if (type != LM_MESSAGE_TYPE_STREAM) {
+        id = _lm_utils_generate_id ();
+        lm_message_node_set_attribute (m->node, "id", id);
+        g_free (id);
+    }
+
     if (to) {
         lm_message_node_set_attribute (m->node, "to", to);
     }