aboutsummaryrefslogtreecommitdiff
path: root/src/gns
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-08-03 18:32:45 +0000
committerChristian Grothoff <christian@grothoff.org>2012-08-03 18:32:45 +0000
commit2e083d3d883081dc293a23d49a0cc287ac6be3b3 (patch)
treefc0631d457f331b63a75e26161f9aa75227b19d2 /src/gns
parent5348ed91bc946c5d4c01438c320f5af23c71d7b2 (diff)
downloadgnunet-2e083d3d883081dc293a23d49a0cc287ac6be3b3.tar.gz
gnunet-2e083d3d883081dc293a23d49a0cc287ac6be3b3.zip
better style
Diffstat (limited to 'src/gns')
-rw-r--r--src/gns/gnunet-gns-proxy.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 2453cd9d3..6b4a1c0d5 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1002,9 +1002,9 @@ mhd_content_free (void *cls,
1002 const struct GNUNET_SCHEDULER_TaskContext *tc) 1002 const struct GNUNET_SCHEDULER_TaskContext *tc)
1003{ 1003{
1004 struct ProxyCurlTask *ctask = cls; 1004 struct ProxyCurlTask *ctask = cls;
1005 struct ProxyUploadData *pdata = ctask->upload_data_head; 1005 struct ProxyUploadData *pdata;
1006 GNUNET_assert (NULL == ctask->pp_match_head);
1007 1006
1007 GNUNET_assert (NULL == ctask->pp_match_head);
1008 if (NULL != ctask->headers) 1008 if (NULL != ctask->headers)
1009 curl_slist_free_all (ctask->headers); 1009 curl_slist_free_all (ctask->headers);
1010 1010
@@ -1017,7 +1017,7 @@ mhd_content_free (void *cls,
1017 if (NULL != ctask->post_handler) 1017 if (NULL != ctask->post_handler)
1018 MHD_destroy_post_processor (ctask->post_handler); 1018 MHD_destroy_post_processor (ctask->post_handler);
1019 1019
1020 for (; pdata != NULL; pdata = ctask->upload_data_head) 1020 for (pdata = ctask->upload_data_head;; NULL != pdata; pdata = ctask->upload_data_head)
1021 { 1021 {
1022 GNUNET_CONTAINER_DLL_remove (ctask->upload_data_head, 1022 GNUNET_CONTAINER_DLL_remove (ctask->upload_data_head,
1023 ctask->upload_data_tail, 1023 ctask->upload_data_tail,
@@ -1028,8 +1028,6 @@ mhd_content_free (void *cls,
1028 GNUNET_free_non_null (pdata->value); 1028 GNUNET_free_non_null (pdata->value);
1029 GNUNET_free (pdata); 1029 GNUNET_free (pdata);
1030 } 1030 }
1031
1032
1033 GNUNET_free (ctask); 1031 GNUNET_free (ctask);
1034} 1032}
1035 1033
@@ -1050,7 +1048,7 @@ mhd_content_cb (void *cls,
1050 size_t max) 1048 size_t max)
1051{ 1049{
1052 struct ProxyCurlTask *ctask = cls; 1050 struct ProxyCurlTask *ctask = cls;
1053 struct ProxyREMatch *re_match = ctask->pp_match_head; 1051 struct ProxyREMatch *re_match;
1054 ssize_t copied = 0; 1052 ssize_t copied = 0;
1055 long long int bytes_to_copy = ctask->buffer_write_ptr - ctask->buffer_read_ptr; 1053 long long int bytes_to_copy = ctask->buffer_write_ptr - ctask->buffer_read_ptr;
1056 1054
@@ -1091,7 +1089,7 @@ mhd_content_cb (void *cls,
1091 return 0; 1089 return 0;
1092 1090
1093 copied = 0; 1091 copied = 0;
1094 for (; NULL != re_match; re_match = ctask->pp_match_head) 1092 for (re_match = ctask->pp_match_head; NULL != re_match; re_match = ctask->pp_match_head)
1095 { 1093 {
1096 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1094 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1097 "MHD: Processing PP %s\n", 1095 "MHD: Processing PP %s\n",
@@ -1194,6 +1192,7 @@ mhd_content_cb (void *cls,
1194 return copied; 1192 return copied;
1195} 1193}
1196 1194
1195
1197/** 1196/**
1198 * Shorten result callback 1197 * Shorten result callback
1199 * 1198 *
@@ -1594,8 +1593,7 @@ curl_task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1594 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1593 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1595 "Running curl tasks: %d\n", running); 1594 "Running curl tasks: %d\n", running);
1596 1595
1597 ctask = ctasks_head; 1596 for (ctask = ctasks_head; NULL != ctask; ctask = ctask->next)
1598 for (; ctask != NULL; ctask = ctask->next)
1599 { 1597 {
1600 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1598 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1601 "CTask: %s\n", ctask->url); 1599 "CTask: %s\n", ctask->url);
@@ -1610,7 +1608,7 @@ curl_task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1610 1608
1611 do 1609 do
1612 { 1610 {
1613 ctask = ctasks_head; 1611
1614 msg = curl_multi_info_read (curl_multi, &msgnum); 1612 msg = curl_multi_info_read (curl_multi, &msgnum);
1615 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1613 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1616 "Messages left: %d\n", msgnum); 1614 "Messages left: %d\n", msgnum);
@@ -1626,7 +1624,7 @@ curl_task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1626 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1624 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1627 "Download curl failed"); 1625 "Download curl failed");
1628 1626
1629 for (; ctask != NULL; ctask = ctask->next) 1627 for (ctask = ctasks_head; NULL != ctask; ctask = ctask->next)
1630 { 1628 {
1631 if (NULL == ctask->curl) 1629 if (NULL == ctask->curl)
1632 continue; 1630 continue;
@@ -1660,7 +1658,7 @@ curl_task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1660 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1658 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1661 "CURL: download completed.\n"); 1659 "CURL: download completed.\n");
1662 1660
1663 for (; ctask != NULL; ctask = ctask->next) 1661 for (ctask = ctasks_head; NULL != ctask; ctask = ctask->next)
1664 { 1662 {
1665 if (NULL == ctask->curl) 1663 if (NULL == ctask->curl)
1666 continue; 1664 continue;
@@ -1706,7 +1704,7 @@ curl_task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1706 } 1704 }
1707 } while (msgnum > 0); 1705 } while (msgnum > 0);
1708 1706
1709 for (ctask=clean_head; ctask != NULL; ctask = ctask->next) 1707 for (ctask=clean_head; NULL != ctask; ctask = ctask->next)
1710 { 1708 {
1711 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1709 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1712 "CURL: Removing task %s.\n", ctask->url); 1710 "CURL: Removing task %s.\n", ctask->url);
@@ -1716,7 +1714,7 @@ curl_task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1716 } 1714 }
1717 1715
1718 num_ctasks=0; 1716 num_ctasks=0;
1719 for (ctask=ctasks_head; ctask != NULL; ctask = ctask->next) 1717 for (ctask=ctasks_head; NULL != ctask; ctask = ctask->next)
1720 { 1718 {
1721 num_ctasks++; 1719 num_ctasks++;
1722 } 1720 }
@@ -1740,6 +1738,7 @@ curl_task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1740 curl_download_prepare(); 1738 curl_download_prepare();
1741} 1739}
1742 1740
1741
1743/** 1742/**
1744 * Process LEHO lookup 1743 * Process LEHO lookup
1745 * 1744 *