<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/glib.git/gio/gthreadedresolver.c, branch require-python34</title>
<subtitle>gitlab.gnome.org: GNOME/glib.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/'/>
<entry>
<title>docs: Change Bugzilla references to GitLab</title>
<updated>2018-06-15T12:04:39+00:00</updated>
<author>
<name>Olivier Crête</name>
<email>olivier.crete@collabora.com</email>
</author>
<published>2018-05-31T21:44:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=8e65417c6ed2a88990a544ce7f951d1fe4320949'/>
<id>8e65417c6ed2a88990a544ce7f951d1fe4320949</id>
<content type='text'>
Including modifications by Philip Withnall &lt;withnall@endlessm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Including modifications by Philip Withnall &lt;withnall@endlessm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gio: C_IN is defined in recent Android headers.</title>
<updated>2018-06-11T13:13:55+00:00</updated>
<author>
<name>Jehan</name>
<email>jehan@girinstud.io</email>
</author>
<published>2018-06-08T23:15:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=631035342dcc8bc5b317b1283b7b0e12d867cda5'/>
<id>631035342dcc8bc5b317b1283b7b0e12d867cda5</id>
<content type='text'>
C_IN macro was added years ago in bcbaf1bef0, using same value as the
internal code of Android with the reasonning that "some parts of the API
used by the resolver objects is not public in the Android NDK (yet)".
Well since then things are changed, since it is definitely available (at
least on the API 22 of Android which I am using) in the public header
arpa/nameser_compat.h.
Let's just add a #ifndef to handle both cases when you build with an
older or recent API.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
C_IN macro was added years ago in bcbaf1bef0, using same value as the
internal code of Android with the reasonning that "some parts of the API
used by the resolver objects is not public in the Android NDK (yet)".
Well since then things are changed, since it is definitely available (at
least on the API 22 of Android which I am using) in the public header
arpa/nameser_compat.h.
Let's just add a #ifndef to handle both cases when you build with an
older or recent API.
</pre>
</div>
</content>
</entry>
<entry>
<title>gthreadedresolver: Fix compilation with res_nclose() but no res_nquery()</title>
<updated>2018-03-26T09:49:25+00:00</updated>
<author>
<name>Sebastian</name>
<email>sebastian_ml@gmx.net</email>
</author>
<published>2018-03-22T19:41:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=e2c16df4b5e6d31b6513bebb4a2bc1c5075fff47'/>
<id>e2c16df4b5e6d31b6513bebb4a2bc1c5075fff47</id>
<content type='text'>
Some very odd systems have the functions to initialise and destroy a
struct __res_state, but apparently not to do a DNS query using it. Fix
the compilation on those systems.

https://bugzilla.gnome.org/show_bug.cgi?id=794606
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some very odd systems have the functions to initialise and destroy a
struct __res_state, but apparently not to do a DNS query using it. Fix
the compilation on those systems.

https://bugzilla.gnome.org/show_bug.cgi?id=794606
</pre>
</div>
</content>
</entry>
<entry>
<title>gio: Port GThreadedResolver to use res_nquery() to fix thread-safety</title>
<updated>2018-02-02T17:05:27+00:00</updated>
<author>
<name>Philip Withnall</name>
<email>withnall@endlessm.com</email>
</author>
<published>2018-01-05T14:26:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=40be86bb0e422247673ccc36fc3c493c882b4390'/>
<id>40be86bb0e422247673ccc36fc3c493c882b4390</id>
<content type='text'>
res_query() uses global state in the form of the struct __res_state
which contains the contents of resolv.conf (and other things). On Linux,
this state seems to be thread-local, so there is no problem. On OS X,
however, it is not, and hence multiple res_query() calls from parallel
threads will compete and return bogus results.

The fix for this is to use res_nquery(), introduced in BIND 8.2, which
takes an explicit state argument. This allows us to manually store the
state thread-locally. If res_nquery() isn’t available, we fall back to
res_query(). It should be available on OS X though. As a data point,
it’s available on Fedora 27.

