Commit Graph

13534 Commits

Author SHA1 Message Date
Dan Winship
9670d06a66 GNetworkMonitorBase: implement can_reach_async
Implement the g_network_monitor_can_reach_async() rather than falling
back to the default implementation, which calls the sync version (not
in a thread).

https://bugzilla.gnome.org/show_bug.cgi?id=694181
2013-02-20 07:33:58 -05:00
Matthew Barnes
4ca3d80ff3 g_network_monitor_base_can_reach: Check for default route after enumerating.
Enumerate the GSocketConnectable before checking for a default route.
For some connectable types this will involve a DNS lookup.  This will
elminate false positives for hosts behind a VPN since DNS lookup will
fail if the VPN is not connected.

https://bugzilla.gnome.org/show_bug.cgi?id=694181
2013-02-20 07:33:58 -05:00
Dan Winship
c6c1166566 GNetworkAddress: drop cached addresses on resolver reload
If the resolver reloads (ie, if /etc/resolv.conf changes),
GNetworkAddress needs to re-resolve its addresses the next time it's
enumerated. Otherwise hosts that have different IP addresses inside
and outside a VPN won't work correctly if you hold on to a
GNetworkAddress for them for a long time.

https://bugzilla.gnome.org/show_bug.cgi?id=694181
2013-02-20 07:33:58 -05:00
Ryan Lortie
cfafad5aef gutils: stop g_get_home_dir() from reading passwd
In the case that the "HOME" environment variable is set (as it is under
normal circumstances), we don't really need to be opening /etc/passwd.

For historical reasons (ie: how we used to ignore $HOME) and due to the
grouping of many unrelated things together (reading username, hostname,
home directory, tmpdir, etc.) into one function we were still opening
/etc/passwd in g_get_home_dir(), even if $HOME was set.

Since earlier commits removed code from it, all that remains in
g_get_any_init_do() is the logic for dealing with $HOME and reading the
password database.

We now split the logic to deal with $HOME into g_get_home_dir().  With
only the password database functionality remaining, g_get_any_init_do()
is renamed to g_get_user_database_entry() and modified not to set global
variables but rather return a struct.  If g_get_home_dir() cannot find
$HOME, it falls back to calling g_get_user_database_entry() and using
the home directory from there.

Use of the 'g_utils_global' lock is further reduced by using
g_once_init_enter() to protect the critical sections in each of
g_get_user_database_entry() and g_get_home_dir().

Finally, the g_get_user_name() and g_get_real_name() functions are
modified to use the new regime.

https://bugzilla.gnome.org/show_bug.cgi?id=693204
2013-02-20 11:09:30 +00:00
Ryan Lortie
167c73faf4 gutils: replace direct references to g_home_dir
Some code was directly calling g_get_any_init() and then expecting to be
able to use the static 'g_home_dir' variable directly.  Change these
over to g_get_home_dir() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=693204
2013-02-20 11:09:29 +00:00
Ryan Lortie
9879c7f5fa gutils: split out g_get_tmp_dir()
Remove the code for getting the tmpdir from g_get_any_init_do() and
outside of the g_utils_global lock.

https://bugzilla.gnome.org/show_bug.cgi?id=693204
2013-02-20 11:09:29 +00:00
Ryan Lortie
3c9691f7f8 gutils: split out g_get_host_name()
Remove the code for getting the hostname from g_get_any_init_do() and
outside of the g_utils_global lock.

https://bugzilla.gnome.org/show_bug.cgi?id=693204
2013-02-20 11:09:29 +00:00
Ryan Lortie
8c42a663f8 win32: Drop old codepage ABI from gutils.c
This is a source-compatible change and only breaks ABI with respect to
truly ancient binaries (and those binaries are already broken for other
reasons).

Back in the day, functions like g_get_user_name() used to return strings
in the system codepage instead of utf8 (as they do today).

It was decided at some point to change these functions to return utf8,
breaking source compatibility but keeping ABI compatibility.  This was
done by exporting new symbols with names like g_get_user_name_utf8() and
using a #define of the old name over to the new name (so that newly
compiled code would link against the _utf8 version, but old binaries
would continue to use the non-utf8 variant).

Meanwhile, glib has undergone several ABI breaks on Windows since, so
those old binaries don't work anymore.

Start to clean up this mess by removing the #define renaming.  New
binaries calling g_get_user_name() will now link against
g_get_user_name() and it will return utf8.

