Commit Graph

15392 Commits

Author SHA1 Message Date
Ryan Lortie
ef7759e617 gio fixups 2014-12-19 12:22:40 -05:00
Ryan Lortie
d6bb450e7d gmain linux fixes 2014-12-19 12:22:10 -05:00
Ryan Lortie
57204526fa glib: Add handle watching utils 2014-12-19 11:34:08 -05:00
Ryan Lortie
b9ba498d42 Add "coarse" monotonic time 2014-12-18 22:22:04 -05:00
Ryan Lortie
86c991bc21 gthread: tighten critical section api 2014-12-18 20:15:47 -05:00
Ryan Lortie
1ff14b5aaa factor cancel 2014-12-18 20:15:21 -05:00
Ryan Lortie
b35633ff2c magic gcan functions 2014-12-18 20:14:26 -05:00
Ryan Lortie
582e41a28d GCancellable: add critical section support
This allows using the per-thread handle in order to avoid creating one
per-cancellable.

It also does no system calls in the "not cancelled" case, which is nice.
2014-12-18 18:00:49 -05:00
Ryan Lortie
e66277492a GThread: add "critical section" support 2014-12-18 17:05:31 -05:00
Ryan Lortie
9e9f2567f1 gwakeup: add support for ghandle 2014-12-18 17:00:12 -05:00
Ryan Lortie
ed777082cb Revert "crack"
This reverts commit 172df642f1f376766a881d6d6fa2caabc41e4451.
2014-12-18 17:00:12 -05:00
Ryan Lortie
0f68f13c6f crack 2014-12-18 17:00:12 -05:00
Ryan Lortie
643180e3df main handle stuff 2014-12-18 17:00:12 -05:00
Ryan Lortie
19499579f9 gpoll: introduce new ghandle type
We've long discussed having a ghandle type corresponding to HANDLE on windows
and an int (fd) elsewhere.  Let's add that now.

We continue to maintain the 'fd' field as being an integer on Windows in order
to avoid warnings about implicit casts in existing software.  'ghandleint' was
introduced for that purpose.
2014-12-18 17:00:12 -05:00
Ryan Lortie
0dce44800b gio: use new g_cancellable_poll_simple() API
This removes a lot of similar-looking code.

This also means that there is no longer any code inside of GIO that is
handling fds from GCancellable.  That moves us closer to being able to
completely rid ourselves of per-cancellable file descriptors.

Windows parts are completely untested (and not even compiled).

https://bugzilla.gnome.org/show_bug.cgi?id=741716
2014-12-18 13:42:34 -05:00
Ryan Lortie
69c3ce7148 GCancellable: add new poll wrapper APIs
Add two APIs to GCancellable for waiting on one or more GPollFD records until
they are ready, or until cancellation.

This is basically a cancellable version of g_poll().

This makes many typical operations easier; it will be possible to
replace all cases of g_cancellable_make_pollfd() in GIO with just the
simple version of this function, often at a large reduction in lines of
code.  Even better is that in the future, users of this API may be able
to avoid allocating an fd at all.

I'm not sure if it's worth keeping the _full version.

https://bugzilla.gnome.org/show_bug.cgi?id=741716
2014-12-18 13:42:34 -05:00
Philip Chimento
4f3ab40c04 gfile: Explain nonobvious use of my_error
In g_file_make_directory_with_parents(), the my_error variable is used
for several different purposes throughout the whole function, not all of
which are obvious. This explains the situation with some comments.

https://bugzilla.gnome.org/show_bug.cgi?id=719455
2014-12-18 02:02:53 -05:00
Philip Chimento
44372f4dd0 gfile: Use g_error_matches
Make proper use of g_error_matches() instead of comparing only error codes.

