[PATCH] Remove useless conncheck_state

Jakub Adam jakub.adam at ktknet.cz
Sun May 15 09:54:16 PDT 2011


Member variable of struct _Stream is assigned to but never read.
---
 agent/conncheck.c |   10 +---------
 agent/stream.h    |   14 --------------
 2 files changed, 1 insertions(+), 23 deletions(-)

diff --git a/agent/conncheck.c b/agent/conncheck.c
index eea1009..dc15014 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -430,7 +430,6 @@ static gboolean priv_conn_check_tick_unlocked (gpointer pointer)
         Component *component = j->data;
         priv_update_check_list_state_for_ready (agent, stream, component);
       }
-      stream->conncheck_state = NICE_CHECKLIST_COMPLETED;
     }
 
     /* Stopping the timer so destroy the source.. this will allow
@@ -1270,10 +1269,6 @@ static void priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Componen
   pair->nominated = use_candidate;
   pair->controlling = agent->controlling_mode;
 
-  /* note: for the first added check */
-  if (!stream->conncheck_list)
-    stream->conncheck_state = NICE_CHECKLIST_RUNNING;
-
   nice_debug ("Agent %p : added a new conncheck %p with foundation of '%s' to list %u.", agent, pair, pair->foundation, stream_id);
 
   /* implement the hard upper limit for number of
@@ -1363,7 +1358,6 @@ void conn_check_free (NiceAgent *agent)
       g_slist_foreach (stream->conncheck_list, conn_check_free_item, NULL);
       g_slist_free (stream->conncheck_list),
 	stream->conncheck_list = NULL;
-      stream->conncheck_state = NICE_CHECKLIST_NOT_STARTED;
     }
   }
 
@@ -1399,10 +1393,8 @@ gboolean conn_check_prune_stream (NiceAgent *agent, Stream *stream)
       break;
   }
 
-  if (!stream->conncheck_list) {
-    stream->conncheck_state = NICE_CHECKLIST_NOT_STARTED;
+  if (!stream->conncheck_list)
     conn_check_free (agent);
-  }
 
   /* return FALSE if there was a memory allocation failure */
   if (stream->conncheck_list == NULL && i != NULL)
diff --git a/agent/stream.h b/agent/stream.h
index 171ea72..e2f5e39 100644
--- a/agent/stream.h
+++ b/agent/stream.h
@@ -59,19 +59,6 @@ G_BEGIN_DECLS
 #define NICE_STREAM_DEF_UFRAG   4 + 1    /* ufrag + NULL */
 #define NICE_STREAM_DEF_PWD     22 + 1   /* pwd + NULL */
 
-/*
- * Checklist states. These match the definition given in
- * the ICE spec sect 5.7.4. "Computing States" (ID-19).
- */
-typedef enum
-{
-  NICE_CHECKLIST_NOT_STARTED = 1,
-  NICE_CHECKLIST_RUNNING,
-  NICE_CHECKLIST_COMPLETED,
-  NICE_CHECKLIST_FAILED
-} NiceCheckListState;
-
-
 struct _Stream
 {
   guint id;
@@ -79,7 +66,6 @@ struct _Stream
   gboolean initial_binding_request_received;
   GSList *components; /* list of 'Component' structs */
   GSList *conncheck_list;         /* list of CandidatePair items */
-  NiceCheckListState conncheck_state; /* checklist state */
   gchar local_ufrag[NICE_STREAM_MAX_UFRAG];
   gchar local_password[NICE_STREAM_MAX_PWD];
   gchar remote_ufrag[NICE_STREAM_MAX_UFRAG];
-- 
1.7.4.4


--------------000108000307090803070500--


More information about the Nice mailing list