Commit Graph

175 Commits

Author SHA1 Message Date
Dan Winship
59d62726de Add initial TLS (SSL) support to gio
This adds an extension point for TLS connections to gio, with a
gnutls-based implementation in glib-networking.

Full TLS support is still a work in progress; the current API is
missing some features, and parts of it may still be changed before
2.28.

https://bugzilla.gnome.org/show_bug.cgi?id=588189
2010-11-26 15:57:11 -05:00
Dan Winship
a1690339c7 make GProxyConnection public, as GTcpWrapperConnection
GProxyConnection is a class that was added for proxy support;
g_socket_client_connect() returns a GSocketConnection, but in some
cases (eg, encrypted SOCKS), GProxy might return a GIOStream that is
not a GSocketConnection. In that case, GSocketClient would wrap the
stream up in a GProxyConnection, which is a subclass of
GSocketConnection but uses the input/output streams of the wrapped
connection.

GTlsConnection is not a GSocketConnection, so it has the same problem,
so it will need the same treatment. Rename the class to
GTcpWrapperStream, and make it public, so people can extract the base
stream from it when necessary.

(This is not ideal and GSocketClient will need to be revisited as an
API at some point...)

https://bugzilla.gnome.org/show_bug.cgi?id=588189
2010-11-26 15:08:31 -05:00
Dan Winship
c20c2c0abd Add pollable input/output streams
When interfacing with APIs that expect unix-style async I/O, it is
useful to be able to tell in advance whether a read/write is going to
block. This adds new interfaces GPollableInputStream and
GPollableOutputStream that can be implemented by a GInputStream or
GOutputStream to add _is_readable/_is_writable, _create_source, and
_read_nonblocking/_write_nonblocking methods.

Also, implement for GUnixInput/OutputStream and
GSocketInput/OutputStream

https://bugzilla.gnome.org/show_bug.cgi?id=634241
2010-11-26 15:08:08 -05:00
Dan Winship
6181c7de36 GCancellable: add g_cancellable_create_source()
g_cancellable_create_source() returns a GSource that triggers when its
corresponding GCancellable is cancelled. This can be used with
g_source_add_child_source() to add cancellability to a source.

Port gasynchelper's FDSource to use this rather than doing its own
cancellable handling, and also fix up its callback argument order to
be more normal.

https://bugzilla.gnome.org/show_bug.cgi?id=634239
2010-11-26 15:07:28 -05:00
Cosimo Cecchi
30c378032f appinfo: update docs for API addition 2010-11-23 10:29:09 +01:00
Ryan Lortie
9fbfac6abb GPeriodic: remove repair functions
Replace it with a single repair signal that either fires or does not.
2010-11-08 18:22:18 -05:00
Christian Persch
ba45e36932 Add g_simple_async_report_take_gerror_in_idle
... and use it where appropriate. Saves an extra GError copy.

Bug #633686.
2010-11-03 14:38:08 +01:00
Ryan Lortie
63b87b2c26 Add simple dynamic scheduling to GPeriodic
GPeriodic will now try not to use more than 50% of the CPU for its own
purposes unless there are no other tasks attempting to run.
2010-11-03 00:16:16 -04:00
Matthias Clasen
b49ae16461 Various documentation fixes 2010-10-31 22:41:00 -04:00
Ryan Lortie
7aa2e50262 GApplication: support environment passing
Add support for passing the full contents of the environment to the
primary instance (by storing it in the platform_data) when
G_APPLICATION_SEND_ENVIRONMENT is in the flags.
2010-10-28 22:50:00 -04:00
Matthias Clasen
11a59404d5 More documentation fixups 2010-10-25 08:42:36 -04:00
Ryan Lortie
5400b0b38c GPeriodic: a periodic event clock
Add a new class, GPeriodic.

We hope to use this as a paint clock that can be shared by GTK and
Clutter.  Many changes are still expected to the API.
2010-10-20 11:47:31 +02:00
Ryan Lortie
e33deea16c GApplication: reduce GVariant abuse
Don't use GVariant* as the representation for the argument array.
2010-10-19 19:38:00 +02:00
Ryan Lortie
a327bc51fc Cleanup and doc GApplicationCommandLine 2010-10-19 18:29:58 +02:00
Ryan Lortie
eac4c385f0 GIO reference doc cleanups (re: GApplication) 2010-10-19 16:56:18 +02:00
Ryan Lortie
e740c5b4cd Update symbols and docs sections 2010-10-04 03:36:09 -04:00
Ryan Lortie
2e78d07f86 Add g_data_input_stream_read_upto{,async,finish}
These functions are meant to replace the read_until() flavour, with the
following improvements:

  - consistency between the synchronous and asynchronous versions as to
    if the separator character is read (it never is).

  - support for using a nul byte as a separator character by way of
    addition of a length parameter which allows stop_chars to be treated
    as a byte array rather than a nul-terminated string.

