diff options
-rw-r--r-- | src/fs/test_gnunet_service_fs_p2p.c | 22 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport.c | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c index 7b6a765d4..410666dea 100644 --- a/src/fs/test_gnunet_service_fs_p2p.c +++ b/src/fs/test_gnunet_service_fs_p2p.c | |||
@@ -36,7 +36,7 @@ | |||
36 | /** | 36 | /** |
37 | * How long until we give up on transmitting the message? | 37 | * How long until we give up on transmitting the message? |
38 | */ | 38 | */ |
39 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120) | 39 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) |
40 | 40 | ||
41 | #define NUM_DAEMONS 2 | 41 | #define NUM_DAEMONS 2 |
42 | 42 | ||
@@ -46,6 +46,8 @@ static struct GNUNET_FS_TestDaemon *daemons[NUM_DAEMONS]; | |||
46 | 46 | ||
47 | static struct GNUNET_SCHEDULER_Handle *sched; | 47 | static struct GNUNET_SCHEDULER_Handle *sched; |
48 | 48 | ||
49 | static int ok; | ||
50 | |||
49 | 51 | ||
50 | static void | 52 | static void |
51 | do_stop (void *cls, | 53 | do_stop (void *cls, |
@@ -54,10 +56,18 @@ do_stop (void *cls, | |||
54 | GNUNET_FS_TEST_daemons_stop (sched, | 56 | GNUNET_FS_TEST_daemons_stop (sched, |
55 | NUM_DAEMONS, | 57 | NUM_DAEMONS, |
56 | daemons); | 58 | daemons); |
57 | GNUNET_assert (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)); | 59 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) |
58 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 60 | { |
59 | "Finished download, shutting down\n", | 61 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
60 | (unsigned long long) FILESIZE); | 62 | "Finished download, shutting down\n", |
63 | (unsigned long long) FILESIZE); | ||
64 | } | ||
65 | else | ||
66 | { | ||
67 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
68 | "Timeout during download, shutting down with error\n"); | ||
69 | ok = 1; | ||
70 | } | ||
61 | } | 71 | } |
62 | 72 | ||
63 | 73 | ||
@@ -156,7 +166,7 @@ main (int argc, char *argv[]) | |||
156 | argvx, "test-gnunet-service-fs-p2p", | 166 | argvx, "test-gnunet-service-fs-p2p", |
157 | "nohelp", options, &run, NULL); | 167 | "nohelp", options, &run, NULL); |
158 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); | 168 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); |
159 | return 0; | 169 | return ok; |
160 | } | 170 | } |
161 | 171 | ||
162 | /* end of test_gnunet_service_fs_p2p.c */ | 172 | /* end of test_gnunet_service_fs_p2p.c */ |
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 04dbf9f20..6c0a9415c 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -3009,6 +3009,8 @@ handle_set_quota (void *cls, | |||
3009 | #endif | 3009 | #endif |
3010 | GNUNET_BANDWIDTH_tracker_update_quota (&n->in_tracker, | 3010 | GNUNET_BANDWIDTH_tracker_update_quota (&n->in_tracker, |
3011 | qsm->quota); | 3011 | qsm->quota); |
3012 | if (0 == ntohl (qsm->quota.value__)) | ||
3013 | disconnect_neighbour (n, GNUNET_NO); | ||
3012 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 3014 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
3013 | } | 3015 | } |
3014 | 3016 | ||