There’s a slight complication in the fact that OS X requires the state
to be freed using res_ndestroy() rather than res_nclose(). Linux uses
res_nclose().

(See, for example, the NetBSD man page:
https://www.unix.com/man-page/netbsd/3/res_ninit/. The Linux one is
incomplete and not so useful:
http://man7.org/linux/man-pages/man3/resolver.3.html.)

The new code will call res_ninit() once per res_nquery() task. This is
not optimal, but no worse than before — since res_query() was being
called in a worker thread, on Linux, it would implicitly initialise the
thread-local struct __res_state when it was called. We’ve essentially
just made that explicit. In practical terms, this means a
stat("/etc/resolv.conf") call per res_nquery() task.

In future, we could improve this by using an explicit thread pool with
some manually-created worker threads, each of which initialises a struct
__res_state on spawning, and only updates it on receiving
the #GResolver::reload signal.

Signed-off-by: Philip Withnall &lt;withnall@endlessm.com&gt;

https://bugzilla.gnome.org/show_bug.cgi?id=792050
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
res_query() uses global state in the form of the struct __res_state
which contains the contents of resolv.conf (and other things). On Linux,
this state seems to be thread-local, so there is no problem. On OS X,
however, it is not, and hence multiple res_query() calls from parallel
threads will compete and return bogus results.

The fix for this is to use res_nquery(), introduced in BIND 8.2, which
takes an explicit state argument. This allows us to manually store the
state thread-locally. If res_nquery() isn’t available, we fall back to
res_query(). It should be available on OS X though. As a data point,
it’s available on Fedora 27.

There’s a slight complication in the fact that OS X requires the state
to be freed using res_ndestroy() rather than res_nclose(). Linux uses
res_nclose().

(See, for example, the NetBSD man page:
https://www.unix.com/man-page/netbsd/3/res_ninit/. The Linux one is
incomplete and not so useful:
http://man7.org/linux/man-pages/man3/resolver.3.html.)

The new code will call res_ninit() once per res_nquery() task. This is
not optimal, but no worse than before — since res_query() was being
called in a worker thread, on Linux, it would implicitly initialise the
thread-local struct __res_state when it was called. We’ve essentially
just made that explicit. In practical terms, this means a
stat("/etc/resolv.conf") call per res_nquery() task.

In future, we could improve this by using an explicit thread pool with
some manually-created worker threads, each of which initialises a struct
__res_state on spawning, and only updates it on receiving
the #GResolver::reload signal.

Signed-off-by: Philip Withnall &lt;withnall@endlessm.com&gt;

https://bugzilla.gnome.org/show_bug.cgi?id=792050
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid setting unused variables (-Wself-assign)</title>
<updated>2017-09-11T21:14:18+00:00</updated>
<author>
<name>Daniel Macks</name>
<email>dmacks@netspace.org</email>
</author>
<published>2015-03-20T03:06:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=190f64a0fb0280bcc4a401062abd802db8eb0034'/>
<id>190f64a0fb0280bcc4a401062abd802db8eb0034</id>
<content type='text'>
Setting a variable and then assigning it to itself avoids
-Wunused-but-set-variable but this specific trick is now caught by
-Wself-assign. Instead, actually use the value or don't bother
assigning it at all:

gdbusauth.c: call g_data_input_stream_read_byte() in void context
gdbusauthmechanismsha1.c: value is actually used
gdbusmessage.c: use consistent preprocessor-token protection
gthreadedresolver.c: skip over bytes in data blob
httpd.c: do something useful with the value

https://bugzilla.gnome.org/show_bug.cgi?id=745723
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Setting a variable and then assigning it to itself avoids
-Wunused-but-set-variable but this specific trick is now caught by
-Wself-assign. Instead, actually use the value or don't bother
assigning it at all:

gdbusauth.c: call g_data_input_stream_read_byte() in void context
gdbusauthmechanismsha1.c: value is actually used
gdbusmessage.c: use consistent preprocessor-token protection
gthreadedresolver.c: skip over bytes in data blob
httpd.c: do something useful with the value

https://bugzilla.gnome.org/show_bug.cgi?id=745723
</pre>
</div>
</content>
</entry>
<entry>
<title>gio/: LGPLv2+ -&gt; LGPLv2.1+</title>
<updated>2017-05-29T17:53:34+00:00</updated>
<author>
<name>Sébastien Wilmet</name>
<email>swilmet@gnome.org</email>
</author>
<published>2017-05-27T16:21:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=3bf4a720c315b5015c8d51edf0b458348f796674'/>
<id>3bf4a720c315b5015c8d51edf0b458348f796674</id>
<content type='text'>
Sub-directories inside gio/ already processed in a previous commit:
- fam/
- gdbus-2.0/ (which contains only codegen/)
- gvdb/
- inotify/
- tests/
- win32/
- xdgmime/

Other sub-directories inside gio/:
- completion/: no license headers
- kqueue/: not LGPL, BSD-style license

https://bugzilla.gnome.org/show_bug.cgi?id=776504
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sub-directories inside gio/ already processed in a previous commit:
- fam/
- gdbus-2.0/ (which contains only codegen/)
- gvdb/
- inotify/
- tests/
- win32/
- xdgmime/

Other sub-directories inside gio/:
- completion/: no license headers
- kqueue/: not LGPL, BSD-style license

https://bugzilla.gnome.org/show_bug.cgi?id=776504
</pre>
</div>
</content>
</entry>
<entry>
<title>Use Unicode in translatable strings</title>
<updated>2016-10-12T19:30:42+00:00</updated>
<author>
<name>Piotr Drąg</name>
<email>piotrdrag@gmail.com</email>
</author>
<published>2016-09-30T03:47:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=10c490cdfe3ae042f747bd00f787492e2bdb7ed0'/>
<id>10c490cdfe3ae042f747bd00f787492e2bdb7ed0</id>
<content type='text'>
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772221
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772221
</pre>
</div>
</content>
</entry>
<entry>
<title>gio: Add source tags to various GTasks constructed in GLib</title>
<updated>2016-06-29T14:16:52+00:00</updated>
<author>
<name>Philip Withnall</name>
<email>philip.withnall@collabora.co.uk</email>
</author>
<published>2016-06-16T23:39:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=3613b7a3660f2a7d9609faa2d6a4649bdc5f4fe3'/>
<id>3613b7a3660f2a7d9609faa2d6a4649bdc5f4fe3</id>
<content type='text'>
This makes them easier to identify when debugging and profiling.

This patch was somewhat less than interesting to write.

https://bugzilla.gnome.org/show_bug.cgi?id=767765
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes them easier to identify when debugging and profiling.

This patch was somewhat less than interesting to write.

https://bugzilla.gnome.org/show_bug.cgi?id=767765
</pre>
</div>
</content>
</entry>
<entry>
<title>gthreadedresolver.c: Fix for Android 5.0+</title>
<updated>2015-10-13T13:04:39+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@gentoo.org</email>
</author>
<published>2015-10-13T03:29:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=e5e08ebedbc1dd97d19f2504d43619991b1e52aa'/>
<id>e5e08ebedbc1dd97d19f2504d43619991b1e52aa</id>
<content type='text'>
https://bugzilla.gnome.org/show_bug.cgi?id=756477
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://bugzilla.gnome.org/show_bug.cgi?id=756477
</pre>
</div>
</content>
</entry>
<entry>
<title>gthreadedresolver: Unref unexpected address</title>
<updated>2014-07-23T11:43:41+00:00</updated>
<author>
<name>Colin Walters</name>
<email>walters@verbum.org</email>
</author>
<published>2014-07-22T18:08:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glib.git/commit/?id=e55a953642a9e402f4363f9fa347b6061dd78990'/>
<id>e55a953642a9e402f4363f9fa347b6061dd78990</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
</feed>
