libsoup r1199 - in trunk: . libsoup tests
- From: danw svn gnome org
- To: svn-commits-list gnome org
- Subject: libsoup r1199 - in trunk: . libsoup tests
- Date: Mon, 3 Nov 2008 22:43:12 +0000 (UTC)
Author: danw
Date: Mon Nov 3 22:43:12 2008
New Revision: 1199
URL: http://svn.gnome.org/viewvc/libsoup?rev=1199&view=rev
Log:
* libsoup/soup-session-sync.c (process_queue_item): don't remove
the item from the queue here; it should already have happened in
all circumstances. Possible fix for #559052.
* libsoup/soup-session.c (cancel_message): don't remove the item
from the queue here; the call to soup_message_finished() will do
that.
* libsoup/soup-message-queue.c (soup_message_queue_remove): This
should only be called once, so g_return_if_fail (!item->removed)
* tests/test-utils.c (test_init): install a new default g_log
handler that increments the error count when it's called so that a
test won't pass if it triggers a g_warning() or
g_return_if_fail().
Modified:
trunk/ChangeLog
trunk/libsoup/soup-message-queue.c
trunk/libsoup/soup-session-sync.c
trunk/libsoup/soup-session.c
trunk/tests/test-utils.c
Modified: trunk/libsoup/soup-message-queue.c
==============================================================================
--- trunk/libsoup/soup-message-queue.c (original)
+++ trunk/libsoup/soup-message-queue.c Mon Nov 3 22:43:12 2008
@@ -254,6 +254,8 @@
void
soup_message_queue_remove (SoupMessageQueue *queue, SoupMessageQueueItem *item)
{
+ g_return_if_fail (!item->removed);
+
g_mutex_lock (queue->mutex);
item->removed = TRUE;
g_mutex_unlock (queue->mutex);
Modified: trunk/libsoup/soup-session-sync.c
==============================================================================
--- trunk/libsoup/soup-session-sync.c (original)
+++ trunk/libsoup/soup-session-sync.c Mon Nov 3 22:43:12 2008
@@ -222,8 +222,6 @@
soup_connection_send_request (conn, msg);
g_cond_broadcast (priv->cond);
} while (soup_message_get_io_status (msg) != SOUP_MESSAGE_IO_STATUS_FINISHED);
-
- soup_message_queue_remove (item->queue, item);
}
static gboolean
Modified: trunk/libsoup/soup-session.c
==============================================================================
--- trunk/libsoup/soup-session.c (original)
+++ trunk/libsoup/soup-session.c Mon Nov 3 22:43:12 2008
@@ -1257,7 +1257,6 @@
item = soup_message_queue_lookup (priv->queue, msg);
if (item) {
- soup_message_queue_remove (priv->queue, item);
if (item->cancellable)
g_cancellable_cancel (item->cancellable);
soup_message_queue_item_unref (item);
Modified: trunk/tests/test-utils.c
==============================================================================
--- trunk/tests/test-utils.c (original)
+++ trunk/tests/test-utils.c Mon Nov 3 22:43:12 2008
@@ -62,6 +62,15 @@
exit (1);
}
+static void
+test_log_handler (const char *log_domain, GLogLevelFlags log_level,
+ const char *message, gpointer user_data)
+{
+ g_log_default_handler (log_domain, log_level, message, user_data);
+ if (log_level & (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL))
+ errors++;
+}
+
void
test_init (int argc, char **argv, GOptionEntry *entries)
{
@@ -95,6 +104,8 @@
/* Exit cleanly on ^C in case we're valgrinding. */
signal (SIGINT, quit);
+
+ g_log_set_default_handler (test_log_handler, NULL);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]