summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiraj Razick <siraj.razick@collabora.co.uk>2012-03-25 12:55:08 -0400
committerSiraj Razick <siraj.razick@collabora.co.uk>2012-03-26 10:31:35 -0400
commitd7cb7b863e3de66bfe1f506a8879d180e1534637 (patch)
tree47c11d99c6c8edcf5f7118b10e9b2f9a49eb797e
parentcbb9922cadf0306f0605e5ae3a4d3eb976f6a0f9 (diff)
downloadtelepathy-salut-d7cb7b863e3de66bfe1f506a8879d180e1534637.tar.gz
bonjour-contact: store copies of name, type and domain
name, type, domain might change over time to make sure resolving works correctly, we keep a copy of them in our context
-rw-r--r--src/bonjour-contact.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/bonjour-contact.c b/src/bonjour-contact.c
index 4d4f6834..5544ad6c 100644
--- a/src/bonjour-contact.c
+++ b/src/bonjour-contact.c
@@ -67,9 +67,9 @@ typedef struct _SalutBonjourResolveCtx
SalutBonjourContact *contact;
- const char *name;
- const char *type;
- const char *domain;
+ char *name;
+ char *type;
+ char *domain;
uint32_t interface;
struct sockaddr *address;
uint16_t port;
@@ -625,6 +625,9 @@ salut_bonjour_contact_remove_service (SalutBonjourContact *self,
priv->resolvers = g_slist_remove (priv->resolvers, ctx);
g_free (ctx->address);
+ g_free (ctx->name);
+ g_free (ctx->type);
+ g_free (ctx->domain);
g_slice_free (SalutBonjourResolveCtx, ctx);
if (priv->resolvers == NULL)
@@ -648,9 +651,9 @@ salut_bonjour_contact_add_service (SalutBonjourContact *self,
ctx = g_slice_new0 (SalutBonjourResolveCtx);
ctx->interface = interface;
- ctx->name = name;
- ctx->type = type;
- ctx->domain = domain;
+ ctx->name = g_strdup (name);
+ ctx->type = g_strdup (type);
+ ctx->domain = g_strdup (domain);
ctx->contact = self;
ctx->address = NULL;
ctx->txt_length = 0;