https://bugzilla.gnome.org/show_bug.cgi?id=719455
2014-12-18 02:02:53 -05:00
Philip Chimento
5a7db3015a gfile: make_directory_with_parents race condition
A race condition could cause g_file_make_directory_with_parents() to
fail with G_IO_ERROR_EXISTS despite the requested directory not
existing.

https://bugzilla.gnome.org/show_bug.cgi?id=719455
2014-12-18 02:02:53 -05:00
Daniel Mustieles
388e0d576f Updated Spanish translation 2014-12-17 12:31:29 +01:00
Philip Withnall
e98a5828d3 docs: Remove a mention of g_clear_object() being atomic
It is no longer atomic.

https://bugzilla.gnome.org/show_bug.cgi?id=741589
2014-12-16 17:11:11 +00:00
Matthias Clasen
924f269763 2.43.2 2.43.2 2014-12-15 13:17:15 -05:00
Matthias Clasen
0f21ee4c89 gobject: Add missing symbols to the docs 2014-12-15 13:17:15 -05:00
Matthias Clasen
169eae47e5 gio: Add missing symbols to docs 2014-12-15 13:17:15 -05:00
Matthias Clasen
b32ea8d924 Updates 2014-12-15 11:52:42 -05:00
Dan Winship
b6d1c66c50 gio/tests/socket: fix one of the new tests
One of the recently-added tests was using g_test_cmpstr() on a buffer
containing a string that wasn't necessarily 0-terminated.
2014-12-14 08:04:27 -05:00
Xavier Claessens
1a2a689dea Doc: glib: Fix all undocumented/unused/undeclared symbols
There is one issue left in gscanner.h due to a bug #741305 in gtk-doc.

https://bugzilla.gnome.org/show_bug.cgi?id=740814
2014-12-12 11:01:37 -05:00
Shankar Prasad
b6aa0c4890 Updated Kannada translation 2014-12-12 11:55:07 +00:00
Yosef Or Boczko
45e4ea75da Updated Hebrew translation 2014-12-12 12:36:27 +02:00
Ryan Lortie
de65723877 ghash: minor docs tweak
We should not advise people to cast the result of
g_hash_table_get_keys_as_array() to a type that looks suitable for use
with g_strfreev().  Advise to use (const gchar **) instead.
2014-12-11 18:50:07 -05:00
Tim-Philipp Müller
ae1b6ecd9d gio/tests/socket: add unit test for g_socket_send_messages()
https://bugzilla.gnome.org/show_bug.cgi?id=719646
2014-12-11 15:10:44 +00:00
Tim-Philipp Müller
fff5c7cd63 gsocket: add g_socket_send_messages()
Allows sending of multiple messages (packets, datagrams)
in one go using sendmmsg(), thus drastically reducing the
number of syscalls when sending out a lot of data, or when
sending out the same data to multiple recipients.

https://bugzilla.gnome.org/show_bug.cgi?id=719646
2014-12-11 15:10:44 +00:00
Tim-Philipp Müller
3c3fc0e463 gio/tests/socket: add datagram version of test_ip_sync 2014-12-11 15:10:44 +00:00
Tim-Philipp Müller
4864850427 gio/tests/socket: add test for g_socket_send_message() 2014-12-11 15:10:44 +00:00
Sweta Kothari
dd5fd6902d Updated gujarati translations 2014-12-11 09:30:23 +05:30
Muhammet Kara
fbf0b2e19c Updated Turkish translation 2014-12-10 22:04:49 +00:00
Dan Winship
f8da414d08 gio: fix the Since/AVAILABLE version on network connectivity stuff 2014-12-10 18:39:21 +01:00
Colin Walters
a12f546b3b keyfile: Add "in group" to GError message consistently
This originated with https://github.com/GNOME/ostree/pull/23
It's nicer for the user if we also mention which group the expected
key would be in.

And in fact, every other error *except* _get_value() already had it.