The read_until() functions are not yet formally deprecated, but a note
has been added to the documentation warning not to use them as they will
be in the future.

This is bug #584284.
2010-09-13 13:14:25 -04:00
David Zeuthen
c3371efcaa Bug 624546 – Modification of GDBusMessage in filter function
Rework filter functions as per

 https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8

This commit breaks ABI. However, this ABI break affects only
applications using filter functions. The only known user of is dconf.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 13:21:35 -04:00
David Zeuthen
67a00658ea GDBusMessage: Make it possible to lock and copy messages
Don't actually use this yet as that will require a couple of
modifications to the filter function signature. This is part of the
bug-fix for

 https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 12:00:32 -04:00
Ryan Lortie
846b0b3466 GAction is now an interface
the new class GSimpleAction is the implementation half
2010-08-30 19:26:37 +02:00
David Zeuthen
847e4dfe7d GDBusMethodInvocation: nuke constructor
... that is, make it private. This makes sense because users are never
expected to create such objects themselves - only the GDBus core will
need this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-22 22:58:29 -04:00
David Zeuthen
3ff9894826 Bug 624546 – Modification of GDBusMessage in filter function
Allow modifying a GDBusMessage in a filter function and also add tests
for this. This breaks API but leaves ABI (almost) intact - at least
dconf's GSettings backend (the only big user I know of) will keep
working.

https://bugzilla.gnome.org/show_bug.cgi?id=624546

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-05 20:37:27 -04:00
Matthias Clasen
3c5388d9f4 Add some forgotten symbols 2010-08-21 15:40:46 -04:00
Nicolas Dufresne
0958e66317 Add support for g_socket_client_add_application_proxy()
This allow application to take control over certain proxy protocol
handling. When a proxy protocol must be used and is found in the
application proxies, GSocketClient will simply TCP connect to the proxy
server and return the connection.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:38 -04:00
Nicolas Dufresne
0ebb79a748 Implemented g_socket_client_connect_to_uri() method
Using this rather than g_socket_client_connect() or
g_socket_client_connect_to_host() allows #GSocketClient to
determine when to use application-specific proxy protocols.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
a6c3820f46 Hooked proxy enumeration into GSocketClient
This functionnallity can be disabled using property enable-proxy. It
enumerates addresses using GSocketConnectable::proxy_enumerate() instead of
enumerate(). When the returned address is of type GProxyAddress (a type
based on GInetSocketAddress), it gets the proxy protocol handler using
g_proxy_get_default_for_protocol() and call connect() on it.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
fc03ecce83 Implemented proxy_enumerate() for all Connectables
This patch implements method proxy_enumerate from GSocketConnectable for
all connectables (GNetworkAddress, GNetworkService, GInetSocketAddress
and GUnixSocketAddress).

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
f82f484b8f Added proxy_enumerate method to GSocketConnectable
Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
a7e0e8fc08 Adding GProxyAddressEnumerator class
An implementation of GSocketAddressEnumerator that handles proxy
enumeration. This class is mainly usefull for Connectables implementation
such as NetworkService, NetworkAddress and SocketAddress to handle proxies.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
d76de5e359 Added GProxy interface for proxy extension point
Implement an extension point for proxy protocol implementation. This
is mainly useful for socket-based proxy where it is possible to use the
proxied socket the same way it would for other stream based socket.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
63105d1074 Added method g_network_address_parse_uri()
This method allow creating a network address from a URI. If no port is
found in the URI, the default_port parameter will be used. Note that new
property scheme is there for future TLS implementation.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
466111c960 Implement GProxyAddress
A GSocketInetAddress representing the proxy server address with additional
properties proxy type, destination address and port, username and password.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:37 -04:00
Nicolas Dufresne
f3debedfd2 Implemented proxy-resolver extension point
This extension point allow extending GLib with library like LibProxy that
interprets system proxy settings and finds the appropriate configuration
based on the type of connection being made.

Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:36 -04:00
Ryan Lortie
5db9e5ad58 add GSimpleActionGroup
and a simple test
2010-08-18 02:18:54 -04:00
Ryan Lortie
972c563f23 add some missed bits in the docs 2010-08-18 02:14:37 -04:00
Ryan Lortie
8475d6d7d0 add GAction base class 2010-08-18 01:45:15 -04:00
Ryan Lortie
e71dbb9732 add GActionGroup base class 2010-08-18 00:31:33 -04:00
Christian Persch
cae86073ea Add GZIP header processing to GZlibCompressor/GZlibDecompressor
Add GZlibCompressor:file-info property. If it contains a non-NULL
GFileInfo, and the compressor is in GZIP mode, the filename and
modification time from the file info are written to the GZIP header
in the output data.

