diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2017-12-05 17:27:33 +0100 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2017-12-05 17:27:33 +0100 |
commit | 9e486ede076d2139b1c655411ce9560d9baf6984 (patch) | |
tree | 835e5af826a8c8cc6c61351b22836f0c5579beba /src | |
parent | 6e0922fc29b7bf481bf97c6ed269f85eadadd43e (diff) | |
parent | 513c56ddcbe02e9b8469a592cae142d93d068bc8 (diff) | |
download | gnunet-9e486ede076d2139b1c655411ce9560d9baf6984.tar.gz gnunet-9e486ede076d2139b1c655411ce9560d9baf6984.zip |
Merge remote-tracking branch 'origin/master' into identity_abe
Diffstat (limited to 'src')
-rw-r--r-- | src/cadet/gnunet-service-cadet_paths.c | 5 | ||||
-rw-r--r-- | src/gns/gnunet-gns-proxy.c | 18 | ||||
-rw-r--r-- | src/set/gnunet-service-set_union.c | 7 | ||||
-rw-r--r-- | src/set/gnunet-service-set_union_strata_estimator.c | 6 |
4 files changed, 23 insertions, 13 deletions
diff --git a/src/cadet/gnunet-service-cadet_paths.c b/src/cadet/gnunet-service-cadet_paths.c index 79eed0dcc..7b90fe152 100644 --- a/src/cadet/gnunet-service-cadet_paths.c +++ b/src/cadet/gnunet-service-cadet_paths.c | |||
@@ -179,7 +179,7 @@ GCPP_del_connection (struct CadetPeerPath *path, | |||
179 | GCC_2s (cc), | 179 | GCC_2s (cc), |
180 | GCPP_2s (path), | 180 | GCPP_2s (path), |
181 | off); | 181 | off); |
182 | GNUNET_assert (off < path->entries_length); /* FIXME: This assertion fails sometimes! */ | 182 | GNUNET_assert (off < path->entries_length); /* FIXME: #4909: This assertion fails sometimes! */ |
183 | entry = path->entries[off]; | 183 | entry = path->entries[off]; |
184 | GNUNET_assert (cc == entry->cc); | 184 | GNUNET_assert (cc == entry->cc); |
185 | entry->cc = NULL; | 185 | entry->cc = NULL; |
@@ -428,13 +428,14 @@ extend_path (struct CadetPeerPath *path, | |||
428 | 428 | ||
429 | path->entries_length = old_len + i + 1; | 429 | path->entries_length = old_len + i + 1; |
430 | recalculate_path_desirability (path); | 430 | recalculate_path_desirability (path); |
431 | if (NULL != entry->cc) | ||
432 | force = GNUNET_YES; | ||
431 | path->hn = GCP_attach_path (peers[i], | 433 | path->hn = GCP_attach_path (peers[i], |
432 | path, | 434 | path, |
433 | old_len + (unsigned int) i, | 435 | old_len + (unsigned int) i, |
434 | force); | 436 | force); |
435 | if (NULL != path->hn) | 437 | if (NULL != path->hn) |
436 | break; | 438 | break; |
437 | GNUNET_assert (NULL == entry->cc); | ||
438 | GCP_path_entry_remove (entry->peer, | 439 | GCP_path_entry_remove (entry->peer, |
439 | entry, | 440 | entry, |
440 | old_len + i); | 441 | old_len + i); |
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 2a6de1c30..3af571eba 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c | |||
@@ -786,6 +786,8 @@ cleanup_s5r (struct Socks5Request *s5r) | |||
786 | 786 | ||
787 | /* ************************* HTTP handling with cURL *********************** */ | 787 | /* ************************* HTTP handling with cURL *********************** */ |
788 | 788 | ||
789 | static void | ||
790 | curl_download_prepare (); | ||
789 | 791 | ||
790 | /** | 792 | /** |
791 | * Callback for MHD response generation. This function is called from | 793 | * Callback for MHD response generation. This function is called from |
@@ -824,6 +826,11 @@ mhd_content_cb (void *cls, | |||
824 | { | 826 | { |
825 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 827 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
826 | "Pausing MHD download, no data available\n"); | 828 | "Pausing MHD download, no data available\n"); |
829 | if (NULL != s5r->curl) | ||
830 | { | ||
831 | curl_easy_pause (s5r->curl, CURLPAUSE_CONT); | ||
832 | curl_download_prepare (); | ||
833 | } | ||
827 | return 0; /* more data later */ | 834 | return 0; /* more data later */ |
828 | } | 835 | } |
829 | if ( (0 == bytes_to_copy) && | 836 | if ( (0 == bytes_to_copy) && |
@@ -833,6 +840,8 @@ mhd_content_cb (void *cls, | |||
833 | "Completed MHD download\n"); | 840 | "Completed MHD download\n"); |
834 | return MHD_CONTENT_READER_END_OF_STREAM; | 841 | return MHD_CONTENT_READER_END_OF_STREAM; |
835 | } | 842 | } |
843 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
844 | "Writing %lu/%lu bytes\n", bytes_to_copy, s5r->io_len); | ||
836 | GNUNET_memcpy (buf, s5r->io_buf, bytes_to_copy); | 845 | GNUNET_memcpy (buf, s5r->io_buf, bytes_to_copy); |
837 | memmove (s5r->io_buf, | 846 | memmove (s5r->io_buf, |
838 | &s5r->io_buf[bytes_to_copy], | 847 | &s5r->io_buf[bytes_to_copy], |
@@ -865,7 +874,7 @@ check_ssl_certificate (struct Socks5Request *s5r) | |||
865 | const char *name; | 874 | const char *name; |
866 | 875 | ||
867 | s5r->ssl_checked = GNUNET_YES; | 876 | s5r->ssl_checked = GNUNET_YES; |
868 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 877 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
869 | "Checking SSL certificate\n"); | 878 | "Checking SSL certificate\n"); |
870 | if (CURLE_OK != | 879 | if (CURLE_OK != |
871 | curl_easy_getinfo (s5r->curl, | 880 | curl_easy_getinfo (s5r->curl, |
@@ -1249,7 +1258,8 @@ curl_download_cb (void *ptr, size_t size, size_t nmemb, void* ctx) | |||
1249 | if (sizeof (s5r->io_buf) - s5r->io_len < total) | 1258 | if (sizeof (s5r->io_buf) - s5r->io_len < total) |
1250 | { | 1259 | { |
1251 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1260 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1252 | "Pausing CURL download, not enough space\n"); | 1261 | "Pausing CURL download, not enough space %lu %lu %lu\n", sizeof (s5r->io_buf), |
1262 | s5r->io_len, total); | ||
1253 | return CURL_WRITEFUNC_PAUSE; /* not enough space */ | 1263 | return CURL_WRITEFUNC_PAUSE; /* not enough space */ |
1254 | } | 1264 | } |
1255 | GNUNET_memcpy (&s5r->io_buf[s5r->io_len], | 1265 | GNUNET_memcpy (&s5r->io_buf[s5r->io_len], |
@@ -1833,7 +1843,7 @@ mhd_completed_cb (void *cls, | |||
1833 | for (header = s5r->header_head; header != NULL; header = s5r->header_head) | 1843 | for (header = s5r->header_head; header != NULL; header = s5r->header_head) |
1834 | { | 1844 | { |
1835 | GNUNET_CONTAINER_DLL_remove (s5r->header_head, | 1845 | GNUNET_CONTAINER_DLL_remove (s5r->header_head, |
1836 | s5r->header_head, | 1846 | s5r->header_tail, |
1837 | header); | 1847 | header); |
1838 | GNUNET_free (header->type); | 1848 | GNUNET_free (header->type); |
1839 | GNUNET_free (header->value); | 1849 | GNUNET_free (header->value); |
@@ -2414,6 +2424,8 @@ do_write (void *cls) | |||
2414 | if (len <= 0) | 2424 | if (len <= 0) |
2415 | { | 2425 | { |
2416 | /* write error: connection closed, shutdown, etc.; just clean up */ | 2426 | /* write error: connection closed, shutdown, etc.; just clean up */ |
2427 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
2428 | "Write Error\n"); | ||
2417 | cleanup_s5r (s5r); | 2429 | cleanup_s5r (s5r); |
2418 | return; | 2430 | return; |
2419 | } | 2431 | } |
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c index b2983545f..730124495 100644 --- a/src/set/gnunet-service-set_union.c +++ b/src/set/gnunet-service-set_union.c | |||
@@ -739,11 +739,10 @@ get_order_from_difference (unsigned int diff) | |||
739 | unsigned int ibf_order; | 739 | unsigned int ibf_order; |
740 | 740 | ||
741 | ibf_order = 2; | 741 | ibf_order = 2; |
742 | while ( (1<<ibf_order) < (IBF_ALPHA * diff) || | 742 | while ( ( (1<<ibf_order) < (IBF_ALPHA * diff) || |
743 | ((1<<ibf_order) < SE_IBF_HASH_NUM) ) | 743 | ((1<<ibf_order) < SE_IBF_HASH_NUM) ) && |
744 | (ibf_order < MAX_IBF_ORDER) ) | ||
744 | ibf_order++; | 745 | ibf_order++; |
745 | if (ibf_order > MAX_IBF_ORDER) | ||
746 | ibf_order = MAX_IBF_ORDER; | ||
747 | // add one for correction | 746 | // add one for correction |
748 | return ibf_order + 1; | 747 | return ibf_order + 1; |
749 | } | 748 | } |
diff --git a/src/set/gnunet-service-set_union_strata_estimator.c b/src/set/gnunet-service-set_union_strata_estimator.c index e3d6bfaec..0bd22c92e 100644 --- a/src/set/gnunet-service-set_union_strata_estimator.c +++ b/src/set/gnunet-service-set_union_strata_estimator.c | |||
@@ -228,21 +228,19 @@ unsigned int | |||
228 | strata_estimator_difference (const struct StrataEstimator *se1, | 228 | strata_estimator_difference (const struct StrataEstimator *se1, |
229 | const struct StrataEstimator *se2) | 229 | const struct StrataEstimator *se2) |
230 | { | 230 | { |
231 | int i; | ||
232 | unsigned int count; | 231 | unsigned int count; |
233 | 232 | ||
234 | GNUNET_assert (se1->strata_count == se2->strata_count); | 233 | GNUNET_assert (se1->strata_count == se2->strata_count); |
235 | count = 0; | 234 | count = 0; |
236 | for (i = se1->strata_count - 1; i >= 0; i--) | 235 | for (int i = se1->strata_count - 1; i >= 0; i--) |
237 | { | 236 | { |
238 | struct InvertibleBloomFilter *diff; | 237 | struct InvertibleBloomFilter *diff; |
239 | /* number of keys decoded from the ibf */ | 238 | /* number of keys decoded from the ibf */ |
240 | int ibf_count; | ||
241 | 239 | ||
242 | /* FIXME: implement this without always allocating new IBFs */ | 240 | /* FIXME: implement this without always allocating new IBFs */ |
243 | diff = ibf_dup (se1->strata[i]); | 241 | diff = ibf_dup (se1->strata[i]); |
244 | ibf_subtract (diff, se2->strata[i]); | 242 | ibf_subtract (diff, se2->strata[i]); |
245 | for (ibf_count = 0; GNUNET_YES; ibf_count++) | 243 | for (int ibf_count = 0; GNUNET_YES; ibf_count++) |
246 | { | 244 | { |
247 | int more; | 245 | int more; |
248 | 246 | ||