Commit Graph

28 Commits

Author SHA1 Message Date
Mike Frysinger
e5e08ebedb gthreadedresolver.c: Fix for Android 5.0+
https://bugzilla.gnome.org/show_bug.cgi?id=756477
2015-10-13 09:04:39 -04:00
Colin Walters
e55a953642 gthreadedresolver: Unref unexpected address
I don't believe any real app would hit this, but we do leak
if it occurs.

Spotted by static analysis.

https://bugzilla.gnome.org/show_bug.cgi?id=733576
2014-07-23 07:43:41 -04:00
Philip Withnall
956921e51f gresolver: Ensure GThreadedResolver always sets an error if resolution fails
It was previously possible for GThreadedResolver to return an empty list
and no error in response to a g_resolver_lookup_by_name() call, if it
happened that all the addresses returned by getaddrinfo() could not be
converted from native addresses to GSocketAddresses.

Fix that by setting a G_RESOLVER_ERROR_NOT_FOUND if the returned list is
empty.

https://bugzilla.gnome.org/show_bug.cgi?id=728776
2014-04-25 09:52:01 +01:00
Dan Winship
c565d645e9 gio: remove an unneeded pragma
ddf82a25 removed the use of non-literal format strings from
gthreadedresolver.c, but left the "#pragma GCC diagnostic ignored
-Wformat-nonliteral" behind.
2014-04-24 12:18:36 -04:00
Dan Winship
5575a3e9cb gio: don't accept nonstandard IPv4 "numbers-and-dots" addresses
In addition to the standard "192.168.1.1" format, there are numerous
legacy IPv4 address formats (such as "192.168.257",
"0xc0.0xa8.0x01.0x01", "0300.0250.0001.0001", "3232235777", and
"0xc0a80101"). However, none of these forms are ever used any more
except in phishing attempts. GLib wasn't supposed to be accepting
these addresses (neither g_hostname_is_ip_address() nor
g_inet_address_new_from_string() recognizes them), but getaddrinfo()
accepts them, and so the parts of gio that use getaddrinfo()
accidentally did accept those formats.

Fix GNetworkAddress and GResolver to reject these address formats.

https://bugzilla.gnome.org/show_bug.cgi?id=679957
2014-02-15 10:22:24 -05:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Ryan Lortie
ddf82a2576 [PATCH] Fix trivial non literal format uses
Based on a patch from Henrique Dante de Almeida <hdante@gmail.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=691608
2013-12-08 14:22:51 -05:00
John Ralls
ab5aa2aa3a Fix the -Werror=format-nonliteral fixes for older GCCs
They don't allow that pragma inside functions.
2013-09-29 11:33:30 -07:00
John Ralls
09d83640a8 More -Werror=format-nonliteral fixes
This fixes the build with CLang.

https://bugzilla.gnome.org/show_bug.cgi?id=702516
2013-09-29 11:03:16 -04:00
Sebastian Dröge
bcbaf1bef0 Fix compilation on Android with the bionic C library
https://bugzilla.gnome.org/show_bug.cgi?id=689223
2013-04-16 13:24:26 +02:00
Giovanni Campagna
3456152f23 GThreadedResolver: set an error if no records could be found
It is possible that the upstream servers return something, but
we then filter all results because they are of the wrong type.
In that case the API and subsequent GTask calls expect a GError
to be set.

https://bugzilla.gnome.org/show_bug.cgi?id=696857
2013-04-02 23:04:15 +02:00
Dan Winship
9e90575502 gio: move resolver utils from gresolver.c to gthreadedresolver.c
Since there is only one resolver implementation now, we can move the
resolver utility functions from gresolver.c into gthreadedresolver.c,
and remove the prototypes from gnetworkingprivate.h.

https://bugzilla.gnome.org/show_bug.cgi?id=623187
2012-12-12 15:20:22 +01:00
Sebastian Dröge
c9affa778e Revert "Fix compilation on Android with the bionic C library"
This reverts commit cb0ed84d40.

