diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-04 21:07:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-04 21:07:31 +0000 |
commit | 237a4538616beadd40d3e918ad4b6597b4eb8561 (patch) | |
tree | 0dd47c4e5eb9f55d3dc5c9ccad0b0117cb7f31ae /src/fs/fs_api.c | |
parent | bbdae1a7c4614fcd38b321c1c0ee1096ffa59686 (diff) | |
download | gnunet-237a4538616beadd40d3e918ad4b6597b4eb8561.tar.gz gnunet-237a4538616beadd40d3e918ad4b6597b4eb8561.zip |
-add priorities to download queue
Diffstat (limited to 'src/fs/fs_api.c')
-rw-r--r-- | src/fs/fs_api.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index 1df9b2e0a..64f55e344 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -145,11 +145,13 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
145 | * @param stop function to call to pause the job, or on dequeue (if the job was running) | 145 | * @param stop function to call to pause the job, or on dequeue (if the job was running) |
146 | * @param cls closure for start and stop | 146 | * @param cls closure for start and stop |
147 | * @param blocks number of blocks this jobs uses | 147 | * @param blocks number of blocks this jobs uses |
148 | * @param priority how important is this download | ||
148 | * @return queue handle | 149 | * @return queue handle |
149 | */ | 150 | */ |
150 | struct GNUNET_FS_QueueEntry * | 151 | struct GNUNET_FS_QueueEntry * |
151 | GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, | 152 | GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, |
152 | GNUNET_FS_QueueStop stop, void *cls, unsigned int blocks) | 153 | GNUNET_FS_QueueStop stop, void *cls, unsigned int blocks, |
154 | enum GNUNET_FS_QueuePriority priority) | ||
153 | { | 155 | { |
154 | struct GNUNET_FS_QueueEntry *qe; | 156 | struct GNUNET_FS_QueueEntry *qe; |
155 | 157 | ||
@@ -160,6 +162,7 @@ GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, | |||
160 | qe->cls = cls; | 162 | qe->cls = cls; |
161 | qe->queue_time = GNUNET_TIME_absolute_get (); | 163 | qe->queue_time = GNUNET_TIME_absolute_get (); |
162 | qe->blocks = blocks; | 164 | qe->blocks = blocks; |
165 | qe->priority = priority; | ||
163 | GNUNET_CONTAINER_DLL_insert_after (h->pending_head, h->pending_tail, | 166 | GNUNET_CONTAINER_DLL_insert_after (h->pending_head, h->pending_tail, |
164 | h->pending_tail, qe); | 167 | h->pending_tail, qe); |
165 | if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) | 168 | if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) |