diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-10-21 10:56:44 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-10-21 10:56:44 +0900 |
commit | 35068004d96e7d6b1d6548a6bcc2592970c5603d (patch) | |
tree | 4054d65548919948821fe71369e73f11b19488cc /src/zonemaster/gnunet-service-zonemaster.c | |
parent | 23d5c0716781f2f6720e3c549cc662e70ad78b17 (diff) | |
download | gnunet-35068004d96e7d6b1d6548a6bcc2592970c5603d.tar.gz gnunet-35068004d96e7d6b1d6548a6bcc2592970c5603d.zip |
-minor optimization
Diffstat (limited to 'src/zonemaster/gnunet-service-zonemaster.c')
-rw-r--r-- | src/zonemaster/gnunet-service-zonemaster.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c index 0413fff32..4cf5e690a 100644 --- a/src/zonemaster/gnunet-service-zonemaster.c +++ b/src/zonemaster/gnunet-service-zonemaster.c | |||
@@ -911,17 +911,17 @@ initiate_put_from_pipe_trigger (void *cls) | |||
911 | nf_count = GNUNET_DISK_file_read (np_fh, buf, sizeof (buf)); | 911 | nf_count = GNUNET_DISK_file_read (np_fh, buf, sizeof (buf)); |
912 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %lld notifications from pipe\n", | 912 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %lld notifications from pipe\n", |
913 | (long long) nf_count); | 913 | (long long) nf_count); |
914 | for (int i = 0; i < nf_count; i++) | 914 | while (true) |
915 | { | 915 | { |
916 | GNUNET_assert (0 == pthread_mutex_lock (&results_lock)); | 916 | GNUNET_assert (0 == pthread_mutex_lock (&results_lock)); |
917 | job = results_head; | 917 | if (NULL == results_head) |
918 | if (NULL == job) | ||
919 | { | 918 | { |
920 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 919 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
921 | "Hmm... no results. Back to sleep.\n"); | 920 | "No more results. Back to sleep.\n"); |
922 | GNUNET_assert (0 == pthread_mutex_unlock (&results_lock)); | 921 | GNUNET_assert (0 == pthread_mutex_unlock (&results_lock)); |
923 | return; | 922 | return; |
924 | } | 923 | } |
924 | job = results_head; | ||
925 | GNUNET_CONTAINER_DLL_remove (results_head, results_tail, job); | 925 | GNUNET_CONTAINER_DLL_remove (results_head, results_tail, job); |
926 | GNUNET_assert (0 == pthread_mutex_unlock (&results_lock)); | 926 | GNUNET_assert (0 == pthread_mutex_unlock (&results_lock)); |
927 | GNUNET_GNSRECORD_query_from_private_key (&job->zone, | 927 | GNUNET_GNSRECORD_query_from_private_key (&job->zone, |
@@ -956,7 +956,6 @@ initiate_put_from_pipe_trigger (void *cls) | |||
956 | refresh_block (job->block_priv); | 956 | refresh_block (job->block_priv); |
957 | free_job (job); | 957 | free_job (job); |
958 | } | 958 | } |
959 | return; | ||
960 | } | 959 | } |
961 | 960 | ||
962 | 961 | ||