It wasn't meant to be pushed yet.
2012-11-28 16:55:12 +01:00
Sebastian Dröge
cb0ed84d40 Fix compilation on Android with the bionic C library 2012-11-28 16:32:48 +01:00
Dan Winship
f1b34cab8a gthreadedresolver: fix a bug in the GTask porting of lookup_records
We were passing the wrong destroy notify when returning the list of
records, so it would crash if it got called (ie, if you didn't call
g_resolver_lookup_records_finish()).

(Also fix s/targets/records/ throughout the records functions.)
2012-11-09 11:41:01 -05:00
Chun-wei Fan
2b17e797a4 gio/gthreadedresolver.c: Fix non-UNIX build
Move the GError *error declaration up, as that variable is also used for
non-Unix builds.
2012-11-05 17:22:38 +08:00
Dan Winship
b20eec3294 gio: port GThreadedResolver from GSimpleAsyncResult to GTask
https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-10-10 10:29:36 -04:00
Stef Walter
666374c16f Add support for MX, TXT, NS and SOA records to GResolver
* Add resolver functions for looking up DNS records of
   various types. Currently implemented: MX, TXT, SOA, SRV, NS
 * Return records as GVariant tuples.
 * Make the GSrvTarget lookups a wrapper over this new
   functionality.
 * Rework the resolver test so that it has support for
   looking up MX, NS, SOA, TXT records, and uses GOptionContext

https://bugzilla.gnome.org/show_bug.cgi?id=672944
2012-04-16 15:51:39 +02:00
Dan Winship
2f48b4b7fb gthreadedresolver: remove a bit of cruft
Remove a test that only made sense when GThreadedResolver was the base
class for the two non-threaded resolver classes that no longer exist.
2011-10-05 08:36:03 -04:00
Ryan Lortie
8bcdabf25a GThreadedResolver: port to embedded GMutex/GCond
This is the only case that was non trivial to port, due to some of the
logic being based on checking the GCond* for being non-%NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=660739
2011-10-04 11:13:46 -04:00
Dan Winship
855e13cc0a GThreadedResolver: don't overwrite errors
If a dns op was cancelled and then the abandoned op failed, it would
try to overwrite the original error. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=658769
2011-09-20 17:00:58 -04:00
Dan Winship
5a30712dc7 Remove !g_thread_supported() codepaths in gio
In particular, remove the libasyncns import, which was only used by
GUnixResolver, which is only used when threads are not available.
Likewise remove GWin32Resolver, and the hacky broken non-threaded
parts of GIOScheduler.

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:47:39 -04:00
muralis
a84e6f982f gthreadedresolver: fix hang on g_thread_pool_push() failure
In resolve_sync function in gthreadedresolver.c, if g_thread_pool_push
fails due to thread creation failure, we are just simply appending the
data to the queue of work to do. After the failure, we might wait
indefinitely in g_cond_wait. In case of g_thread_pool_push failure,
propagate the error so that this function does not blocks forever in
case of failure.

https://bugzilla.gnome.org/show_bug.cgi?id=651034
2011-05-31 08:56:50 -04:00
Ryan Lortie
5b946e0504 gio/: fully remove gioalias hacks 2010-07-07 19:53:22 -04:00
Dan Winship
45067ab9e9 Fix leaks in GSocketClient and GThreadedResolver
Also update gio/tests/send-data.c to test async connection, and free
more stuff in several tests to make leaks easier to see.
2009-07-23 16:27:01 -04:00
Alexander Larsson
a258ec3b5b Fix deadlock in threaded resolver
When you're using the threaded resolver and using a sync call
without a cancellable the resolve_sync forgot to unlock the
initial req->mutex lock, leading to a deadlock when unrefing
the request.
2009-05-15 10:05:55 +02:00
Matthias Clasen
a28215fa90 Release 2.21.0 2009-05-03 18:08:49 -04:00
Dan Winship
c94d3f9288 Add GResolver, a glib-ish interface to DNS
GResolver provides asynchronous (and synchronous-but-cancellable) APIs
for resolving hostnames, reverse-resolving IP addresses back to
hostnames, and resolving SRV records. Part of #548466.
2009-04-22 08:36:32 -04:00