mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 10:08:56 +01:00 
			
		
		
		
	gsocketclient: Document ownership of connection_attempts better
This introduces no functional changes; just made it while trying to debug issue #2925. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2925
This commit is contained in:
		@@ -1469,7 +1469,7 @@ typedef struct
 | 
				
			|||||||
  GCancellable *enumeration_parent_cancellable;  /* (nullable) (owned) */
 | 
					  GCancellable *enumeration_parent_cancellable;  /* (nullable) (owned) */
 | 
				
			||||||
  gulong enumeration_cancelled_id;
 | 
					  gulong enumeration_cancelled_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  GSList *connection_attempts;
 | 
					  GSList *connection_attempts;  /* (element-type ConnectionAttempt) (owned) */
 | 
				
			||||||
  GSList *successful_connections;
 | 
					  GSList *successful_connections;
 | 
				
			||||||
  SocketClientErrorInfo *error_info;
 | 
					  SocketClientErrorInfo *error_info;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1874,7 +1874,7 @@ g_socket_client_connected_callback (GObject      *source,
 | 
				
			|||||||
				    GAsyncResult *result,
 | 
									    GAsyncResult *result,
 | 
				
			||||||
				    gpointer      user_data)
 | 
									    gpointer      user_data)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  ConnectionAttempt *attempt = user_data;
 | 
					  ConnectionAttempt *attempt = g_steal_pointer (&user_data);
 | 
				
			||||||
  GSocketClientAsyncConnectData *data = attempt->data;
 | 
					  GSocketClientAsyncConnectData *data = attempt->data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (task_completed_or_cancelled (data) || g_cancellable_is_cancelled (attempt->cancellable))
 | 
					  if (task_completed_or_cancelled (data) || g_cancellable_is_cancelled (attempt->cancellable))
 | 
				
			||||||
@@ -2032,7 +2032,7 @@ g_socket_client_enumerator_callback (GObject      *object,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  g_source_set_callback (attempt->timeout_source, on_connection_attempt_timeout, attempt, NULL);
 | 
					  g_source_set_callback (attempt->timeout_source, on_connection_attempt_timeout, attempt, NULL);
 | 
				
			||||||
  g_source_attach (attempt->timeout_source, g_task_get_context (data->task));
 | 
					  g_source_attach (attempt->timeout_source, g_task_get_context (data->task));
 | 
				
			||||||
  data->connection_attempts = g_slist_append (data->connection_attempts, attempt);
 | 
					  data->connection_attempts = g_slist_append (data->connection_attempts, connection_attempt_ref (attempt));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (g_task_get_cancellable (data->task))
 | 
					  if (g_task_get_cancellable (data->task))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -2048,7 +2048,7 @@ g_socket_client_enumerator_callback (GObject      *object,
 | 
				
			|||||||
  g_socket_connection_connect_async (G_SOCKET_CONNECTION (attempt->connection),
 | 
					  g_socket_connection_connect_async (G_SOCKET_CONNECTION (attempt->connection),
 | 
				
			||||||
				     address,
 | 
									     address,
 | 
				
			||||||
				     attempt->cancellable,
 | 
									     attempt->cancellable,
 | 
				
			||||||
				     g_socket_client_connected_callback, connection_attempt_ref (attempt));
 | 
									     g_socket_client_connected_callback, attempt  /* transfer full */);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user