summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert McQueen <robert.mcqueen@collabora.co.uk>2007-05-03 13:27:25 +0000
committerRobert McQueen <robert.mcqueen@collabora.co.uk>2007-05-03 13:27:25 +0000
commit010aa9c74de917bdb082bdb187079a18fe87517c (patch)
treeec6b5e67b5aca9619b2771ac17c0a5ca3a0d1ceb
parentd759d6fcb270a98a318db54eef74840756927aaf (diff)
downloadtelepathy-gabble-010aa9c74de917bdb082bdb187079a18fe87517c.tar.gz
when signalling GTalk candidates which are tcp and port 443, mark them as ssltcp
20070503132725-418b8-a8ae5ea08c5faddbdfed554c23662ec2fe9940b5.gz
-rw-r--r--src/gabble-media-stream.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/gabble-media-stream.c b/src/gabble-media-stream.c
index 112d2f971..2a9d8a67f 100644
--- a/src/gabble-media-stream.c
+++ b/src/gabble-media-stream.c
@@ -1005,8 +1005,7 @@ _add_rtp_candidate_node (GabbleMediaSession *session, LmMessageNode *parent,
gchar *port_str;
gchar *pref_str;
gchar *xml;
- const gchar *type_str;
- const gchar *candidate_id;
+ const gchar *type_str, *proto_str, *candidate_id;
guint port;
gdouble pref;
TpMediaStreamProto proto;
@@ -1053,6 +1052,23 @@ _add_rtp_candidate_node (GabbleMediaSession *session, LmMessageNode *parent,
goto out;
}
+ switch (proto)
+ {
+ case TP_MEDIA_STREAM_PROTO_UDP:
+ proto_str = "udp";
+ break;
+ case TP_MEDIA_STREAM_PROTO_TCP:
+ if (port == 443 && type == TP_MEDIA_STREAM_TRANSPORT_TYPE_RELAY)
+ proto_str = "ssltcp";
+ else
+ proto_str = "tcp";
+ break;
+ default:
+ g_warning ("%s: TpMediaStreamProto has an invalid value, ignoring "
+ "candidate", G_STRFUNC);
+ goto out;
+ }
+
cand_node = lm_message_node_add_child (parent, "candidate", NULL);
lm_message_node_set_attributes (cand_node,
"name", "rtp",
@@ -1061,7 +1077,7 @@ _add_rtp_candidate_node (GabbleMediaSession *session, LmMessageNode *parent,
"username", user,
"password", pass,
"preference", pref_str,
- "protocol", (proto == TP_MEDIA_STREAM_PROTO_UDP) ? "udp" : "tcp",
+ "protocol", proto_str,
"type", type_str,
"network", "0",
"generation", "0",