[Icecast-dev] [PATCH 28/31] Big Comments cleanup

Niv Sardi nsardi at smartjog.com
Fri Jul 30 07:54:50 PDT 2010


Signed-off-by: Niv Sardi <nsardi at smartjog.com>
---
 src/connection.c |   13 ++++++++++---
 src/util.c       |   12 ++++++------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 45a0df9..8d2d906 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -426,6 +426,7 @@ connection_t *connection_create (sock_t sock, sock_t serversock, char *ip)
         con->send = connection_send;
     }
 
+    DEBUG3 ("creating con = %p for fd =%d on %d.", con, sock, serversock);
     return con;
 }
 
@@ -575,6 +576,7 @@ connection_queue_t *_connection_node_new (connection_t *con)
 
     node->con = con;
 
+    DEBUG2 ("created connection node %p -> %p", node, con);
     return node;
 }
 
@@ -606,15 +608,15 @@ static connection_queue_t *_get_connection(void)
             _con_queue_tail = &_con_queue;
         node->next = NULL;
     } else {
-        INFO("sleeping");
+        DEBUG ("connection thread sleeping");
         thread_cond_wait(_connection_cond);
-        INFO("awake");
+        DEBUG ("connection thread awake");
     }
     return node;
 }
 
 static void _connection_node_destroy (connection_queue_t *node) {
-    INFO("destroying node");
+    DEBUG2 ("destroying node %p -> %p", node, node->con);
 
     if (node->client) {
         client_destroy(node->client); /* destroys con, parser, refbuf */
@@ -648,6 +650,7 @@ static void *_connection_thread (void *arg)
         }
 	err = _connection_process (node);
         if (err > 0) {
+            DEBUG1 ("AOK, dropping node (%p)", node);
             free(node);
             continue;
         }
@@ -658,6 +661,7 @@ static void *_connection_thread (void *arg)
             _add_connection (node); /* XXX concurency */
             break;
         case EINPROGRESS:	/* already handled */
+            DEBUG1 ("Node (%p) is handled internaly", node);
             free(node);
             break;
         default:
@@ -840,6 +844,7 @@ void connection_accept_loop (void)
         /* add connection async to the connection queue, then the
          * connection loop will do all the dirty work */
         node =_connection_node_new (con);
+        INFO1 ("Got new connection %p, adding to queue", node);
         _add_connection (node);
         duration = 3000;
     }
@@ -1407,6 +1412,8 @@ int connection_setup_sockets (ice_config_t *config)
 
 void connection_close(connection_t *con)
 {
+    WARN("destroying con = %p for fd =%d on %d.", con, con->sock, con->serversock);
+
     sock_close(con->sock);
     if (con->ip) free(con->ip);
     if (con->host) free(con->host);
diff --git a/src/util.c b/src/util.c
index c74d1ce..95e85c4 100644
--- a/src/util.c
+++ b/src/util.c
@@ -156,7 +156,7 @@ int util_read_header(connection_t *con, refbuf_t *refbuf, int flags)
     }
 
     if (util_timed_wait_for_fd(con->sock, header_timeout) <= 0) {
-	    INFO("util_timed_wait_for_fd <= 0");
+	    INFO("util_timed_wait_for_fd <= 0 on (%p)", con);
 	    return -EAGAIN;
     }
 
@@ -185,7 +185,7 @@ int util_read_header(connection_t *con, refbuf_t *refbuf, int flags)
                 refbuf->sync_point = 0;
                 return endpos;
             }
-            INFO ("missing client data, come back for more");
+            INFO ("missing client data, on (%p) come back for more", con);
             refbuf->sync_point = endpos;
             return endpos;
         }
@@ -197,11 +197,11 @@ int util_read_header(connection_t *con, refbuf_t *refbuf, int flags)
             return -ENOMEM;
         }
 
-	    if (util_timed_wait_for_fd(con->sock, header_timeout) <= 0) {
-		    INFO ("util_timed_wait_for_fd <= 0");
+        if (util_timed_wait_for_fd(con->sock, header_timeout) <= 0) {
+            INFO ("util_timed_wait_for_fd <= 0");
             refbuf->sync_point = -pos;
-		    return -EAGAIN;
-	    }
+            return -EAGAIN;
+        }
 
         if (time(NULL) > con->con_timeout)
             goto out_FAIL;
-- 
1.7.1



More information about the Icecast-dev mailing list