Add GZlibDeompressor:file-info property. If the decompressor is in GZIP
mode, and the GZIP data contains a GZIP header, the filename and
modification time are read from it, stored in a GFileInfo, and the
file-info property is notified.

Bug #617691.
2010-08-17 17:37:32 +02:00
Christian Persch
b196cd7447 Add g_memory_output_stream_steal_data
Bug #622184.
2010-08-17 17:33:01 +02:00
Dan Winship
547311bfd8 Always do async vs sync correctly in GSocketConnection streams
Previously if a GSocketConnection had a blocking GSocket, it would
sometimes block during asynchonous I/O, and if it had a non-blocking
socket, it would sometimes return G_IO_ERROR_WOULD_BLOCK from
synchronous I/O. This fixes the connection to not depend on the socket
state.

https://bugzilla.gnome.org/show_bug.cgi?id=616458
2010-08-15 15:34:29 -04:00
Dan Winship
17fea2f749 Belatedly add g_socket_client_get/set_timeout to docs and symbols 2010-08-15 13:11:49 -04:00
David Zeuthen
6f070be65b GDBusMessage: Add a way to get/set byte order of a message
Also use this in the test cases to check that serialization to and
from both big and little endian works.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 13:34:14 -04:00
Ryan Lortie
aed440815e GSettings: add g_settings_reset()
Resets a key to its default value.
2010-07-22 17:50:05 -04:00
David Zeuthen
7eba41346e Bug 617483 – Credentials passing
- Make GCredentials instance and class structures private so it can't
   be subclassed and we don't have to worry about ABI compat
   issues. This also allows us to get rid of the GCredentialsPrivate
   struct.

 - Add a GCredentialsType enumeration that is used whenever exchanging
   pointers with the user. This allows us to support OSes with
   multiple native credential types. In particular, it allows
   supporting OSes where the native credential evolves or even changes
   over time.

 - Add g_socket_get_credentials() method.

 - Add tests for g_socket_get_credentials(). Right now this is in the
   GDBus peer-to-peer test case but we can change that later.

 - Move GTcpConnection into a separate gtk-doc page as was already
   half-done with GUnixConnection. Also finish the GUnixConnection
   move and ensure send_credentials() and receive_credentials()
   methods are in the docs. Also nuke comment about GTcpConnection
   being empty compared to its superclass.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-20 16:34:18 -04:00
David Zeuthen
0b2b4deac5 GDBus: Add GDBusSendMessageFlags
This is currently unused but might be useful in the future. For
example, it might be nice with a way to bypass the current queue of
outgoing messages - having a flag enumeration allows us to add a
G_DBUS_SEND_MESSAGE_FLAGS_BYPASS_QUEUE etc. etc.

This commit breaks ABI and API. Users of the (rarely used) API to send
messages will have to port to this new API.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 16:07:57 -04:00
David Zeuthen
7190af4394 GDBus: Remove constness from introspection data structures
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 15:45:27 -04:00
David Zeuthen
4a1c5a1b98 GDBus: Add GDBusSignalFlags and use it in g_dbus_connection_signal_subscribe()
This is currently unused but will probably be useful in the
future. For example, we could have a _ARG0_IS_PATH to specify that
arg0 should be used for arg0path.

This commit breaks API and ABI. Users of
g_dbus_connection_signal_subscribe() will need to port to this new
version.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-19 15:05:10 -04:00
David Zeuthen
914b046226 GDBusConnection: Fix up g_dbus_connection_close()
... so it is async, cancelable and returns an error. Also provide a
synchronous version.

This is an API/ABI break but it is expected that only very few
applications use this API.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-14 12:37:32 -04:00
Ryan Lortie
0bb7cc3fce Remove GUnixVolumeMonitor, GUnixMount from docs
David says that they're supposed to be private.
2010-07-13 09:24:16 -04:00
Ryan Lortie
5344c22810 gio/ docs fixup 2010-07-12 18:30:14 -04:00