https://bugzilla.gnome.org/show_bug.cgi?id=741226
2014-12-07 22:00:41 -05:00
Balázs Úr
7966f27882 Updated Hungarian translation 2014-12-07 09:26:40 +00:00
Ross Lagerwall
7d9816934e gio/tests: Prevent hangs and aborts in socket-listener
Fix two problems:
1) If g_socket_service_stop is called before the accept call is requeued,
then the reference count won't decrease and this code will hang forever:
  while (G_OBJECT (service)->ref_count == ref_count)
    g_main_context_iteration (NULL, TRUE);

2) Sometimes the testcase fails (maybe 1 in 200 times for me):
GLib-GIO:ERROR:socket-listener.c:73:connection_cb: assertion failed
(G_OBJECT (service)->ref_count == 2): (3 == 2)
Aborted (core dumped)

The problem is that depending on ordering, cancellation of the async
listener can require further main context iterations before it releases
the reference on the socket service. Furthermore, in some cases, it
requires at least one iteration.

https://bugzilla.gnome.org/show_bug.cgi?id=712570
2014-12-07 08:40:18 +02:00
Piotr Drąg
53abf0dc7d Updated POTFILES.in 2014-12-05 23:04:04 +01:00
Bastien Nocera
485a6900fc gio: Add GNetworkMonitor impl based on NetworkManager
Which implements the new GNetworkConnectivity property.

https://bugzilla.gnome.org/show_bug.cgi?id=664562
2014-12-05 17:37:41 +01:00
Dan Winship
8d08b82109 gio: add network connectivity state to GNetworkMonitor
Add a property to GNetworkMonitor indicating the level of network
connectivity: none/local, limited, stuck behind a portal, or full.

The default implementation just returns none or full depending on the
value of is-available.

https://bugzilla.gnome.org/show_bug.cgi?id=664562
2014-12-05 17:37:41 +01:00
Bastien Nocera
ed68d80e61 gio: Correct the "available in" for GNetworkMonitor
They were marked as available in all versions when the main interface
was actually added in glib 2.32.

https://bugzilla.gnome.org/show_bug.cgi?id=664562
2014-12-05 17:37:41 +01:00
Ignacio Casal Quinteiro
e0f1a19332 gio: provide G_IO_ERROR_NOT_CONNECTED translation for ENOTCONN
https://bugzilla.gnome.org/show_bug.cgi?id=741016
2014-12-02 14:29:50 +01:00
Ignacio Casal Quinteiro
22ab227348 gio: fix build
next time I should definitely try to compile after a rebase conflict...
2014-12-02 14:29:50 +01:00
Ignacio Casal Quinteiro
fbfc23453d gio: add G_IO_ERROR_NOT_CONNECTED
It adds a new error G_IO_ERROR_NOT_CONNECTED
and makes the win32 error ERROR_PIPE_LISTENING
to be translated to it.

https://bugzilla.gnome.org/show_bug.cgi?id=741016
2014-12-02 14:21:14 +01:00
Rico Tzschichholz
d0d5ea71bb docs: Add index for 2.44 api 2014-12-01 14:17:26 +01:00
Trần Ngọc Quân
8b27ac0d9f Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2014-12-01 09:07:13 +07:00
Dan Winship
967fedc0ae gsocket: add G_IO_ERROR_CONNECTION_CLOSED
Add G_IO_ERROR_CONNECTION_CLOSED as an alias for
G_IO_ERROR_BROKEN_PIPE, and also return it on ECONNRESET.

It doesn't really make sense to try to distinguish EPIPE and
ECONNRESET at the GLib level, since the exact choice of which error
gets returned in what conditions depends on the OS. Given that, we
ought to map the two errors to the same value, and since we're already
mapping EPIPE to G_IO_ERROR_BROKEN_PIPE, we need to map ECONNRESET to
that too. But the existing name doesn't really make sense for sockets,
so we add a new name.

https://bugzilla.gnome.org/show_bug.cgi?id=728928
2014-11-29 14:26:42 -05:00