2003-09-17 Dan Winship <danw@ximian.com>
+ * libsoup/soup-session.c (find_oldest_connection): Fix two bugs
+ (one that pruned too little, one that pruned too much).
+ (queue_message): When requeuing, don't run the queue;
+ final_finished will take care of that later.
+
+ * libsoup/soup-socket.c (soup_socket_connect, got_address): ref
+ the socket while waiting for the address to resolve
+
+2003-09-17 Dan Winship <danw@ximian.com>
+
* libsoup/soup-connection.c (soup_connection_new): Replaces the
three previous soup_connection_new* functions and uses gobject
properties to set the destination and proxy uris.
{
SoupConnection *conn = key, **oldest = data;
- if (!oldest || (soup_connection_last_used (conn) <
- soup_connection_last_used (*oldest)))
+ /* Don't prune a connection that hasn't even been used yet. */
+ if (soup_connection_last_used (conn) == 0)
+ return;
+
+ if (!*oldest || (soup_connection_last_used (conn) <
+ soup_connection_last_used (*oldest)))
*oldest = conn;
}
queue_message (SoupSession *session, SoupMessage *req, gboolean requeue)
{
req->status = SOUP_MESSAGE_STATUS_QUEUED;
- if (!requeue)
+ if (!requeue) {
soup_message_queue_append (session->priv->queue, req);
-
- run_queue (session, TRUE);
+ run_queue (session, TRUE);
+ }
}
/**
if (!SOUP_STATUS_IS_SUCCESSFUL (status)) {
g_signal_emit (sock, signals[CONNECT_RESULT], 0, status);
+ g_object_unref (sock);
return;
}
soup_socket_connect (sock, sock->priv->remote_addr);
/* soup_socket_connect re-reffed addr */
g_object_unref (addr);
+
+ g_object_unref (sock);
}
/**
if (sync)
return SOUP_STATUS_CANT_RESOLVE;
+ g_object_ref (sock);
soup_address_resolve_async (remote_addr, got_address, sock);
return SOUP_STATUS_CONTINUE;
}