We must keep the functions like g_get_user_name_utf8() for binary
compatibility with recently built programs (ie: ones built with the
renaming).  Nobody should have ever been calling these directly and of
course they can return utf8, so just add them as internal wrappers in the
.c file and declare them _GLIB_EXTERN there.

One day, if we feel like breaking Windows ABI again, we can finish the
cleanup by dropping the wrappers.  There is some talk of introducing
something like 'ABI compatible for two years' and this change would be
compatible with such a regime.

https://bugzilla.gnome.org/show_bug.cgi?id=693204
2013-02-20 11:09:29 +00:00
Mike Ruprecht
b029135ed4 GOutputStream: Remove unused SpliceUserData struct 2013-02-19 08:47:45 -06:00
Chun-wei Fan
90f726f6b9 Update Visual Studio property sheets
"install" gio/gsimpleproxyresolver.h...
2013-02-19 18:26:30 +08:00
Ryan Lortie
d21699a272 *bump* 2013-02-19 10:06:55 +00:00
Ryan Lortie
766dec9670 GLib 2.35.8 2013-02-19 09:29:28 +00:00
Мирослав Николић
4e975bfc9e Updated Serbian translation 2013-02-18 10:43:49 +01:00
Мирослав Николић
7c3b4617cf Updated Serbian translation 2013-02-18 10:38:38 +01:00
Alexander Larsson
c910c3e7a3 GNetworkAddress: Build if AI_NUMERICSERV not defined
This is not defined on all Win32 SDKs and in some unixes.
If its not defined its safe to just ignore it though.
2013-02-18 10:30:29 +01:00
Piotr Drąg
d175fae8d5 Updated Polish translation 2013-02-17 16:49:40 +01:00
Dan Winship
4061a96cc1 GSimpleProxyResolver: add missing include
string.h was getting pulled in by something else on Linux, but not
elsewhere
2013-02-17 09:54:58 -05:00
Dan Winship
c78d0e9ac4 GSocketClient: add missing NULL to g_object_set() call 2013-02-15 10:39:19 -05:00
Thomas Perl
e4695bd6f5 docs/reference/glib/cross.xml: Fix typo: yes/np -> yes/no
https://bugzilla.gnome.org/show_bug.cgi?id=693502
2013-02-15 10:12:36 -05:00
Dan Winship
8a77f7bb18 gnetworkaddress: preserve IPv6 scope ID in IP literals
If a GNetworkAddress is created with a hostname like "fe80::xxx%em1",
make sure that the scope_id corresponding to "em1" is present in the
GSocketAddresses it returns when used as a GSocketConnectable.

https://bugzilla.gnome.org/show_bug.cgi?id=684404
2013-02-15 09:10:00 -05:00
Dan Winship
a44a3cc150 GSimpleProxyResolver: fix for the case where the default proxy is NULL 2013-02-15 09:03:48 -05:00
Piotr Drąg
afc0a72575 Updated POTFILES.in 2013-02-15 13:45:35 +01:00
Jasper St. Pierre
cb40853eae More doc fixes 2013-02-15 05:39:20 -05:00
Jasper St. Pierre
3522567519 gmenumodel: Fix documentation 2013-02-15 05:35:29 -05:00
Dan Winship
ee17a54c28 GSimpleProxyResolver: new simple GProxyResolver class
Add GSimpleProxyResolver, for letting people do static proxy
resolution, and to use as a base class for other resolvers (such as
GProxyResolverGnome).

https://bugzilla.gnome.org/show_bug.cgi?id=691105
2013-02-14 10:24:14 -05:00
Dan Winship
7c49869eae GSocketClient: add proxy-resolver property
Add a proxy-resolver property to GSocketClient, to allow overriding
proxy resolution in situations where you need to force a particular
proxy rather than using the system defaults.

https://bugzilla.gnome.org/show_bug.cgi?id=691105
2013-02-14 10:24:14 -05:00
Simon McVittie
d200208d2b g_dbus_address_escape_value: add
This is a GLib reimplementation of dbus_address_escape_value().
It's useful if you want to construct a D-Bus address from pieces:
for instance, if you have a listening Unix socket whose path is known,
and you want to connect a D-Bus peer to it.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=693673
Reviewed-by: Colin Walters <walters@verbum.org>
[amended to add Since: 2.36 as per review]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-02-13 20:42:58 +00:00
Stef Walter
035cd81477 gio: Fix annotations on g_[async_]initable_new() and friends
These return a GObject even though in C it's represented as a gpointer

