#include "gnunet_disk_lib.h"
#include <gcrypt.h>
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
/**
* Hash block of given size.
*/
GNUNET_SCHEDULER_TaskIdentifier task;
+ /**
+ * Priority we use.
+ */
+ enum GNUNET_SCHEDULER_Priority priority;
+
/**
* Blocksize.
*/
delta = fhc->fsize - fhc->offset;
if (delta != GNUNET_DISK_file_read (fhc->fh, fhc->buffer, delta))
{
- GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "read", fhc->filename);
+ LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "read", fhc->filename);
file_hash_finish (fhc, NULL);
return;
}
file_hash_finish (fhc, res);
return;
}
- fhc->task = GNUNET_SCHEDULER_add_now (&file_hash_task, fhc);
+ fhc->task = GNUNET_SCHEDULER_add_with_priority (fhc->priority,
+ &file_hash_task, fhc);
}
GNUNET_free (fhc);
return NULL;
}
+ fhc->priority = priority;
fhc->task =
GNUNET_SCHEDULER_add_with_priority (priority, &file_hash_task, fhc);
return fhc;