Commit Graph

19424 Commits

Author SHA1 Message Date
Philip Withnall
00b50d28f9 gutils: Fix a typo in a documentation comment
‘threadsafety’ isn’t a word.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/538
2018-12-17 17:16:03 +00:00
Philip Withnall
e6eb4869ba gutils: Refactor initialisation of XDG variables
Split out the code which calculates each XDG variable value from the
code which caches it, so that GLib can internally recalculate the
variables if needed, without necessarily trashing the user-visible
cache.

This will be useful in a following commit to add support for explicitly
reloading the variables.

This commit necessarily reworks how g_get_user_runtime_dir() is
structured, since it was inexplicably structured differently from (but
equivalently to) the other XDG variable functions.

Future refactoring could easily share a lot more code between these
g_build_*() functions.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/538
2018-12-17 17:16:03 +00:00
Philip Withnall
a67eadbdc3 gstrfuncs: Add g_strv_equal()
This is a utility function which I find myself writing in a number of
places. Mostly in unit tests.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-17 17:16:03 +00:00
Philip Withnall
b4479d97d5 Revert "Meson: appinfo tests are racy if run in parallel"
This partially reverts commit 27b5fb5892.

The infrastructure for disabling a test is kept, but the appinfo and
desktop-app-info tests no longer need to be run serially.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1601
2018-12-17 17:16:03 +00:00
Philip Withnall
903ce7dc02 Merge branch '1191-g_assert_cmpvariant' into 'master'
gtestutils: Add g_assert_cmpvariant()

Closes #1191

See merge request GNOME/glib!529
2018-12-17 13:03:00 +00:00
Philip Withnall
1fa24a6852 Merge branch 'gentoo-timezone' into 'master'
gtimezone: Fallback to /etc/timezone on Gentoo

See merge request GNOME/glib!541
2018-12-17 12:48:52 +00:00
Philip Withnall
f4be79dcb3 Merge branch 'doc-binding-improvement' into 'master'
binding: Clarify the use of g_object_unref() to remove a binding

See merge request GNOME/glib!515
2018-12-17 12:30:26 +00:00
Benjamin Berg
f5e1e169d0 binding: Clarify the use of g_object_unref() to remove a binding
Conceptually the binding is kept alive as long as both the source and
target exist. This means that an API user needs to take some care to
either hold a reference or only use a pointer to the binding as long as
also holding references to both objects.

Clarify the documentation a bit.
2018-12-17 11:01:07 +01:00
Ignacio Casal Quinteiro
290c9ee655 Merge branch 'wip/silviol/gsocket_flags' 2018-12-17 10:24:45 +01:00
Mart Raudsepp
2ceb48dfc2 gtimezone: Fallback to /etc/timezone on Gentoo
On non-systemd Gentoo systems the chosen timezone is expressed in
/etc/timezone and /etc/localtime may be a copy of the timezone
file instead of symlink. Add this path to the fallback test to
not regress dates into UTC.
2018-12-17 00:42:39 +02:00
Michael Catanzaro
c46565d56a Merge branch 'fix-tlscertificate-parse-bug' into 'master'
gtlscertificate: Fix bug in PEM private key parser

See merge request GNOME/glib!534

Also see discussion in GNOME/glib!520
2018-12-14 21:23:04 +00:00
Fredrik Ternerot
feff178c3f gtlscertificate: Fix bug in PEM private key parser
Make sure to not go outside of PEM data buffer when looking for private
key.

Also adding test case that triggers this bug.
2018-12-14 20:18:55 +01:00
Silvio Lazzeretti
e1e5fa0600 added more g_pollable_input_stream_is_readable checks 2018-12-14 17:07:22 +01:00
Silvio Lazzeretti
9e89749e52 Partially revert "GSocket: Fix race conditions on Win32 if multiple threads are waiting on conditions for the same socket"
This partially reverts commit 799f8dcd46.
This patch seems to break the writability status of the server socket: once
somebody writes to it with success, then it reports it is not writable
anymore. Also, when the client socket has the flag FD_CONNECT set once,
it is never cleared and then it reports it is always writable, also when
it is not.
2018-12-14 16:26:59 +01:00
Philip Withnall
d289ef449b tests: Port various tests to use g_assert_cmpvariant()
This should improve test error reporting a little.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-14 15:04:11 +00:00
Silvio Lazzeretti
ac0706aad0 added stream writability checks in pollable unit test
This checks if the stream is writable before writing
to it. If the write succeeded with no error, then the
stream has to be also writable after the write
2018-12-13 11:10:06 +01:00
Philip Withnall
27369def50 Merge branch 'mkenums' into 'master'
tests: Minor improvements to mkenums.py and taptestrunner.py used by it

See merge request GNOME/glib!530
2018-12-13 09:13:08 +00:00
Ondrej Holy
0f508c7b89 Merge branch '1599-follow-up-from-gunixmounts-stop-considering-cifs-nfs-as-system-file-systems'
Merging this manually because the CI is still broken.