https://bugzilla.gnome.org/show_bug.cgi?id=693694
2013-02-13 07:23:13 +01:00
Matthias Clasen
23d6d1769b Fix the build on Solaris
Make the btrfs support explicitly linux-only, as that is what it
is. With this, there's no need anymore to check for sys/ioctl.h
either.
https://bugzilla.gnome.org/show_bug.cgi?id=692829
2013-02-10 12:23:02 -05:00
Aleksander Morgado
27ecab7553 gdbusobjectmanagerclient: always connect to proxy's 'g-signal'
If we don't connect to the control proxy's 'g-signal' signal, we won't have
'object-added' or 'object-removed' signals. So, connect to the 'g-signal' not
only when there already is a name-owner, but always.

https://bugzilla.gnome.org/show_bug.cgi?id=693285
2013-02-09 20:34:52 +01:00
Wouter Bolsterlee
f9d6dcac0b Updated Dutch translation 2013-02-09 17:50:16 +01:00
Rachid
ff9b0875d0 Updated Dutch translation 2013-02-09 17:41:59 +01:00
Ryan Lortie
d7c8eda186 tests: comment out asserts in dynamic type tests
We have some testcases that assert that type modules are unloaded after
the last reference on them is dropped.  Comment out those asserts now
that we turned the last unref into a no-op.

https://bugzilla.gnome.org/show_bug.cgi?id=693351
2013-02-07 14:15:45 -05:00
Ryan Lortie
72df62600d disable support for unloading of dynamic types
Experimentally disable the ability to unload dynamic types by refusing
to drop the last reference on types (effectively turning the type
unloading into dead code).

The plan is to leave things like this for a stable cycle and only
proceed with removing the code if we are sure that there are no
unforeseen problems.

https://bugzilla.gnome.org/show_bug.cgi?id=693351
2013-02-07 14:15:45 -05:00
Dan Winship
2f61a877d8 build: fix configure arpa/nameser.h test for Solaris
https://bugzilla.gnome.org/show_bug.cgi?id=692827
2013-02-07 08:41:00 -05:00
Fran Diéguez
5b2c87538d Updated Galician translations 2013-02-06 18:20:41 +01:00
Ryan Lortie
7bcd03b570 GLib 2.35.7 2013-02-05 15:50:19 -05:00
Milo Casagrande
87d9b0b1fd [l10n] Updated Italian translation. 2013-02-05 19:22:03 +01:00
Matthias Clasen
7788bb3a91 Make G_IO_FLAG_IS_WRITEABLE and enum value
Having it as a define was causing some problems for bindings.
https://bugzilla.gnome.org/show_bug.cgi?id=657045
2013-02-04 22:46:24 -05:00
Matthias Clasen
262ebcd3fa docs: Add 2 missing :
The file attribute names go by namespace::keyname, not
namespace:keyname.

https://bugzilla.gnome.org/show_bug.cgi?id=636683
2013-02-04 22:35:29 -05:00
Andoni Morales Alastruey
7f9af8071c configure: fix check for atomic operations
Some compilers have support for atomic operations, but do not
define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4. Instead of checking
for this define, we check for __sync_bool_compare_and_swap and
define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 if the compiler doesn't
define it.

https://bugzilla.gnome.org/show_bug.cgi?id=682818
2013-02-04 21:58:10 -05:00
Víctor Manuel Jáquez Leal
6b3ec82732 Compile private test with -pthread on UNIX
The commit f5f151cb removed this linkage, which is needed,
at least for the toolchain gcc version 4.7.2 (Debian 4.7.2-5)

https://bugzilla.gnome.org/show_bug.cgi?id=693105
2013-02-03 23:59:21 +01:00
Matthias Clasen
6bcb1c0ed6 Post-release version bump 2013-02-03 15:14:57 -05:00
Matthias Clasen
3fe8ed04c7 2.35.6 2013-02-03 14:25:09 -05:00
Matthias Clasen
844527c037 Document GIO_USE_FILE_MONITOR 2013-02-03 14:08:02 -05:00
Matthias Clasen
435abb174d Fix a doc comment mismatch 2013-02-03 13:50:36 -05:00
Matthias Clasen
c5ec4831fa Trivial doc comment formatting fix 2013-02-03 13:46:50 -05:00
Matthias Clasen
9c72b5776a add 2.36 index to gobject docs 2013-02-03 13:26:36 -05:00
Matthias Clasen
349e601864 Add 2.36 index to glib docs 2013-02-03 13:25:56 -05:00
Matthias Clasen
f302c65584 Add a 2.36 index to gio docs 2013-02-03 13:24:59 -05:00