remvod verbose debugging in stream api; fixed warning in stream_big test case
authorSree Harsha Totakura <totakura@in.tum.de>
Fri, 15 Jun 2012 15:25:51 +0000 (15:25 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Fri, 15 Jun 2012 15:25:51 +0000 (15:25 +0000)
src/stream/stream_api.c
src/stream/test_stream_big.c

index 63e27ea98f5d15bd66de56943f3a34b0c16f6126..1dc1ba80e6c7ee959587aa9d2370ab238c4c0a4b 100644 (file)
@@ -470,22 +470,6 @@ struct GNUNET_STREAM_ShutdownHandle
 static unsigned int default_timeout = 10;
 
 
-/**
- * Function to print the contents of an address location. Used only for debugging
- *
- * @param ptr the address location; Should be more than 5 bytes long
- */
-static void
-debug_print_contents (const void *ptr)
-{
-  /* const char *c; */
-  
-  /* c = ptr; */
-  /* LOG (GNUNET_ERROR_TYPE_DEBUG, */
-  /*      "--- contents: %u %u %u %u %u\n", c[0], c[1], c[2], c[3], c[4]); */
-}
-
-
 /**
  * Callback function for sending queued message
  *
@@ -846,7 +830,6 @@ write_data (struct GNUNET_STREAM_Socket *socket)
            "%s: Placing DATA message with sequence %u in send queue\n",
            GNUNET_i2s (&socket->other_peer),
            ntohl (io_handle->messages[packet]->sequence_number));
-      debug_print_contents(&(io_handle->messages[packet][1]));
       copy_and_queue_message (socket,
                               &io_handle->messages[packet]->header,
                               NULL,
@@ -866,7 +849,6 @@ write_data (struct GNUNET_STREAM_Socket *socket)
          "%s: Placing DATA message with sequence %u in send queue\n",
          GNUNET_i2s (&socket->other_peer),
          ntohl (io_handle->messages[packet]->sequence_number));
-    debug_print_contents(&(io_handle->messages[packet][1]));
     copy_and_queue_message (socket,
                             &io_handle->messages[packet]->header,
                             NULL,
@@ -928,7 +910,6 @@ call_read_processor (void *cls,
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "%s: Calling read processor\n",
        GNUNET_i2s (&socket->other_peer));
-  debug_print_contents (socket->receive_buffer + socket->copy_offset);
   read_size = 
     socket->read_handle->proc (socket->read_handle->proc_cls,
                                socket->status,
@@ -1159,7 +1140,6 @@ handle_data (struct GNUNET_STREAM_Socket *socket,
       
     /* Copy Data to buffer */
     payload = &msg[1];
-    debug_print_contents(payload);
     GNUNET_assert (relative_offset + size <= socket->receive_buffer_size);
     memcpy (socket->receive_buffer + relative_offset,
             payload,
index 001c4f67eb7da0c0f98b5eb9de27bc324bdab3d8..3fd10a1c3be7150c20da9fe9673af4604e28aa92 100644 (file)
@@ -164,9 +164,9 @@ write_completion (void *cls,
     }
   else
     {
-      LOG (GNUNET_ERROR_TYPE_DEBUG,
-           "Finished writing the data; waiting for the other peer to finish"
-           "reading");
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Writing successfully finished\n");
+      result = GNUNET_OK;
+      GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
     }
 }
 
@@ -271,8 +271,7 @@ input_processor (void *cls,
   else 
   {
     /* Peer2 has completed reading*/
-    result = GNUNET_OK;
-    GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "Reading finished successfully\n");
   } 
   return size;
 }