[libsoup] SoupSession: merge AWAITING_CONNECTION state into STARTING



commit 4d3762940fbce8b7db14ae57a97e476fec64840d
Author: Dan Winship <danw gnome org>
Date:   Thu Aug 2 12:06:37 2012 -0400

    SoupSession: merge AWAITING_CONNECTION state into STARTING
    
    The only thing STARTING did was move directly into
    AWAITING_CONNECTION, so there's no need for two separate states.

 libsoup/soup-message-queue.h |    1 -
 libsoup/soup-session-async.c |    8 ++------
 libsoup/soup-session-sync.c  |    8 ++------
 3 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/libsoup/soup-message-queue.h b/libsoup/soup-message-queue.h
index 54c2971..cd15381 100644
--- a/libsoup/soup-message-queue.h
+++ b/libsoup/soup-message-queue.h
@@ -15,7 +15,6 @@ G_BEGIN_DECLS
 
 typedef enum {
 	SOUP_MESSAGE_STARTING,
-	SOUP_MESSAGE_AWAITING_CONNECTION,
 	SOUP_MESSAGE_GOT_CONNECTION,
 	SOUP_MESSAGE_CONNECTING,
 	SOUP_MESSAGE_CONNECTED,
diff --git a/libsoup/soup-session-async.c b/libsoup/soup-session-async.c
index 46dac50..dee7d92 100644
--- a/libsoup/soup-session-async.c
+++ b/libsoup/soup-session-async.c
@@ -176,7 +176,7 @@ tunnel_message_completed (SoupMessage *tunnel_msg, gpointer user_data)
 		if (item->conn)
 			soup_connection_disconnect (item->conn);
 		if (tunnel_msg->status_code == SOUP_STATUS_TRY_AGAIN) {
-			item->state = SOUP_MESSAGE_AWAITING_CONNECTION;
+			item->state = SOUP_MESSAGE_STARTING;
 			soup_message_queue_item_set_connection (item, NULL);
 		} else
 			soup_message_set_status (item->msg, tunnel_msg->status_code);
@@ -209,7 +209,7 @@ got_connection (SoupConnection *conn, guint status, gpointer user_data)
 
 		if (status == SOUP_STATUS_TRY_AGAIN) {
 			soup_message_queue_item_set_connection (item, NULL);
-			item->state = SOUP_MESSAGE_AWAITING_CONNECTION;
+			item->state = SOUP_MESSAGE_STARTING;
 		} else {
 			soup_session_set_item_status (session, item, status);
 			item->state = SOUP_MESSAGE_FINISHING;
@@ -252,10 +252,6 @@ process_queue_item (SoupMessageQueueItem *item,
 
 		switch (item->state) {
 		case SOUP_MESSAGE_STARTING:
-			item->state = SOUP_MESSAGE_AWAITING_CONNECTION;
-			break;
-
-		case SOUP_MESSAGE_AWAITING_CONNECTION:
 			if (!soup_session_get_connection (session, item, should_prune))
 				return;
 
diff --git a/libsoup/soup-session-sync.c b/libsoup/soup-session-sync.c
index 987d55d..d753f57 100644
--- a/libsoup/soup-session-sync.c
+++ b/libsoup/soup-session-sync.c
@@ -237,16 +237,12 @@ process_queue_item (SoupMessageQueueItem *item)
 
 		switch (item->state) {
 		case SOUP_MESSAGE_STARTING:
-			item->state = SOUP_MESSAGE_AWAITING_CONNECTION;
-			break;
-
-		case SOUP_MESSAGE_AWAITING_CONNECTION:
 			g_mutex_lock (&priv->lock);
 			do {
 				get_connection (item);
-				if (item->state == SOUP_MESSAGE_AWAITING_CONNECTION)
+				if (item->state == SOUP_MESSAGE_STARTING)
 					g_cond_wait (&priv->cond, &priv->lock);
-			} while (item->state == SOUP_MESSAGE_AWAITING_CONNECTION);
+			} while (item->state == SOUP_MESSAGE_STARTING);
 			g_mutex_unlock (&priv->lock);
 			break;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]