Commit Graph

22509 Commits

Author SHA1 Message Date
Marc-André Lureau
c354c404c6 tests/uri: check user field is correctly encoded
Suggested-by: Dan Winship <danw@gnome.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-04 17:10:06 +04:00
Marc-André Lureau
4c20ea477c uri: always add G_URI_FLAGS_HAS_PASSWORD with build_with_user()
Otherwise, the to_string() encoding will not be reversible. Furthermore,
if no distinction is needed in the first place, g_uri_build() with
userinfo should be used instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-04 17:10:06 +04:00
Marc-André Lureau
b0f9af0e1d uri: do not encode userinfo fields
g_uri_build_with_user() builds a userinfo, but it shouldn't encode it
itself, but let the user flags declare what's there. Otherwise,
to_string() code paths may encode a second time.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-04 17:03:30 +04:00
Marc-André Lureau
c9c349aeaa uri: add ENCODED_PATH & ENCODED_FRAGMENT flags
Add encoded flags, similar to what was done in commit 7bee36b4 ("uri:
add G_FLAGS_ENCODED_QUERY").

SoupURI has manual handling of encoded path & fragment, but it can rely
on GUri decoding for the rest.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-08-04 16:56:19 +04:00
Sebastian Dröge
a97fe4e863 Merge branch 'uri-ipv6-bkt' into 'master'
uri: do not add ipv6 brackets on non-ip host

See merge request GNOME/glib!1599
2020-08-04 12:44:12 +00:00
Matthias Clasen
e3b6f20b77 Merge branch 'revert-8f960c79' into 'master'
Revert "Merge branch 'appinfo-properties' into 'master'"

See merge request GNOME/glib!1602
2020-08-02 21:14:43 +00:00
Matthias Clasen
96d39f86b5 Revert "Merge branch 'appinfo-properties' into 'master'"
This reverts merge request !1582
2020-08-02 21:02:03 +00:00
Matthias Clasen
5b3da6ea34 Merge branch 'fix-uninitialized-use' into 'master'
timezone: Fix an uninitialized use

See merge request GNOME/glib!1601
2020-08-02 02:18:19 +00:00
Matthias Clasen
0992978202 timezone: Fix an uninitialized use
GTK ci rightly complains about this when ti builds
GLib as a subproject with -Werror=maybe-uninitialized.

subkey_dynamic_w will be freed without being initialized
when the first goto is taken.
2020-07-31 14:04:21 -04:00
Marc-André Lureau
20ae4b46d4 uri: do not add ipv6 brackets on non-ip host
The heuristic is a bit too agressive, as we may have hostname with
%-encoded ':' (as shown in GVfs URI tests).

Add an extra test to check :-decoding as well.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-30 21:37:34 +04:00
Daniel Mustieles
7ce6a01f99 Updated Spanish translation 2020-07-29 12:07:49 +02:00
Matthias Clasen
8f960c79e9 Merge branch 'appinfo-properties' into 'master'
appinfo: Add properties

See merge request GNOME/glib!1582
2020-07-29 01:20:50 +00:00
Matthias Clasen
9193fd529f Add a missing include 2020-07-28 17:29:47 -04:00
Hans Petter Jansson
4c5ccd3e8f gslice: Allow inlining of memset() in g_slice_new0() macro
Inlining the memset() is beneficial since the size here is constant
and usually small.

Closes #5
2020-07-28 18:22:21 +02:00
Marc-André Lureau
0fea3d71e4 guri: add some IPv6 scope-id tests
Add a few ipv6 scope parsing corner test cases.

- checking incorrect scoped IPv6 ending with only %25 isn't decoded.
- checking valid scoped IPv6 is passing g_uri_is_valid()

As discussed in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1567#note_860499,
for historical reasons, GUri accepts the % preceding the zone-id in the
unescaped form as well.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:48:01 +04:00
Marc-André Lureau
dd0fae1303 gio: remove _g_uri_parse_authority()
It is now unused and redundant with GUri.

Fixes: #2156

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:35:13 +04:00
Marc-André Lureau
aa0b09ebef gio: use g_uri_split_network() in g_simple_proxy_resolver_lookup()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:35:05 +04:00
Marc-André Lureau
1b6a0535e8 gio: use g_uri_split_with_user() in save_userinfo()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:32:50 +04:00
Marc-André Lureau
6f419e7e2f gio: use g_uri_split_network() in g_network_address_parse_uri()
_g_uri_parse_authority() can be replaced with g_uri_split_network() &
PARSE_STRICT. Keep the original error code, for compatibility reasons.

Notice that GUri uses gint for the port, and value -1 if the port value
is missing. However, GNetworkAddress::port is a guint.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:31:11 +04:00
Marc-André Lureau
a173a6f617 gio: use g_uri_is_valid()
_g_uri_parse_authority() without argument is actually checking that the
URI is valid, by checking it parses successfully

We keep the existing error domain / code for compatibility reasons,
instead of raising the underlying G_URI_ERROR.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:15:50 +04:00
Marc-André Lureau
034a4dcdc0 gio: replace _g_uri_from_authority() with g_uri_join()
_g_uri_from_authority() is doing the same work as g_uri_join(): taking
URI components and merging them in a legit URI string, with encoding.

It turns out g_uri_from_authority was unnecessarily complex, since no
caller used the userinfo field.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 16:12:37 +04:00
Marc-André Lureau
82ad7853ba uri: change g_uri_is_valid() to check absolute URI
g_uri_is_valid() should check the given URI is valid following RFC-3986,
and reject relative references.

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2169

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 15:44:43 +04:00
Marc-André Lureau
44d4640c47 uri: rename absolute & relative uri_string to uri_ref
Let's reserve the term URI for absolute URIs, following rfc3986
terminology.

See:
https://gitlab.gnome.org/GNOME/glib/-/issues/2169

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 15:07:08 +04:00
Marc-André Lureau
d625a29b28 uri: add a comment about temporary GUri construction
As pointed out in the discussion of:
https://gitlab.gnome.org/GNOME/glib/-/issues/2169

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 14:54:55 +04:00
Marc-André Lureau
19c0db3185 uri: improve some documentation about absolute URIs
As pointed out in the discussion
https://gitlab.gnome.org/GNOME/glib/-/issues/2169.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 14:54:55 +04:00
Marc-André Lureau
3521763532 uri: add some note about the API scope
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-07-28 14:54:42 +04:00
Matthias Clasen
df7f35e81a Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:49:05 +00:00
Matthias Clasen
b5fc5d6423 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:50 +00:00
Matthias Clasen
c10a0a390a Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:41 +00:00
Matthias Clasen
65263ced54 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:36 +00:00
Matthias Clasen
2301d75a94 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:31 +00:00
Matthias Clasen
c213000e25 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:26 +00:00
Matthias Clasen
d9757ab033 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:21 +00:00
Matthias Clasen
921e2ee6e3 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:15 +00:00
Matthias Clasen
bad7efc0ea Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:11 +00:00
Matthias Clasen
98deeff312 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:08 +00:00
Matthias Clasen
e09594f500 Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:04 +00:00
Matthias Clasen
10eb9744df Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:48:00 +00:00
Matthias Clasen
d09bd8e5fb Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:47:51 +00:00
Matthias Clasen
75000b036d Apply 1 suggestion(s) to 1 file(s) 2020-07-27 19:47:47 +00:00
Sebastian Dröge
9577616622 Merge branch '272-thread-pool-docs' into 'master'
gthreadpool: Mention g_get_num_processors() in the thread pool docs

Closes #272

See merge request GNOME/glib!1588
2020-07-27 19:04:11 +00:00
Philip Withnall
1203e80f5f Merge branch '250-testcase-docs' into 'master'
gtestutils: Clarify the docs for g_test_create_case()

Closes #250

See merge request GNOME/glib!1587
2020-07-27 17:01:16 +00:00
Philip Withnall
b3c0c4804b gthreadpool: Mention g_get_num_processors() in the thread pool docs
Just to make it a little more obvious that a thread pool can be
initialised with one thread per logical CPU.

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

Fixes: #272
2020-07-27 17:28:43 +01:00
Philip Withnall
07278e73d4 gtestutils: Clarify the docs for g_test_create_case()
Improve formatting, and clarify that the same *type* of test fixture can
be reused, not the same specific instance of a test fixture.

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

Fixes: #250
2020-07-27 17:26:56 +01:00
Sebastian Dröge
63809867bd GFile: Document that G_FILE_CREATE_REPLACE_DESTINATION can only be used with g_file_replace() and variants
Passing it to e.g. g_file_create() for an already existing file will
still cause a "file exists" error.
2020-07-27 18:35:38 +03:00
Philip Withnall
5f25d2569d ci: Add scheduled Coverity Scan builds
This should run Coverity Scan on GLib on the current schedule (once a
week).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-07-27 15:47:27 +01:00
Philip Withnall
c77c5e5b56 ci: Support building a CI image for Coverity Scan builds
This will be used in an upcoming scheduled CI job.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-07-27 15:41:09 +01:00
Philip Withnall
648986a290 glib: Avoid redefining GLIB_DISABLE_DEPRECATION_WARNINGS
It may be defined by the environment (we document that as being allowed)
— if so, individual files should not try to redefine it, as that causes
a preprocessor warning.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-07-27 15:41:09 +01:00
Sebastian Dröge
5ba5f5b686 Merge branch '137-gfileinfo-display-name-docs' into 'master'
gfileinfo: Clarify docs to say that name and display-name are set

Closes #137

See merge request GNOME/glib!1585
2020-07-27 13:12:44 +00:00
Philip Withnall
5b429344b5 Merge branch '1869-ios-cocoa' into 'master'
gosxutils: Include Foundation rather than Cocoa

Closes #1869

See merge request GNOME/glib!1589
2020-07-27 12:41:27 +00:00