Mercurial > pidgin.yaz
annotate libpurple/protocols/bonjour/mdns_win32.c @ 25260:5456120de480
disapproval of revision '3de5eea959151773885ba601f681aec2431dd47d'
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Wed, 14 Jan 2009 18:53:28 +0000 |
parents | c73a891d26a6 |
children | 71aafff24358 |
rev | line source |
---|---|
20765
53691c081eab
rlaager noticed that these comments shouldn't be processed by doxygen.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20308
diff
changeset
|
1 /* |
20308
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19680
diff
changeset
|
2 * |
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19680
diff
changeset
|
3 * Purple is the legal property of its developers, whose names are too numerous |
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19680
diff
changeset
|
4 * to list here. Please refer to the COPYRIGHT file distributed with this |
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19680
diff
changeset
|
5 * source distribution. |
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19680
diff
changeset
|
6 * |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
7 * This program is free software; you can redistribute it and/or modify |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
10 * (at your option) any later version. |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
11 * |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
15 * GNU Library General Public License for more details. |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
16 * |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
18 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19653
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
20 */ |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
21 |
18276
1faa319ab4c3
More compile fixes from rekkanoryo for G_GNUC_NULL_TERMINATED issues
Stu Tomlinson <stu@nosnilmot.com>
parents:
17790
diff
changeset
|
22 #include "internal.h" |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
23 #include "debug.h" |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
24 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
25 #include "buddy.h" |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
26 #include "mdns_interface.h" |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
27 #include "dns_sd_proxy.h" |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
28 #include "dnsquery.h" |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
29 #include "mdns_common.h" |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
30 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
31 static GSList *pending_buddies = NULL; |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
32 |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
33 typedef struct _dnssd_service_ref_handler { |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
34 DNSServiceRef sdRef; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
35 PurpleAccount *account; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
36 guint input_handler; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
37 } DnsSDServiceRefHandlerData; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
38 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
39 /* data used by win32 bonjour implementation */ |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
40 typedef struct _win32_session_impl_data { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
41 DnsSDServiceRefHandlerData *presence_query; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
42 DnsSDServiceRefHandlerData *browser_query; |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
43 DNSRecordRef buddy_icon_rec; |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
44 } Win32SessionImplData; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
45 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
46 typedef struct _win32_buddy_service_resolver_data { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
47 DnsSDServiceRefHandlerData *txt_query; |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
48 uint32_t if_idx; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
49 gchar *name; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
50 gchar *type; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
51 gchar *domain; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
52 /* This is a reference to the entry in BonjourBuddy->ips */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
53 const char *ip; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
54 } Win32SvcResolverData; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
55 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
56 typedef struct _win32_buddy_impl_data { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
57 GSList *resolvers; |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
58 DnsSDServiceRefHandlerData *null_query; |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
59 } Win32BuddyImplData; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
60 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
61 /* data structure for the resolve callback */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
62 typedef struct _ResolveCallbackArgs { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
63 DnsSDServiceRefHandlerData *resolver_query; |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
64 PurpleAccount *account; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
65 BonjourBuddy *bb; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
66 Win32SvcResolverData *res_data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
67 gchar *full_service_name; |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
68 PurpleDnsQueryData *dns_query; |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
69 } ResolveCallbackArgs; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
70 |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
71 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
72 static gint |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
73 _find_resolver_data(gconstpointer a, gconstpointer b) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
74 const Win32SvcResolverData *rd_a = a; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
75 const Win32SvcResolverData *rd_b = b; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
76 gint ret = 1; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
77 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
78 if(rd_a->if_idx == rd_b->if_idx |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
79 && !strcmp(rd_a->name, rd_b->name) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
80 && !strcmp(rd_a->type, rd_b->type) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
81 && !strcmp(rd_a->domain, rd_b->domain)) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
82 ret = 0; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
83 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
84 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
85 return ret; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
86 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
87 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
88 static void |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
89 _cleanup_resolver_data(Win32SvcResolverData *rd) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
90 if (rd->txt_query != NULL) { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
91 purple_input_remove(rd->txt_query->input_handler); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
92 DNSServiceRefDeallocate(rd->txt_query->sdRef); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
93 g_free(rd->txt_query); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
94 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
95 g_free(rd->name); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
96 g_free(rd->type); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
97 g_free(rd->domain); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
98 g_free(rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
99 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
100 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
101 static void |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
102 _mdns_handle_event(gpointer data, gint source, PurpleInputCondition condition) { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
103 DnsSDServiceRefHandlerData *srh = data; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
104 DNSServiceErrorType errorCode = DNSServiceProcessResult(srh->sdRef); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
105 if (errorCode != kDNSServiceErr_NoError) { |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
106 purple_debug_error("bonjour", "Error (%d) handling mDNS response.\n", errorCode); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
107 /* This happens when the mDNSResponder goes down, I haven't seen it happen any other time (in my limited testing) */ |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
108 if (errorCode == kDNSServiceErr_Unknown) { |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
109 purple_connection_error_reason(srh->account->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
110 _("Error communicating with local mDNSResponder.")); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
111 } |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
112 } |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
113 } |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
114 |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
115 static void |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
116 _mdns_parse_text_record(BonjourBuddy *buddy, const char *record, uint16_t record_len) |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
117 { |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
118 const char *txt_entry; |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
119 uint8_t txt_len; |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
120 int i; |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
121 |
18858
f773aa054dca
Clear bonjour buddy values before resetting them so that we notice value removals.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
122 clear_bonjour_buddy_values(buddy); |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
123 for (i = 0; buddy_TXT_records[i] != NULL; i++) { |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
124 txt_entry = TXTRecordGetValuePtr(record_len, record, buddy_TXT_records[i], &txt_len); |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
125 if (txt_entry != NULL) |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
126 set_bonjour_buddy_value(buddy, buddy_TXT_records[i], txt_entry, txt_len); |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
127 } |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
128 } |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
129 |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
130 static void DNSSD_API |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
131 _mdns_record_query_callback(DNSServiceRef DNSServiceRef, DNSServiceFlags flags, |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
132 uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *fullname, |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
133 uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
134 uint32_t ttl, void *context) |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
135 { |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
136 |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
137 if (errorCode != kDNSServiceErr_NoError) { |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
138 purple_debug_error("bonjour", "record query - callback error.\n"); |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
139 /* TODO: Probably should remove the buddy when this happens */ |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
140 } else if (flags & kDNSServiceFlagsAdd) { |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
141 if (rrtype == kDNSServiceType_TXT) { |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
142 /* New Buddy */ |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
143 BonjourBuddy *bb = (BonjourBuddy*) context; |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
144 _mdns_parse_text_record(bb, rdata, rdlen); |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
145 bonjour_buddy_add_to_purple(bb, NULL); |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
146 } else if (rrtype == kDNSServiceType_NULL) { |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
147 /* Buddy Icon response */ |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
148 BonjourBuddy *bb = (BonjourBuddy*) context; |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
149 Win32BuddyImplData *idata = bb->mdns_impl_data; |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
150 |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
151 g_return_if_fail(idata != NULL); |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
152 |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
153 bonjour_buddy_got_buddy_icon(bb, rdata, rdlen); |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
154 |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
155 /* We've got what we need; stop listening */ |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
156 purple_input_remove(idata->null_query->input_handler); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
157 DNSServiceRefDeallocate(idata->null_query->sdRef); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
158 g_free(idata->null_query); |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
159 idata->null_query = NULL; |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
160 } |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
161 } |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
162 } |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
163 |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
164 static void |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
165 _mdns_resolve_host_callback(GSList *hosts, gpointer data, const char *error_message) |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
166 { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
167 ResolveCallbackArgs *args = (ResolveCallbackArgs*) data; |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
168 Win32BuddyImplData *idata = args->bb->mdns_impl_data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
169 gboolean delete_buddy = FALSE; |
24861
c73a891d26a6
Fix a race condition that can result in a NULL ptr deref. Fixes #7920.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22977
diff
changeset
|
170 PurpleBuddy *pb = NULL; |
c73a891d26a6
Fix a race condition that can result in a NULL ptr deref. Fixes #7920.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22977
diff
changeset
|
171 |
c73a891d26a6
Fix a race condition that can result in a NULL ptr deref. Fixes #7920.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22977
diff
changeset
|
172 /* Make sure that the BonjourBuddy associated with this request is still around */ |
c73a891d26a6
Fix a race condition that can result in a NULL ptr deref. Fixes #7920.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22977
diff
changeset
|
173 if (g_slist_find(pending_buddies, args->bb) == NULL) |
c73a891d26a6
Fix a race condition that can result in a NULL ptr deref. Fixes #7920.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22977
diff
changeset
|
174 goto cleanup; |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
175 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
176 if ((pb = purple_find_buddy(args->account, args->bb->name))) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
177 if (pb->proto_data != args->bb) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
178 purple_debug_error("bonjour", "Found purple buddy for %s not matching bonjour buddy record. " |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
179 "This is going to be ugly!.\n", args->bb->name); |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
180 |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
181 if (!hosts || !hosts->data) { |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
182 purple_debug_error("bonjour", "host resolution - callback error.\n"); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
183 delete_buddy = TRUE; |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
184 } else { |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
185 struct sockaddr_in *addr = g_slist_nth_data(hosts, 1); |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
186 DNSServiceErrorType errorCode; |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
187 DNSServiceRef txt_query_sr; |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
188 |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
189 /* finally, set up the continuous txt record watcher, and add the buddy to purple */ |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
190 errorCode = DNSServiceQueryRecord(&txt_query_sr, kDNSServiceFlagsLongLivedQuery, |
18846
44ad08a02ead
Fix recieving status updates for bonjour (win32 implementation).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18845
diff
changeset
|
191 kDNSServiceInterfaceIndexAny, args->full_service_name, kDNSServiceType_TXT, |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
192 kDNSServiceClass_IN, _mdns_record_query_callback, args->bb); |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
193 if (errorCode == kDNSServiceErr_NoError) { |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
194 const char *ip = inet_ntoa(addr->sin_addr); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
195 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
196 purple_debug_info("bonjour", "Found buddy %s at %s:%d\n", args->bb->name, ip, args->bb->port_p2pj); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
197 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
198 args->bb->ips = g_slist_prepend(args->bb->ips, g_strdup(ip)); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
199 args->res_data->ip = args->bb->ips->data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
200 |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
201 args->res_data->txt_query = g_new(DnsSDServiceRefHandlerData, 1); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
202 args->res_data->txt_query->sdRef = txt_query_sr; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
203 args->res_data->txt_query->account = args->account; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
204 |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
205 args->res_data->txt_query->input_handler = purple_input_add(DNSServiceRefSockFD(txt_query_sr), |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
206 PURPLE_INPUT_READ, _mdns_handle_event, args->res_data->txt_query); |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
207 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
208 bonjour_buddy_add_to_purple(args->bb, NULL); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
209 } else { |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
210 purple_debug_error("bonjour", "Unable to set up record watcher for buddy %s (%d)\n", args->bb->name, errorCode); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
211 delete_buddy = TRUE; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
212 } |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
213 |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
214 } |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
215 |
24861
c73a891d26a6
Fix a race condition that can result in a NULL ptr deref. Fixes #7920.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22977
diff
changeset
|
216 cleanup: |
c73a891d26a6
Fix a race condition that can result in a NULL ptr deref. Fixes #7920.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22977
diff
changeset
|
217 |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
218 /* free the hosts list*/ |
21019
f119cd1cb47c
Fix a leak of the dns query results.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21017
diff
changeset
|
219 while (hosts != NULL) { |
f119cd1cb47c
Fix a leak of the dns query results.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21017
diff
changeset
|
220 hosts = g_slist_remove(hosts, hosts->data); |
f119cd1cb47c
Fix a leak of the dns query results.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21017
diff
changeset
|
221 g_free(hosts->data); |
f119cd1cb47c
Fix a leak of the dns query results.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21017
diff
changeset
|
222 hosts = g_slist_remove(hosts, hosts->data); |
f119cd1cb47c
Fix a leak of the dns query results.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21017
diff
changeset
|
223 } |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
224 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
225 if (delete_buddy) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
226 idata->resolvers = g_slist_remove(idata->resolvers, args->res_data); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
227 _cleanup_resolver_data(args->res_data); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
228 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
229 /* If this was the last resolver, remove the buddy */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
230 if (idata->resolvers == NULL) { |
22977
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
231 if (pb) |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
232 bonjour_buddy_signed_off(pb); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
233 else |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
234 bonjour_buddy_delete(args->bb); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
235 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
236 /* Remove from the pending list */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
237 pending_buddies = g_slist_remove(pending_buddies, args->bb); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
238 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
239 } else { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
240 /* Remove from the pending list */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
241 pending_buddies = g_slist_remove(pending_buddies, args->bb); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
242 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
243 |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
244 /* free the remaining args memory */ |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
245 g_free(args->full_service_name); |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
246 g_free(args); |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
247 } |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
248 |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
249 static void DNSSD_API |
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
250 _mdns_service_resolve_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
251 const char *fullname, const char *hosttarget, uint16_t port, uint16_t txtLen, const char *txtRecord, void *context) |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
252 { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
253 ResolveCallbackArgs *args = (ResolveCallbackArgs*) context; |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
254 Win32BuddyImplData *idata = args->bb->mdns_impl_data; |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
255 |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
256 /* remove the input fd and destroy the service ref */ |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
257 purple_input_remove(args->resolver_query->input_handler); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
258 DNSServiceRefDeallocate(args->resolver_query->sdRef); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
259 g_free(args->resolver_query); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
260 args->resolver_query = NULL; |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
261 |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
262 if (errorCode != kDNSServiceErr_NoError) |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
263 purple_debug_error("bonjour", "service resolver - callback error.\n"); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
264 else { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
265 /* set more arguments, and start the host resolver */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
266 |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
267 if ((args->dns_query = |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
268 purple_dnsquery_a(hosttarget, port, _mdns_resolve_host_callback, args)) != NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
269 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
270 args->full_service_name = g_strdup(fullname); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
271 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
272 /* TODO: Should this be per resolver? */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
273 args->bb->port_p2pj = ntohs(port); |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
274 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
275 /* We don't want to hit the cleanup code */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
276 return; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
277 } else |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
278 purple_debug_error("bonjour", "service resolver - host resolution failed.\n"); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
279 } |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
280 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
281 /* If we get this far, clean up */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
282 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
283 idata->resolvers = g_slist_remove(idata->resolvers, args->res_data); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
284 _cleanup_resolver_data(args->res_data); |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
285 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
286 /* If this was the last resolver, remove the buddy */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
287 if (idata->resolvers == NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
288 PurpleBuddy *pb; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
289 /* See if this is now attached to a PurpleBuddy */ |
22977
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
290 if ((pb = purple_find_buddy(args->account, args->bb->name))) |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
291 bonjour_buddy_signed_off(pb); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
292 else { |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
293 /* Remove from the pending list */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
294 pending_buddies = g_slist_remove(pending_buddies, args->bb); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
295 bonjour_buddy_delete(args->bb); |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
296 } |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
297 } |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
298 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
299 g_free(args); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
300 |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
301 } |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
302 |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
303 static void DNSSD_API |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
304 _mdns_service_register_callback(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode, |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
305 const char *name, const char *regtype, const char *domain, void *context) { |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
306 |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
307 /* TODO: deal with collision */ |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
308 if (errorCode != kDNSServiceErr_NoError) |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
309 purple_debug_error("bonjour", "service advertisement - callback error (%d).\n", errorCode); |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
310 else |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
311 purple_debug_info("bonjour", "service advertisement - callback.\n"); |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
312 } |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
313 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
314 static void DNSSD_API |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
315 _mdns_service_browse_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
316 DNSServiceErrorType errorCode, const char *serviceName, const char *regtype, const char *replyDomain, void *context) |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
317 { |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
318 PurpleAccount *account = (PurpleAccount*)context; |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
319 |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
320 if (errorCode != kDNSServiceErr_NoError) |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
321 purple_debug_error("bonjour", "service browser - callback error (%d)\n", errorCode); |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
322 else if (flags & kDNSServiceFlagsAdd) { |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
323 /* A presence service instance has been discovered... check it isn't us! */ |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
324 if (purple_utf8_strcasecmp(serviceName, account->username) != 0) { |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
325 DNSServiceErrorType resErrorCode; |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
326 /* OK, lets go ahead and resolve it to add to the buddy list */ |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
327 ResolveCallbackArgs *args = g_new0(ResolveCallbackArgs, 1); |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
328 DNSServiceRef resolver_sr; |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
329 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
330 purple_debug_info("bonjour", "Received new record for '%s' on iface %u (%s, %s)\n", |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
331 serviceName, interfaceIndex, regtype ? regtype : "", |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
332 replyDomain ? replyDomain : ""); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
333 |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
334 resErrorCode = DNSServiceResolve(&resolver_sr, 0, 0, serviceName, regtype, |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
335 replyDomain, _mdns_service_resolve_callback, args); |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
336 if (resErrorCode == kDNSServiceErr_NoError) { |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
337 GSList *tmp = pending_buddies; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
338 PurpleBuddy *pb; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
339 BonjourBuddy* bb = NULL; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
340 Win32SvcResolverData *rd; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
341 Win32BuddyImplData *idata; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
342 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
343 /* Is there an existing buddy? */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
344 if ((pb = purple_find_buddy(account, serviceName))) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
345 bb = pb->proto_data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
346 /* Is there a pending buddy? */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
347 else { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
348 while (tmp) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
349 BonjourBuddy *bb_tmp = tmp->data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
350 if (!strcmp(bb_tmp->name, serviceName)) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
351 bb = bb_tmp; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
352 break; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
353 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
354 tmp = tmp->next; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
355 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
356 } |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
357 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
358 if (bb == NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
359 bb = bonjour_buddy_new(serviceName, account); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
360 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
361 /* This is only necessary for the wacky case where someone previously manually added a buddy. */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
362 if (pb == NULL) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
363 pending_buddies = g_slist_prepend(pending_buddies, bb); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
364 else |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
365 pb->proto_data = bb; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
366 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
367 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
368 rd = g_new0(Win32SvcResolverData, 1); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
369 rd->if_idx = interfaceIndex; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
370 rd->name = g_strdup(serviceName); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
371 rd->type = g_strdup(regtype); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
372 rd->domain = g_strdup(replyDomain); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
373 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
374 idata = bb->mdns_impl_data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
375 idata->resolvers = g_slist_prepend(idata->resolvers, rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
376 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
377 args->bb = bb; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
378 args->res_data = rd; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
379 args->account = account; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
380 |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
381 args->resolver_query = g_new(DnsSDServiceRefHandlerData, 1); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
382 args->resolver_query->sdRef = resolver_sr; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
383 args->resolver_query->account = account; |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
384 /* get a file descriptor for this service ref, and add it to the input list */ |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
385 args->resolver_query->input_handler = purple_input_add(DNSServiceRefSockFD(resolver_sr), |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
386 PURPLE_INPUT_READ, _mdns_handle_event, args->resolver_query); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
387 } else { |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
388 purple_debug_error("bonjour", "service browser - failed to resolve service. (%d)\n", resErrorCode); |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
389 g_free(args); |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
390 } |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
391 } |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
392 } else { |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
393 PurpleBuddy *pb = NULL; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
394 |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
395 /* A peer has sent a goodbye packet, remove them from the buddy list */ |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
396 purple_debug_info("bonjour", "Received remove notification for '%s' on iface %u (%s, %s)\n", |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
397 serviceName, interfaceIndex, regtype ? regtype : "", |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
398 replyDomain ? replyDomain : ""); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
399 |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19399
diff
changeset
|
400 pb = purple_find_buddy(account, serviceName); |
21527
5b9da9db7e81
Various bugfixes including using purple_account_remove_buddy() in addition to purple_blist_remove_buddy() to make sure that the buddy gets cleaned up fully when logging out or we go offline.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21019
diff
changeset
|
401 if (pb != NULL) { |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
402 GSList *l; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
403 /* There may be multiple presences, we should only get rid of this one */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
404 Win32SvcResolverData *rd_search; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
405 BonjourBuddy *bb = pb->proto_data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
406 Win32BuddyImplData *idata; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
407 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
408 g_return_if_fail(bb != NULL); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
409 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
410 idata = bb->mdns_impl_data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
411 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
412 rd_search = g_new0(Win32SvcResolverData, 1); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
413 rd_search->if_idx = interfaceIndex; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
414 rd_search->name = (gchar *) serviceName; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
415 rd_search->type = (gchar *) regtype; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
416 rd_search->domain = (gchar *) replyDomain; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
417 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
418 l = g_slist_find_custom(idata->resolvers, rd_search, _find_resolver_data); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
419 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
420 g_free(rd_search); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
421 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
422 if (l != NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
423 Win32SvcResolverData *rd = l->data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
424 idata->resolvers = g_slist_delete_link(idata->resolvers, l); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
425 /* This IP is no longer available */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
426 if (rd->ip != NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
427 bb->ips = g_slist_remove(bb->ips, rd->ip); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
428 g_free((gchar *) rd->ip); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
429 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
430 _cleanup_resolver_data(rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
431 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
432 /* If this was the last resolver, remove the buddy */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
433 if (idata->resolvers == NULL) { |
22977
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
434 purple_debug_info("bonjour", "Removed last presence for buddy '%s'; signing off buddy.\n", |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
435 serviceName); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
436 bonjour_buddy_signed_off(pb); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
437 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
438 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
439 } else { |
21527
5b9da9db7e81
Various bugfixes including using purple_account_remove_buddy() in addition to purple_blist_remove_buddy() to make sure that the buddy gets cleaned up fully when logging out or we go offline.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21019
diff
changeset
|
440 purple_debug_warning("bonjour", "Unable to find buddy (%s) to remove\n", serviceName ? serviceName : "(null)"); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
441 /* TODO: Should we look in the pending buddies list? */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
442 } |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
443 } |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
444 } |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
445 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
446 /**************************** |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
447 * mdns_interface functions * |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
448 ****************************/ |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
449 |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
450 gboolean _mdns_init_session(BonjourDnsSd *data) { |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
451 data->mdns_impl_data = g_new0(Win32SessionImplData, 1); |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
452 return TRUE; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
453 } |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
454 |
18859
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
455 gboolean _mdns_publish(BonjourDnsSd *data, PublishType type, GSList *records) { |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
456 TXTRecordRef dns_data; |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
457 gboolean ret = TRUE; |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
458 DNSServiceErrorType errorCode = kDNSServiceErr_NoError; |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
459 Win32SessionImplData *idata = data->mdns_impl_data; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
460 |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
461 g_return_val_if_fail(idata != NULL, FALSE); |
17739
c96b085ddf5c
Clean up Bonjour service publishing and improve XEP-0174 compliance.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17733
diff
changeset
|
462 |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
463 TXTRecordCreate(&dns_data, 256, NULL); |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
464 |
18859
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
465 while (records) { |
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
466 PurpleKeyValuePair *kvp = records->data; |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
467 errorCode = TXTRecordSetValue(&dns_data, kvp->key, strlen(kvp->value), kvp->value); |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
468 if (errorCode != kDNSServiceErr_NoError) |
18859
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
469 break; |
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
470 records = records->next; |
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
471 } |
17739
c96b085ddf5c
Clean up Bonjour service publishing and improve XEP-0174 compliance.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17733
diff
changeset
|
472 |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
473 if (errorCode != kDNSServiceErr_NoError) { |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
474 purple_debug_error("bonjour", "Unable to allocate memory for text record.(%d)\n", errorCode); |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
475 ret = FALSE; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
476 } else { |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
477 /* OK, we're done constructing the text record, (re)publish the service */ |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
478 DNSServiceRef presence_sr; |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
479 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
480 switch (type) { |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
481 case PUBLISH_START: |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
482 purple_debug_info("bonjour", "Registering presence on port %d\n", data->port_p2pj); |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21987
diff
changeset
|
483 errorCode = DNSServiceRegister(&presence_sr, 0, 0, purple_account_get_username(data->account), LINK_LOCAL_RECORD_NAME, |
17744
bbe9248337ea
Fix network byte order issues with win32 bonjour stuff. Also copy the buddy's ip address so that subsequent calls don't overwrite it (it already is being copied and freed because of the howl implementation).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17743
diff
changeset
|
484 NULL, NULL, htons(data->port_p2pj), TXTRecordGetLength(&dns_data), TXTRecordGetBytesPtr(&dns_data), |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
485 _mdns_service_register_callback, NULL); |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
486 break; |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
487 |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
488 case PUBLISH_UPDATE: |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
489 purple_debug_info("bonjour", "Updating presence.\n"); |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
490 errorCode = DNSServiceUpdateRecord(idata->presence_query->sdRef, NULL, 0, TXTRecordGetLength(&dns_data), TXTRecordGetBytesPtr(&dns_data), 0); |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
491 break; |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
492 } |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
493 |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
494 if (errorCode != kDNSServiceErr_NoError) { |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
495 purple_debug_error("bonjour", "Failed to publish presence service.(%d)\n", errorCode); |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
496 ret = FALSE; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
497 } else if (type == PUBLISH_START) { |
18846
44ad08a02ead
Fix recieving status updates for bonjour (win32 implementation).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18845
diff
changeset
|
498 /* We need to do this because according to the Apple docs: |
44ad08a02ead
Fix recieving status updates for bonjour (win32 implementation).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18845
diff
changeset
|
499 * "the client is responsible for ensuring that DNSServiceProcessResult() is called |
44ad08a02ead
Fix recieving status updates for bonjour (win32 implementation).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18845
diff
changeset
|
500 * whenever there is a reply from the daemon - the daemon may terminate its connection |
44ad08a02ead
Fix recieving status updates for bonjour (win32 implementation).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18845
diff
changeset
|
501 * with a client that does not process the daemon's responses */ |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
502 idata->presence_query = g_new(DnsSDServiceRefHandlerData, 1); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
503 idata->presence_query->sdRef = presence_sr; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
504 idata->presence_query->account = data->account; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
505 idata->presence_query->input_handler = purple_input_add(DNSServiceRefSockFD(presence_sr), |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
506 PURPLE_INPUT_READ, _mdns_handle_event, idata->presence_query); |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
507 } |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
508 } |
17743
9ccec98b8ca9
Cleanup win32 of bonjour stuff - fix to only use glib to allocate and free memory to avoid confusion later.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17742
diff
changeset
|
509 |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
510 /* Free the memory used by temp data */ |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
511 TXTRecordDeallocate(&dns_data); |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
512 return ret; |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
513 } |
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
514 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
515 gboolean _mdns_browse(BonjourDnsSd *data) { |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
516 DNSServiceErrorType errorCode; |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
517 Win32SessionImplData *idata = data->mdns_impl_data; |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
518 DNSServiceRef browser_sr; |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
519 |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
520 g_return_val_if_fail(idata != NULL, FALSE); |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
521 |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21987
diff
changeset
|
522 errorCode = DNSServiceBrowse(&browser_sr, 0, 0, LINK_LOCAL_RECORD_NAME, NULL, |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
523 _mdns_service_browse_callback, data->account); |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
524 if (errorCode == kDNSServiceErr_NoError) { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
525 idata->browser_query = g_new(DnsSDServiceRefHandlerData, 1); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
526 idata->browser_query->sdRef = browser_sr; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
527 idata->browser_query->account = data->account; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
528 idata->browser_query->input_handler = purple_input_add(DNSServiceRefSockFD(browser_sr), |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
529 PURPLE_INPUT_READ, _mdns_handle_event, idata->browser_query); |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
530 return TRUE; |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
531 } else |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
532 purple_debug_error("bonjour", "Error registering Local Link presence browser. (%d)\n", errorCode); |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
533 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
534 |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
535 return FALSE; |
17733
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
536 } |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
537 |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
538 void _mdns_stop(BonjourDnsSd *data) { |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
539 Win32SessionImplData *idata = data->mdns_impl_data; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
540 |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
541 if (idata == NULL) |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
542 return; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
543 |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
544 if (idata->presence_query != NULL) { |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
545 purple_input_remove(idata->presence_query->input_handler); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
546 DNSServiceRefDeallocate(idata->presence_query->sdRef); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
547 g_free(idata->presence_query); |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
548 } |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
549 |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
550 if (idata->browser_query != NULL) { |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
551 purple_input_remove(idata->browser_query->input_handler); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
552 DNSServiceRefDeallocate(idata->browser_query->sdRef); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
553 g_free(idata->browser_query); |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
554 } |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
555 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
556 g_free(idata); |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
557 |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
558 data->mdns_impl_data = NULL; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
559 } |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
560 |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
561 gboolean _mdns_set_buddy_icon_data(BonjourDnsSd *data, gconstpointer avatar_data, gsize avatar_len) { |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
562 Win32SessionImplData *idata = data->mdns_impl_data; |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
563 DNSServiceErrorType errorCode = kDNSServiceErr_NoError; |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
564 |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
565 g_return_val_if_fail(idata != NULL, FALSE); |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
566 |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
567 if (avatar_data != NULL && idata->buddy_icon_rec == NULL) { |
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
568 purple_debug_info("bonjour", "Setting new buddy icon.\n"); |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
569 errorCode = DNSServiceAddRecord(idata->presence_query->sdRef, &idata->buddy_icon_rec, |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
570 0, kDNSServiceType_NULL, avatar_len, avatar_data, 0); |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
571 } else if (avatar_data != NULL) { |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
572 purple_debug_info("bonjour", "Updating existing buddy icon.\n"); |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
573 errorCode = DNSServiceUpdateRecord(idata->presence_query->sdRef, idata->buddy_icon_rec, |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
574 0, avatar_len, avatar_data, 0); |
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
575 } else if (idata->buddy_icon_rec != NULL) { |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
576 purple_debug_info("bonjour", "Removing existing buddy icon.\n"); |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
577 errorCode = DNSServiceRemoveRecord(idata->presence_query->sdRef, idata->buddy_icon_rec, 0); |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
578 idata->buddy_icon_rec = NULL; |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
579 } |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
580 |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
581 if (errorCode != kDNSServiceErr_NoError) { |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
582 purple_debug_error("bonjour", "Error (%d) setting buddy icon record.\n", errorCode); |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
583 return FALSE; |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
584 } |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
585 |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
586 return TRUE; |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
587 } |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18804
diff
changeset
|
588 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
589 void _mdns_init_buddy(BonjourBuddy *buddy) { |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
590 buddy->mdns_impl_data = g_new0(Win32BuddyImplData, 1); |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
591 } |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
592 |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
593 void _mdns_delete_buddy(BonjourBuddy *buddy) { |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
594 Win32BuddyImplData *idata = buddy->mdns_impl_data; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
595 |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
596 g_return_if_fail(idata != NULL); |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
597 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
598 while (idata->resolvers) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
599 Win32SvcResolverData *rd = idata->resolvers->data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
600 _cleanup_resolver_data(rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
601 idata->resolvers = g_slist_delete_link(idata->resolvers, idata->resolvers); |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
602 } |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
603 |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
604 if (idata->null_query != NULL) { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
605 purple_input_remove(idata->null_query->input_handler); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
606 DNSServiceRefDeallocate(idata->null_query->sdRef); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
607 g_free(idata->null_query); |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
608 } |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
609 |
18798
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
610 g_free(idata); |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
611 |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
612 buddy->mdns_impl_data = NULL; |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
613 } |
ed1def07d86e
Refactor the bonjour mdns implementation abstraction in preparation for the avahi implementation. Also fix alias assignment from the server to populate the server alias instead of the local alias.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18761
diff
changeset
|
614 |
18849
1787e601aafc
_mdns_retrieve_retrieve_buddy_icon() - what kind of crack am I on anyway?
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18847
diff
changeset
|
615 void _mdns_retrieve_buddy_icon(BonjourBuddy* buddy) { |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
616 Win32BuddyImplData *idata = buddy->mdns_impl_data; |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
617 char svc_name[kDNSServiceMaxDomainName]; |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
618 |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
619 g_return_if_fail(idata != NULL); |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
620 |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
621 /* Cancel any existing query */ |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
622 if (idata->null_query != NULL) { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
623 purple_input_remove(idata->null_query->input_handler); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
624 DNSServiceRefDeallocate(idata->null_query->sdRef); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
625 g_free(idata->null_query); |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
626 idata->null_query = NULL; |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
627 } |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
628 |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21987
diff
changeset
|
629 if (DNSServiceConstructFullName(svc_name, buddy->name, LINK_LOCAL_RECORD_NAME, "local") != 0) |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
630 purple_debug_error("bonjour", "Unable to construct full name to retrieve buddy icon for %s.\n", buddy->name); |
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
631 else { |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
632 DNSServiceRef null_query_sr; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
633 |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
634 DNSServiceErrorType errorCode = DNSServiceQueryRecord(&null_query_sr, 0, kDNSServiceInterfaceIndexAny, |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
635 svc_name, kDNSServiceType_NULL, kDNSServiceClass_IN, _mdns_record_query_callback, buddy); |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
636 |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
637 if (errorCode == kDNSServiceErr_NoError) { |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
638 idata->null_query = g_new(DnsSDServiceRefHandlerData, 1); |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
639 |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
640 idata->null_query->sdRef = null_query_sr; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
641 idata->null_query->account = buddy->account; |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
642 |
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
643 idata->null_query->input_handler = purple_input_add(DNSServiceRefSockFD(null_query_sr), |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
644 PURPLE_INPUT_READ, _mdns_handle_event, idata->null_query); |
21987
71d18f5adbba
Detect the mdnsresponder crashing in the DnsSD implementation and disconnect the account instead of pegging the CPU.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21980
diff
changeset
|
645 } else |
21980
26648115261c
Improve error handling, particularly the debug output. I was hoping that this would provide some debug output that could be used to figure out how to detect and disconnect when the mdnsResponder crashes, but that doesn't appear to be the case.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
646 purple_debug_error("bonjour", "Unable to query buddy icon record for %s. (%d)\n", buddy->name, errorCode); |
18799
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
647 } |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
648 |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
649 } |
83719d57a8ee
Implement bonjour buddy icons in the win32 implementation. Avahi's howl wrapper doesn't implement sw_discovery_query_record(), so we can't do it elsewhere yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18798
diff
changeset
|
650 |