gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5062 - GNUnet/src/applications/gap


From: gnunet
Subject: [GNUnet-SVN] r5062 - GNUnet/src/applications/gap
Date: Fri, 15 Jun 2007 16:57:03 -0600 (MDT)

Author: grothoff
Date: 2007-06-15 16:57:03 -0600 (Fri, 15 Jun 2007)
New Revision: 5062

Modified:
   GNUnet/src/applications/gap/gaptest.c
   GNUnet/src/applications/gap/gaptest2.c
   GNUnet/src/applications/gap/gaptest3.c
Log:
show progress

Modified: GNUnet/src/applications/gap/gaptest.c
===================================================================
--- GNUnet/src/applications/gap/gaptest.c       2007-06-15 22:56:44 UTC (rev 
5061)
+++ GNUnet/src/applications/gap/gaptest.c       2007-06-15 22:57:03 UTC (rev 
5062)
@@ -42,6 +42,27 @@
   return OK;
 }
 
+
+static void uprogress(unsigned long long totalBytes,
+                     unsigned long long completedBytes,
+                     cron_t eta,
+                     void * closure) {
+  fprintf(stderr,
+         totalBytes == completedBytes ? "\n" : ".");
+}
+
+static void dprogress(unsigned long long totalBytes,
+                     unsigned long long completedBytes,
+                     cron_t eta,
+                     unsigned long long lastBlockOffset,
+                     const char * lastBlock,
+                     unsigned int lastBlockSize,
+                     void * closure) {
+  fprintf(stderr,
+         totalBytes == completedBytes ? "\n" : ".");
+}
+
+
 static char * makeName(unsigned int i) {
   char * fn;
 
@@ -82,7 +103,7 @@
                        0, /* anon */
                        0, /* prio */
                        get_time() + 10 * cronMINUTES, /* expire */
-                       NULL, /* progress */
+                       &uprogress, 
                        NULL,
                        &testTerminate,
                        NULL,
@@ -128,9 +149,10 @@
   char * tmp;
 
   tmp = ECRS_uriToString(fi->uri);
-  GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-      "Search found URI `%s'\n",
-      tmp);
+  GE_LOG(ectx,
+        GE_DEBUG | GE_REQUEST | GE_USER,
+        "Search found URI `%s'\n",
+        tmp);
   FREE(tmp);
   GE_ASSERT(ectx, NULL == *my);
   *my = ECRS_dupUri(fi->uri);
@@ -187,8 +209,8 @@
                              uri,
                              tmpName,
                              0,
+                             &dprogress,
                              NULL,
-                             NULL,
                              &testTerminate,
                              NULL)) {
 

Modified: GNUnet/src/applications/gap/gaptest2.c
===================================================================
--- GNUnet/src/applications/gap/gaptest2.c      2007-06-15 22:56:44 UTC (rev 
5061)
+++ GNUnet/src/applications/gap/gaptest2.c      2007-06-15 22:57:03 UTC (rev 
5062)
@@ -20,7 +20,7 @@
 
 /**
  * @file applications/gap/gaptest2.c
- * @brief GAP routing testcase
+ * @brief GAP routing testcase, linear topology
  * @author Christian Grothoff
  */
 
@@ -49,6 +49,25 @@
   return OK;
 }
 
+static void uprogress(unsigned long long totalBytes,
+                     unsigned long long completedBytes,
+                     cron_t eta,
+                     void * closure) {
+  fprintf(stderr,
+         totalBytes == completedBytes ? "\n" : ".");
+}
+
+static void dprogress(unsigned long long totalBytes,
+                     unsigned long long completedBytes,
+                     cron_t eta,
+                     unsigned long long lastBlockOffset,
+                     const char * lastBlock,
+                     unsigned int lastBlockSize,
+                     void * closure) {
+  fprintf(stderr,
+         totalBytes == completedBytes ? "\n" : ".");
+}
+
 static char * makeName(unsigned int i) {
   char * fn;
 
@@ -89,7 +108,7 @@
                        1, /* anon */
                        0, /* prio */
                        get_time() + 100 * cronMINUTES, /* expire */
-                       NULL, /* progress */
+                       &uprogress, /* progress */
                        NULL,
                        &testTerminate,
                        NULL,
@@ -194,8 +213,8 @@
                              uri,
                              tmpName,
                              1,
+                             &dprogress,
                              NULL,
-                             NULL,
                              &testTerminate,
                              NULL)) {
 
@@ -303,6 +322,7 @@
   CHECK(OK == searchFile(&uri));
   printf("Search successful!\n");
   start = get_time();
+  printf("Downloading...\n");
   CHECK(OK == downloadFile(SIZE, uri));
   printf("Download successful at %llu kbps!\n",
         (SIZE / 1024) / ((get_time() - start) / cronSECONDS));

Modified: GNUnet/src/applications/gap/gaptest3.c
===================================================================
--- GNUnet/src/applications/gap/gaptest3.c      2007-06-15 22:56:44 UTC (rev 
5061)
+++ GNUnet/src/applications/gap/gaptest3.c      2007-06-15 22:57:03 UTC (rev 
5062)
@@ -20,7 +20,7 @@
 
 /**
  * @file applications/gap/gaptest3.c
- * @brief GAP economy testcase
+ * @brief GAP economy testcase, download from star topology
  * @author Christian Grothoff
  */
 
@@ -49,6 +49,25 @@
   return OK;
 }
 
+static void uprogress(unsigned long long totalBytes,
+                     unsigned long long completedBytes,
+                     cron_t eta,
+                     void * closure) {
+  fprintf(stderr,
+         totalBytes == completedBytes ? "\n" : ".");
+}
+
+static void dprogress(unsigned long long totalBytes,
+                     unsigned long long completedBytes,
+                     cron_t eta,
+                     unsigned long long lastBlockOffset,
+                     const char * lastBlock,
+                     unsigned int lastBlockSize,
+                     void * closure) {
+  fprintf(stderr,
+         totalBytes == completedBytes ? "\n" : ".");
+}
+
 static char * makeName(unsigned int i) {
   char * fn;
 
@@ -89,7 +108,7 @@
                        1, /* anon */
                        0, /* prio */
                        get_time() + 100 * cronMINUTES, /* expire */
-                       NULL, /* progress */
+                       &uprogress,
                        NULL,
                        &testTerminate,
                        NULL,
@@ -123,8 +142,8 @@
                              uri,
                              tmpName,
                              1,
+                             &dprogress,
                              NULL,
-                             NULL,
                              &testTerminate,
                              NULL)) {
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]