mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +01:00
gio/tests/socket-client: fix a crash (and some indentation)
This commit is contained in:
parent
53fb4e9867
commit
afa604f881
@ -40,8 +40,10 @@ static GOptionEntry cmd_entries[] = {
|
|||||||
#include "socket-common.c"
|
#include "socket-common.c"
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
accept_certificate (GTlsClientConnection *conn, GTlsCertificate *cert,
|
accept_certificate (GTlsClientConnection *conn,
|
||||||
GTlsCertificateFlags errors, gpointer user_data)
|
GTlsCertificate *cert,
|
||||||
|
GTlsCertificateFlags errors,
|
||||||
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
g_print ("Certificate would have been rejected ( ");
|
g_print ("Certificate would have been rejected ( ");
|
||||||
if (errors & G_TLS_CERTIFICATE_UNKNOWN_CA)
|
if (errors & G_TLS_CERTIFICATE_UNKNOWN_CA)
|
||||||
@ -62,7 +64,8 @@ accept_certificate (GTlsClientConnection *conn, GTlsCertificate *cert,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GTlsCertificate *
|
static GTlsCertificate *
|
||||||
lookup_client_certificate (GTlsClientConnection *conn, GError **error)
|
lookup_client_certificate (GTlsClientConnection *conn,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
GList *l, *accepted;
|
GList *l, *accepted;
|
||||||
GList *c, *certificates;
|
GList *c, *certificates;
|
||||||
@ -101,9 +104,15 @@ lookup_client_certificate (GTlsClientConnection *conn, GError **error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
make_connection (const char *argument, GTlsCertificate *certificate, GCancellable *cancellable,
|
make_connection (const char *argument,
|
||||||
GSocket **socket, GSocketAddress **address, GIOStream **connection,
|
GTlsCertificate *certificate,
|
||||||
GInputStream **istream, GOutputStream **ostream, GError **error)
|
GCancellable *cancellable,
|
||||||
|
GSocket **socket,
|
||||||
|
GSocketAddress **address,
|
||||||
|
GIOStream **connection,
|
||||||
|
GInputStream **istream,
|
||||||
|
GOutputStream **ostream,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
GSocketType socket_type;
|
GSocketType socket_type;
|
||||||
GSocketFamily socket_family;
|
GSocketFamily socket_family;
|
||||||
@ -156,7 +165,7 @@ make_connection (const char *argument, GTlsCertificate *certificate, GCancellabl
|
|||||||
*address = g_socket_address_enumerator_next (enumerator, cancellable, error);
|
*address = g_socket_address_enumerator_next (enumerator, cancellable, error);
|
||||||
if (*address == NULL)
|
if (*address == NULL)
|
||||||
{
|
{
|
||||||
if (error == NULL)
|
if (error != NULL && *error == NULL)
|
||||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||||
"No more addresses to try");
|
"No more addresses to try");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user