X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgsocketclient.c;h=2cd98932fcf4832093f517b046766dd0a06ce2ec;hb=2e5bd8cf47f9e1559ccc44823a2f321b8ff8c1ea;hp=9e322484c27de844e013feb63b9d80035e9f4c0f;hpb=a46459b0002af97c035133907706caeba76f7863;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c index 9e32248..2cd9893 100644 --- a/gio/gsocketclient.c +++ b/gio/gsocketclient.c @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. + * Public License along with this library; if not, see . * * Authors: Ryan Lortie * Alexander Larsson @@ -776,80 +774,40 @@ g_socket_client_class_init (GSocketClientClass *class) * information about a network connection in the UI. The meanings of * the different @event values are as follows: * - * - * - * %G_SOCKET_CLIENT_RESOLVING: - * - * @client is about to look up @connectable in DNS. - * @connection will be %NULL. - * - * - * - * %G_SOCKET_CLIENT_RESOLVED: - * - * @client has successfully resolved @connectable in DNS. - * @connection will be %NULL. - * - * - * - * %G_SOCKET_CLIENT_CONNECTING: - * - * @client is about to make a connection to a remote host; - * either a proxy server or the destination server itself. - * @connection is the #GSocketConnection, which is not yet - * connected. Since GLib 2.40, you can access the remote - * address via g_socket_connection_get_remote_address(). - * - * - * - * %G_SOCKET_CLIENT_CONNECTED: - * - * @client has successfully connected to a remote host. - * @connection is the connected #GSocketConnection. - * - * - * - * %G_SOCKET_CLIENT_PROXY_NEGOTIATING: - * - * @client is about to negotiate with a proxy to get it to - * connect to @connectable. @connection is the - * #GSocketConnection to the proxy server. - * - * - * - * %G_SOCKET_CLIENT_PROXY_NEGOTIATED: - * - * @client has negotiated a connection to @connectable through - * a proxy server. @connection is the stream returned from - * g_proxy_connect(), which may or may not be a - * #GSocketConnection. - * - * - * - * %G_SOCKET_CLIENT_TLS_HANDSHAKING: - * - * @client is about to begin a TLS handshake. @connection is a - * #GTlsClientConnection. - * - * - * - * %G_SOCKET_CLIENT_TLS_HANDSHAKED: - * - * @client has successfully completed the TLS handshake. - * @connection is a #GTlsClientConnection. - * - * - * - * %G_SOCKET_CLIENT_COMPLETE: - * - * @client has either successfully connected to @connectable - * (in which case @connection is the #GSocketConnection that - * it will be returning to the caller) or has failed (in which - * case @connection is %NULL and the client is about to return - * an error). - * - * - * + * - %G_SOCKET_CLIENT_RESOLVING: @client is about to look up @connectable + * in DNS. @connection will be %NULL. + * + * - %G_SOCKET_CLIENT_RESOLVED: @client has successfully resolved + * @connectable in DNS. @connection will be %NULL. + * + * - %G_SOCKET_CLIENT_CONNECTING: @client is about to make a connection + * to a remote host; either a proxy server or the destination server + * itself. @connection is the #GSocketConnection, which is not yet + * connected. Since GLib 2.40, you can access the remote + * address via g_socket_connection_get_remote_address(). + * + * - %G_SOCKET_CLIENT_CONNECTED: @client has successfully connected + * to a remote host. @connection is the connected #GSocketConnection. + * + * - %G_SOCKET_CLIENT_PROXY_NEGOTIATING: @client is about to negotiate + * with a proxy to get it to connect to @connectable. @connection is + * the #GSocketConnection to the proxy server. + * + * - %G_SOCKET_CLIENT_PROXY_NEGOTIATED: @client has negotiated a + * connection to @connectable through a proxy server. @connection is + * the stream returned from g_proxy_connect(), which may or may not + * be a #GSocketConnection. + * + * - %G_SOCKET_CLIENT_TLS_HANDSHAKING: @client is about to begin a TLS + * handshake. @connection is a #GTlsClientConnection. + * + * - %G_SOCKET_CLIENT_TLS_HANDSHAKED: @client has successfully completed + * the TLS handshake. @connection is a #GTlsClientConnection. + * + * - %G_SOCKET_CLIENT_COMPLETE: @client has either successfully connected + * to @connectable (in which case @connection is the #GSocketConnection + * that it will be returning to the caller) or has failed (in which + * case @connection is %NULL and the client is about to return an error). * * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted * multiple times (or not at all) for a given connectable (in @@ -1534,6 +1492,12 @@ g_socket_client_connected_callback (GObject *source, GProxy *proxy; const gchar *protocol; + if (g_task_return_error_if_cancelled (data->task)) + { + g_object_unref (data->task); + return; + } + if (!g_socket_connection_connect_finish (G_SOCKET_CONNECTION (source), result, &error)) { @@ -1616,7 +1580,10 @@ g_socket_client_enumerator_callback (GObject *object, GError *error = NULL; if (g_task_return_error_if_cancelled (data->task)) - return; + { + g_object_unref (data->task); + return; + } address = g_socket_address_enumerator_next_finish (data->enumerator, result, &error);