https://gitlab.gnome.org/GNOME/glib/merge_requests/494
2018-12-13 09:36:11 +01:00
Michael Catanzaro
99d7894d48 Merge branch 'wip/tingping/happy-eyeballs'
Merging this manually because the CI is broken.

Fixes https://gitlab.gnome.org/GNOME/glib/merge_requests/421
2018-12-12 17:09:16 -06:00
Tomasz Miąsko
6b0ad94fb4 tests: s/assertEquals/assertEqual/
Assert assertEquals is deprecated alias of assertEqual.
2018-12-12 12:57:51 +01:00
Tomasz Miąsko
c69a98057f tests: Avoid writing ever increasing sequence of null bytes to test logs 2018-12-12 12:57:51 +01:00
Tomasz Miąsko
3b7f7a4ed9 tests: Drop compatibility with python 2 from TAP test runner 2018-12-12 12:57:51 +01:00
Philip Withnall
8a2fa212e7 docs: Format operators nicely in gtestutils documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-12 11:27:32 +00:00
Philip Withnall
ee364db967 gtestutils: Add g_assert_cmpvariant()
This is along the same lines as g_assert_cmpstr(), but for variants.

Based on a patch by Guillaume Desmottes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1191
2018-12-12 11:27:25 +00:00
Patrick Griffis
4c472f8e3f gsocketaddressenumerator: Make it an error to call next_async before finish
It logically doesn't make sense to repeatedly call next_async()
before the previous one has finished.
2018-12-11 16:12:51 -05:00
Patrick Griffis
8b9e88937b tests: Add gsocketclient test for slow connections 2018-12-11 16:12:48 -05:00
Patrick Griffis
4b29e55097 gnetworkaddress: Interleave ipv4 and ipv6 addresses 2018-12-11 16:12:34 -05:00
Patrick Griffis
c1e32b9057 gsocketclient: Improve handling of slow initial connections
Currently a new connection will not be attempted until the previous
one has timed out and as the current API only exposes a single
timeout value in practice it often means that it will wait 30 seconds
(or forever with 0 (the default)) on each connection.

This is unacceptable so we are now trying to follow the behavior
RFC 8305 recommends by making multiple connection attempts if
the connection takes longer than 250ms. The first connection
to make it to completion then wins.
2018-12-11 16:09:29 -05:00
Patrick Griffis
35e41862c2 gnetworkaddress: Implement parallel ipv4 and ipv6 dns lookups
As RFC 8305 recommends we can start multiple DNS queries in parallel
to more quickly make an initial response, especially when one is
particularly slow/broken.
2018-12-11 16:09:29 -05:00
Patrick Griffis
d6afa6c988 gresolver: Add g_resolver_lookup_by_name_with_flags{_async,_finish,}
This allows higher levels to have more control over resolving
(ipv4 or ipv6 for now) which allows for optimizations such
as requesting both in parallel as RFC 8305 recommends.
2018-12-11 16:09:29 -05:00
Philip Withnall
af39a37312 Merge branch 'fix-gdbus-codegen--interface-info' into 'master'
fix gdbus-codegen --interface-info-{header,body}

See merge request GNOME/glib!514
2018-12-11 12:25:31 +00:00
Will Thompson
335a01ebe4
gdbus-codegen: test --interface-info-{header,body}
This test is rudimentary but better than nothing.
2018-12-11 09:49:22 +00:00
Will Thompson
d946bff480
gdbus-codegen: sort input files
This means the output (including lists of filenames) does not depend on
the order of the input files, which may matter if this tool is invoked
with a glob or some other mechanism that doesn't guarantee an order.
2018-12-11 09:49:22 +00:00
Xavier Claessens
bdc9328bdf Merge branch 'meson-dep' into 'master'
Meson: Fix declare_dependency() calls

See merge request GNOME/glib!518
2018-12-10 22:39:32 +00:00
Xavier Claessens
3fadcf9ffa Merge branch 'meson-pkgconfig' into 'master'
Meson: Fix deprecation warning with upcoming 0.49.0 release

See merge request GNOME/glib!517
2018-12-10 20:19:38 +00:00
Philip Withnall
1c8bbab127 Merge branch 'gdatetime-typo' into 'master'
gdatetime: Fix typo in the comment

