[farsight2/master] Check that ip is there and accept that possibility of having no base
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:26:24 PST 2008
---
transmitters/nice/fs-nice-stream-transmitter.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index 0c43589..21da848 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -550,14 +550,18 @@ fs_candidate_to_nice_candidate (FsNiceStreamTransmitter *self,
nc->password = g_strdup(candidate->password);
*/
- if (candidate->ip)
- if (!nice_address_set_from_string (&nc->addr, candidate->ip))
- goto error;
+ if (candidate->ip == NULL || candidate->port == 0)
+ goto error;
+ if (!nice_address_set_from_string (&nc->addr, candidate->ip))
+ goto error;
nice_address_set_port (&nc->addr, candidate->port);
- if (candidate->base_ip)
+
+ if (candidate->base_ip && candidate->base_port)
+ {
if (!nice_address_set_from_string (&nc->base_addr, candidate->base_ip))
goto error;
- nice_address_set_port (&nc->base_addr, candidate->base_port);
+ nice_address_set_port (&nc->base_addr, candidate->base_port);
+ }
return nc;
--
1.5.6.5
More information about the farsight-commits
mailing list