Commit Graph

29132 Commits

Author SHA1 Message Date
Philip Withnall
f5f418b057 gsocketclient: Track whether the connection attempt delay is reached
Just for debugging purposes, track whether the Connection Attempt Delay
(https://datatracker.ietf.org/doc/html/rfc8305#section-8) has been
reached for each attempt.

This makes it a bit easier to diagnose `GSocketClient` problems in a
debugger.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-12-03 23:11:38 +00:00
Philip Withnall
ac6864ded7 gsocketclient: Rename ‘connection timeout’ to ‘connection delay’
This makes it match the terminology from RFC 8305 better, which refers
to a ‘connection attempt delay’. This is a delay because it determines
the spacing between trying additional connection attempts. It’s not a
timeout because it shouldn’t cause cancellation of any ongoing
connection attempts.

This commit introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-12-03 23:11:11 +00:00
Philip Withnall
d86da581e6 Merge branch 'main' into 'main'
Documentation only: Added clarification about GWeakNotify and removed ambiguous text

See merge request GNOME/glib!3739
2023-12-03 22:48:47 +00:00
madmurphy
abd7f9863d Documentation only: Added clarification about GWeakNotify and removed ambiguous text 2023-12-03 22:48:46 +00:00
Emmanuele Bassi
b53218a509 Merge branch '3037-doc-build-cleanups' into 'main'
build: Rename -Dgtk_doc option to -Ddocumentation and fix some g-ir-scanner warnings

See merge request GNOME/glib!3736
2023-12-01 22:48:17 +00:00
Jordan Williams
9cd7cccdd3
Increase required Python version to 3.7
This version of Python supports the packaging module.
2023-12-01 09:51:15 -06:00
Michael Catanzaro
438f59b071 Merge branch 'style-check-fix' into 'main'
ci: Fix printing info message at end of run-style-check-diff.sh

See merge request GNOME/glib!3735
2023-11-30 00:38:13 +00:00
Michael Catanzaro
6c46afbf48 Merge branch 'wip/pwithnall/791-disable-nagle' into 'main'
gsocket: Enable TCP_NODELAY by default for stream GSockets

Closes #791

See merge request GNOME/glib!3738
2023-11-30 00:27:38 +00:00
Philip Withnall
039876e6d9 gsocket: Enable TCP_NODELAY by default for stream GSockets
`TCP_NODELAY` disables Nagle’s algorithm, which is generally a better
default for modern networks than having it enabled. Nagle’s algorithm
delays sending small data blobs until they fill an entire TCP segment,
so as to amortise the cost of sending the segment.

This improves bandwidth at the cost of latency. Given the large
bandwidth capabilities of most modern networks, most streams are
constrained by latency rather than bandwidth, so disabling Nagle’s
algorithm makes sense.

Various other major bits of software (such as libcurl) already disable
Nagle’s algorithm by default.

Specific applications which need it can turn it back on by calling
`g_socket_set_option()`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #791
2023-11-29 17:08:10 +00:00
Philip Withnall
a581de2ee7 gsocketclient: Make connection_attempt_remove() safe to call twice
As spotted by Michael Catanzaro in
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3394#note_1730123,
on the code path where a `ConnectionAttempt` is cancelled, it will
currently be removed from the `connection_attempts` list by the
cancellation code, and then *again* by the `if
(task_completed_or_cancelled ())` code in
`g_socket_client_connected_callback()`.

That would previously have resulted in a double-unref of the
`ConnectionAttempt`. So change `connection_attempt_remove()` to be a
no-op if the attempt isn’t found in `connection_attempts`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-11-29 15:55:48 +00:00
Philip Withnall
320c9d6d0d gsocketclient: Add some additional debug prints
These make it a bit easier to track the ongoing tasks, as the tasks
and/or their closures are not tracked in a big list somewhere.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-11-29 15:55:48 +00:00
Philip Withnall
bc6d03c3c9 gsocketclient: Document async operation timeout/completion behaviour
These calls are where the `GSocketClient` Happy Eyeballs code relies on
other components within GLib (and glib-networking) to complete
asynchronous operations in a timely manner. `GSocketClient` doesn’t add
its own timeouts to monitor these async operations, so if the
implementations are buggy then a `GSocketClient` operation could stall
forever.

Make that a bit clearer.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-11-29 15:55:48 +00:00
Philip Withnall
240b8bbc2d gsocketclient: Clarify some internal comments
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-11-29 15:55:48 +00:00
Philip Withnall
641bea17f2 Merge branch '3037-capitalisation' into 'main'
docs: Consistently capitalise page titles

Closes #3037

See merge request GNOME/glib!3737
2023-11-29 15:48:02 +00:00
Philip Withnall
69c6413182 gsocketclient: Rename an internal variable and change it to a counter
This introduces no functional changes, but makes it a little clearer
what the variable signifies, and provides a little more information when
debugging things.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-11-29 15:27:16 +00:00
Philip Withnall
48963118b2 Merge branch 'wip/sophie-h/remove-nick-blurb' into 'main'
Remove all nicks and blurbs from param specs

Closes #2991

See merge request GNOME/glib!3411
2023-11-29 13:54:41 +00:00
Philip Withnall
c4b47c708d gwin32appinfo: Use correct gettext macro
`P_()` is for pspec strings — it gave us the option to split them out to
a separate translation domain. `_()` is for normal strings.

Spotted by Sophie Herold: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3411#note_1733329

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-29 13:41:34 +00:00
Sophie Herold
0d268c4825 Remove all nicks and blurbs from param specs
Nicks and blurbs don't have any practical use for gio/gobject libraries.
Leaving tests untouched since this features is still used by other libraries.

Closes #2991
2023-11-29 13:41:34 +00:00
Philip Withnall
f3aebf0c15 gio: Add various missing property documentation comments
Previously these properties would have been documented using the strings
from the pspec, but those will be removed in the following commit. Re-add
the documentation using those strings, but as gi-docgen documentation
comments.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #2991
2023-11-29 13:41:12 +00:00
Philip Withnall
7b2ac3c82e docs: Consistently capitalise page titles
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:13:13 +00:00
Philip Withnall
266f570f3c gsignal: Add missing (scope forever) annotations
Signals (as opposed to signal connections) can never be unregistered, so
these closures have to be around forever.

Fixes some g-ir-scanner warnings.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:04:59 +00:00
Philip Withnall
47869719be gboxed: Add missing (scope forever) annotations
Boxed types can never be unregistered, so these closures have to be
around forever.

Fixes some g-ir-scanner warnings.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:04:12 +00:00
Philip Withnall
58208c4ace gvarianttype: Add a missing argument name
To make it match its definition and documentation comment. This fixes a
g-ir-scanner warning.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:03:34 +00:00
Philip Withnall
81d96f5898 gmarkup: Add a missing (element-type) annotation
Fixes a g-ir-scanner warning.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:03:15 +00:00
Philip Withnall
02725b9bbd ghashtable: Add various missing (transfer) annotations
Fixes some g-ir-scanner warnings.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:02:49 +00:00
Philip Withnall
c7dfd218ea gerror: Add missing (scope forever) annotations
Extended error domains can never be unregistered, so these closures
have to be around forever.

Fixes some g-ir-scanner warnings.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:02:04 +00:00
Philip Withnall
c1547f62bc gbytearray: Add missing (transfer) annotations
`GByteArray` is a bit odd in that it allows call-chaining. All the
instances of that were missing a `(transfer none)` annotation though.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:01:12 +00:00
Philip Withnall
8f08c1a038 gthread: Make some argument names match up
This fixes a warning from g-ir-scanner as the declaration and
documentation comment didn’t match.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:00:35 +00:00
Philip Withnall
f14cd8de14 gcompletion: Make argument names match up
This fixes some warnings from g-ir-scanner.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 12:00:14 +00:00
Philip Withnall
d07c59ed4e glib: Add (scope call) to a load of sort/equal callbacks
This fixes a load of g-ir-scanner warnings.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 11:59:47 +00:00
Philip Withnall
d930b9058f gtlspassword: Add a missing (out) annotation
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 11:58:16 +00:00
Philip Withnall
045186a6f2 gthreadedresolver: Mark internal functions as private
This removes a few more g-ir-scanner warnings.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 11:57:54 +00:00
Philip Withnall
f50ef45220 gnetworking: Hide POSIX networking symbols from g-ir-scanner
They’re not part of the GLib API and don’t need to be exposed to the
scanner.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 11:57:20 +00:00
Philip Withnall
2a8b0c2388 gicon: Fix an invalid introspection annotation
`(hash)` is not an annotation — it’s probably a typo for `(virtual
hash)`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 11:56:46 +00:00
Philip Withnall
d71d4507b8 gfileinfo: Drop an incorrect (transfer) annotation
This fixes a g-ir-scanner warning.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 11:56:16 +00:00
Philip Withnall
002f846312 gio: Add some missing (scope) annotations
This removes some of the gobject-introspection warnings.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 11:55:49 +00:00
Philip Withnall
7d0140eea0 gdbusmessage: Reformat a doc comment to gi-docgen format
In an attempt to make gobject-introspection stop warning about using
deprecated gtk-doc `Type:` tags.

It doesn’t work — the gobject-introspection parser is not clever enough
to notice the tag is inside a code block.

Still, a useful port.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 11:54:13 +00:00
Philip Withnall
e8edaeeb87 build: Rename -Dgtk_doc option to -Ddocumentation
Because the documentation is no longer built using gtk-doc.

Keep the old option around, but deprecated.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-11-29 10:26:37 +00:00
Philip Withnall
f6a1599e3c Merge branch '3183-arg0-paths' into 'main'
gdbusconnection: Support matching object paths with arg0 matching

Closes #3183

See merge request GNOME/glib!3720
2023-11-29 10:09:45 +00:00
Philip Withnall
93eeed4023 Merge branch 'wip/pwithnall/3119-Ey-years' into 'main'
gdatetime: Disable ERA support on platforms which don’t support this

See merge request GNOME/glib!3734
2023-11-29 00:14:18 +00:00
Philip Withnall
4b8bbd6f33 meson: Fail configure if nl_langinfo() supports a weird set of options
The `#include <langinfo.h>` in `gdatetime.c` is currently predicated on
`HAVE_LANGINFO_TIME`, but it’s needed for all the `HAVE_LANGINFO_*`
features.

It seems the code implicitly assumes that `HAVE_LANGINFO_TIME` will be
true if any other `HAVE_LANGINFO_*` macros are true. While I haven’t
seen this assumption be broken in practice, it seems prudent to
explicitly encode that in the configure tests. It’s easy enough to do.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-28 23:56:22 +00:00
Philip Withnall
8ee00cbad8 gdatetime: Disable ERA support on platforms which don’t support this
So far, that’s BSD: it supports `nl_langinfo()`, but not `ERA`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3119
2023-11-28 23:56:22 +00:00
Philip Withnall
26f70e7605 ci: Remove unused variable from run-style-check-diff.sh
This was forgotten in commit c2e21a8164.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-28 23:45:22 +00:00
Philip Withnall
bfa2f9091f ci: Fix printing info message at end of run-style-check-diff.sh
The changes in commit 95479256df didn’t
completely work (or some other change has broken them since): the
informational message at the end of the script is now not printed.

Fix that by stopping bash exiting immediately if the subshell exits, by
using it in a boolean expression.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-11-28 23:43:33 +00:00
Philip Withnall
9eda0b2fcd gdatetime: Fix typo in comment
This was pointed out in the review for !3696 but owing to a mistake by
me, the fix was not included in the version of the MR which was merged.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3119
2023-11-28 23:14:40 +00:00
Philip Withnall
c8e3302007 gdatetime: Fix copyright/author information on recent GDateTime changes
I wrote the changes before clarifying the copyright status of my
contract with the GNOME Foundation, and forgot to update them.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3119
2023-11-28 23:13:27 +00:00
Philip Withnall
2ada5ba0f1 Merge branch '3119-Ey-years' into 'main'
gdatetime: Add support for %E modifier to g_date_time_format()

Closes #3119

See merge request GNOME/glib!3696
2023-11-28 20:08:10 +00:00
Philip Withnall
517a3ac861 tests: Set locale to C.UTF-8 in datetime tests
It was previously set (by default) to `C`, so this commit doesn’t change
the locale behaviour of the tests, but does ensure that messages printed
by the tests are correctly formatted in UTF-8 rather than transliterated
to ASCII.

That makes interpreting test output easier.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-11-28 19:32:03 +00:00
Philip Withnall
09fe2aa78d gdatetime: Fix a minor leak on changing locale
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-11-28 19:32:03 +00:00
Philip Withnall
454064f82d gdate: Fix some typos in a documentation comment
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-11-28 19:32:03 +00:00