See merge request GNOME/glib!524
2018-12-10 17:55:35 +00:00
Tomasz Miąsko
db47ab8402 gdatetime: Fix typo in the comment
Follow up on https://gitlab.gnome.org/GNOME/glib/merge_requests/506#note_382186.
2018-12-10 17:54:27 +01:00
Xavier Claessens
475f0a9b67 Meson: Fix deprecation warning with 0.49.0 release
http://mesonbuild.com/Release-notes-for-0-49-0.html#deprecation-warning-in-pkgconfig-generator
2018-12-10 09:08:28 -05:00
Xavier Claessens
afd3f3beda Meson: Fix declare_dependency() calls
Turns out the fix in commit 93555577c wasn't enough, when using glib as
subproject and the parent project uses only libgio_dep, and include
<gi18n.h>, it won't find libintl.h because it's in the
include_directories of libglib_dep. Fix that by declaring dependencies
explicitly, which is the right thing to do since glib and gobject are
public dependencies of gio. That reflects what we do for the pkg-config
file as well.
2018-12-10 09:06:17 -05:00
Philip Withnall
fa80a2d133 Merge branch 'resources.msvc' into 'master'
glib-compile-resources: Fix code generation for MSVC builds (issue #1580)

Closes #1580

See merge request GNOME/glib!503
2018-12-10 12:06:41 +00:00
Philip Withnall
b1f16259fc Merge branch 'issue-1605' into 'master'
gdatetime: Store intermediate result of g_date_time_format in UTF-8

Closes #1605

See merge request GNOME/glib!506
2018-12-10 12:03:17 +00:00
Philip Withnall
af77e47e93 Merge branch 'encoding-prefix' into 'master'
tests: Rename macro to avoid conflict with encoding prefix

See merge request GNOME/glib!521
2018-12-10 11:43:37 +00:00
Tomasz Miąsko
e32342897a tests: Rename macro to avoid conflict with encoding prefix
Use macro name that doesn't conflict with string literal encoding prefix `U`.

```
../glib/tests/fileutils.c(282): warning C4133: 'function': incompatible types - from 'unsigned int [2]' to 'const gchar *'
../glib/tests/fileutils.c(284): warning C4133: 'function': incompatible types - from 'unsigned int [2]' to 'const gchar *'
../glib/tests/fileutils.c(285): warning C4133: 'function': incompatible types - from 'unsigned int [2]' to 'const gchar *'
../glib/tests/fileutils.c(286): warning C4133: 'function': incompatible types - from 'unsigned int [2]' to 'const gchar *'
../glib/tests/fileutils.c(287): warning C4133: 'function': incompatible types - from 'unsigned int [3]' to 'const gchar *'
...
```
2018-12-09 15:10:43 +01:00
Matej Urbančič
e8fb8322ce Updated Slovenian translation 2018-12-08 21:59:20 +01:00
Will Thompson
deafd7256e
gdbus-codegen: don't sort args in --interface-info-body
Previously, method and signal arguments were sorted by name, which
(assuming you don't happen to give your arguments
lexicographically-ordered names) means the generated signatures were
incorrect when there is more than 1 argument.

While sorting the methods and signals themselves (and properties, and
annotations on all these) is fine, it's easiest to not sort anything.
2018-12-06 21:39:27 +00:00
Will Thompson
faa3c319ba
gdbus-codegen: make --interface-info-{header,body} not crash
Since 1217b1bc4f, LICENSE_STR has taken two
parameters, not one. Without this change, running either mode fails
with a traceback like:

    Traceback (most recent call last):
      File "../gdbus-codegen", line 55, in <module>
        sys.exit(codegen_main.codegen_main())
      File ".../codegen_main.py", line 294, in codegen_main
        gen.generate()
      File ".../codegen.py", line 896, in generate
        self.generate_body_preamble()
      File ".../codegen.py", line 682, in generate_body_preamble
        self.outfile.write(LICENSE_STR.format(config.VERSION))
    IndexError: tuple index out of range

8916874ee6, which introduced these flags,
was actually merged after that commit, but I assume it was written
beforehand.
2018-12-06 21:39:17 +00:00
Philip Withnall
3469faf15c Merge branch 'ossfuzz-11576-variant-text-unicode-unescape' into 'master'
gvariant: Fix error handling for parsing Unicode escapes

See merge request GNOME/glib!511
2018-12-06 11:15:24 +00:00
Chun-wei Fan
cd30faae1f gresources: Add a test with resources > 64kb
This is to ensure that the generated code is still compilable by the
running compiler, and see whether we can read the things in there
properly.

See issue #1580.
2018-12-05 18:27:16 +08:00
Chun-wei Fan
6528887534 README.win32: Update workarounds for VS 2008 x64 builds
We need to also update build.ninja after configuration so that builds
don't get stuck on gio/tests/gsubprocess-testprog.c.
2018-12-05 18:10:40 +08:00
Chun-wei Fan
4501807d73 glib-compile-resources: Fix code generation for MSVC builds
glib-compile-resources was updated to generate octal byte
representation in a string, but unfortunately this breaks the build
on Visual Studio when the generated string sequence exceeds 65535
characters, which is the imposed limit on Visual Studio compilers.

To make things work on Visual Studio builds and to not slow down things
on other compilers, generate a code path for Visual Studio an array of
octal byte representations, as well as a code path for other compilers
that use the new string representation of octal values, and let the
compiler take the appropriate code path when compiling the
generated code.

Fixes issue #1580.
2018-12-05 16:17:24 +08:00