[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6199 - GNUnet/src/applications/fs/ecrs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6199 - GNUnet/src/applications/fs/ecrs |
Date: |
Fri, 8 Feb 2008 00:07:12 -0700 (MST) |
Author: grothoff
Date: 2008-02-08 00:07:12 -0700 (Fri, 08 Feb 2008)
New Revision: 6199
Modified:
GNUnet/src/applications/fs/ecrs/download.c
GNUnet/src/applications/fs/ecrs/downloadtest.c
GNUnet/src/applications/fs/ecrs/ecrstest.c
Log:
fixes
Modified: GNUnet/src/applications/fs/ecrs/download.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/download.c 2008-02-08 06:50:12 UTC (rev
6198)
+++ GNUnet/src/applications/fs/ecrs/download.c 2008-02-08 07:07:12 UTC (rev
6199)
@@ -883,7 +883,7 @@
if ((rm.head == NULL) &&
((rm.completed == rm.total) ||
((rm.total != rm.length) &&
- (rm.completed >= rm.length))) && (rm.abortFlag == GNUNET_NO))
+ (rm.completed >= rm.length))))
{
ret = GNUNET_OK;
}
@@ -894,7 +894,7 @@
GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
"Download ends prematurely: %d %llu == %llu %d TT: %d\n",
rm.requestListIndex,
- ctx.completed, ctx.total, rm.abortFlag, tt (ttClosure));
+ rm.completed, rm.total, rm.abortFlag, tt (ttClosure));
#endif
ret = GNUNET_SYSERR;
}
Modified: GNUnet/src/applications/fs/ecrs/downloadtest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/downloadtest.c 2008-02-08 06:50:12 UTC
(rev 6198)
+++ GNUnet/src/applications/fs/ecrs/downloadtest.c 2008-02-08 07:07:12 UTC
(rev 6199)
@@ -29,7 +29,7 @@
#include "gnunet_ecrs_lib.h"
#include "tree.h"
-#define START_DAEMONS 0
+#define START_DAEMONS 1
#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto
FAILURE; }
Modified: GNUnet/src/applications/fs/ecrs/ecrstest.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/ecrstest.c 2008-02-08 06:50:12 UTC (rev
6198)
+++ GNUnet/src/applications/fs/ecrs/ecrstest.c 2008-02-08 07:07:12 UTC (rev
6199)
@@ -29,6 +29,8 @@
#include "gnunet_ecrs_lib.h"
#include "tree.h"
+#define START_DAEMON 1
+
#define CHECK(a) if (!(a)) { ok = GNUNET_NO; GNUNET_GE_BREAK(NULL, 0); goto
FAILURE; }
static int
@@ -179,7 +181,6 @@
tmpName, 0, NULL, NULL,
&testTerminate, NULL))
{
-
fd = GNUNET_disk_file_open (NULL, tmpName, O_RDONLY);
buf = GNUNET_malloc (size);
in = GNUNET_malloc (size);
@@ -196,6 +197,10 @@
GNUNET_free (in);
CLOSE (fd);
}
+ else
+ {
+ fprintf(stderr, "? ");
+ }
UNLINK (tmpName);
GNUNET_free (tmpName);
return ret;
@@ -236,9 +241,11 @@
1024,
0
};
+#if START_DAEMON
pid_t daemon;
+#endif
int ok;
- struct GNUNET_ClientServerConnection *sock;
+ struct GNUNET_ClientServerConnection *sock = NULL;
struct GNUNET_ECRS_URI *uri;
int i;
@@ -248,14 +255,15 @@
GNUNET_GC_free (cfg);
return -1;
}
+#if START_DAEMON
daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
GNUNET_GE_ASSERT (NULL, daemon > 0);
- sock = NULL;
CHECK (GNUNET_OK ==
GNUNET_wait_for_daemon_running (NULL, cfg,
30 * GNUNET_CRON_SECONDS));
+ GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS); /* give apps time to
start */
+#endif
ok = GNUNET_YES;
- GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS); /* give apps time to
start */
sock = GNUNET_client_connection_create (NULL, cfg);
CHECK (sock != NULL);
@@ -263,14 +271,14 @@
i = 0;
while (filesizes[i] != 0)
{
- fprintf (stderr, "Testing filesize %u", filesizes[i]);
+ fprintf (stderr, "Testing filesize %u ", filesizes[i]);
uri = uploadFile (filesizes[i]);
CHECK (NULL != uri);
CHECK (GNUNET_OK == searchFile (&uri));
CHECK (GNUNET_OK == downloadFile (filesizes[i], uri));
GNUNET_ECRS_uri_destroy (uri);
CHECK (GNUNET_OK == unindexFile (filesizes[i]));
- fprintf (stderr, " Ok.\n");
+ fprintf (stderr, "Ok.\n");
i++;
}
@@ -278,7 +286,9 @@
FAILURE:
if (sock != NULL)
GNUNET_client_connection_destroy (sock);
+#if START_DAEMON
GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+#endif
GNUNET_GC_free (cfg);
return (ok == GNUNET_YES) ? 0 : 1;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6199 - GNUnet/src/applications/fs/ecrs,
gnunet <=