aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-05 20:23:14 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-05 20:23:14 +0100
commite2343119b99559b78a2ba727b2c07240c18476ac (patch)
tree881771459e31937171b1ba7c9261bb393aed4047
parentec9269fd94cda7b2195dcbe754eda053288478b7 (diff)
parent70017fcfb707104555107e07df5dffd1508ca7fe (diff)
downloadgnunet-e2343119b99559b78a2ba727b2c07240c18476ac.tar.gz
gnunet-e2343119b99559b78a2ba727b2c07240c18476ac.zip
Merge branch 'master' of git+ssh://gnunet.org/gnunet
-rw-r--r--src/gns/gnunet-service-gns_resolver.c38
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c12
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c47
-rw-r--r--src/transport/plugin_transport_udp.c6
-rw-r--r--src/util/common_logging.c54
5 files changed, 108 insertions, 49 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index e14a05d45..5bf443267 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -327,7 +327,7 @@ struct GNS_ResolverHandle
327 /** 327 /**
328 * ID of a task associated with the resolution process. 328 * ID of a task associated with the resolution process.
329 */ 329 */
330 struct GNUNET_SCHEDULER_Task * task_id; 330 struct GNUNET_SCHEDULER_Task *task_id;
331 331
332 /** 332 /**
333 * The name to resolve 333 * The name to resolve
@@ -808,10 +808,10 @@ recursive_resolution (void *cls);
808 * Begin the resolution process from 'name', starting with 808 * Begin the resolution process from 'name', starting with
809 * the identification of the zone specified by 'name'. 809 * the identification of the zone specified by 'name'.
810 * 810 *
811 * @param rh resolution to perform 811 * @param cls closure with `struct GNS_ResolverHandle *rh`
812 */ 812 */
813static void 813static void
814start_resolver_lookup (struct GNS_ResolverHandle *rh); 814start_resolver_lookup (void *cls);
815 815
816 816
817/** 817/**
@@ -835,6 +835,7 @@ dns_result_parser (void *cls,
835 unsigned int rd_count; 835 unsigned int rd_count;
836 unsigned int i; 836 unsigned int i;
837 837
838 (void) rs;
838 rh->dns_request = NULL; 839 rh->dns_request = NULL;
839 GNUNET_SCHEDULER_cancel (rh->task_id); 840 GNUNET_SCHEDULER_cancel (rh->task_id);
840 rh->task_id = NULL; 841 rh->task_id = NULL;
@@ -859,7 +860,8 @@ dns_result_parser (void *cls,
859 GNUNET_free (rh->name); 860 GNUNET_free (rh->name);
860 rh->name = GNUNET_strdup (p->answers[0].data.hostname); 861 rh->name = GNUNET_strdup (p->answers[0].data.hostname);
861 rh->name_resolution_pos = strlen (rh->name); 862 rh->name_resolution_pos = strlen (rh->name);
862 start_resolver_lookup (rh); 863 rh->task_id = GNUNET_SCHEDULER_add_now (&start_resolver_lookup,
864 rh);
863 GNUNET_DNSPARSER_free_packet (p); 865 GNUNET_DNSPARSER_free_packet (p);
864 return; 866 return;
865 } 867 }
@@ -1141,7 +1143,8 @@ handle_gns_cname_result (struct GNS_ResolverHandle *rh,
1141 GNUNET_free (rh->name); 1143 GNUNET_free (rh->name);
1142 rh->name = GNUNET_strdup (cname); 1144 rh->name = GNUNET_strdup (cname);
1143 rh->name_resolution_pos = strlen (rh->name); 1145 rh->name_resolution_pos = strlen (rh->name);
1144 start_resolver_lookup (rh); 1146 rh->task_id = GNUNET_SCHEDULER_add_now (&start_resolver_lookup,
1147 rh);
1145} 1148}
1146 1149
1147 1150
@@ -1839,7 +1842,9 @@ handle_gns_resolution_result (void *cls,
1839 g2dc->rh->options = GNUNET_GNS_LO_DEFAULT; 1842 g2dc->rh->options = GNUNET_GNS_LO_DEFAULT;
1840 g2dc->rh->loop_limiter = rh->loop_limiter + 1; 1843 g2dc->rh->loop_limiter = rh->loop_limiter + 1;
1841 rh->g2dc = g2dc; 1844 rh->g2dc = g2dc;
1842 start_resolver_lookup (g2dc->rh); 1845 g2dc->rh->task_id
1846 = GNUNET_SCHEDULER_add_now (&start_resolver_lookup,
1847 g2dc->rh);
1843 return; 1848 return;
1844 } 1849 }
1845 case GNUNET_DNSPARSER_TYPE_CNAME: 1850 case GNUNET_DNSPARSER_TYPE_CNAME:
@@ -1893,7 +1898,7 @@ namecache_cache_continuation (void *cls,
1893 struct CacheOps *co = cls; 1898 struct CacheOps *co = cls;
1894 1899
1895 co->namecache_qe_cache = NULL; 1900 co->namecache_qe_cache = NULL;
1896 if (NULL != emsg) 1901 if (GNUNET_OK != success)
1897 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1902 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1898 _("Failed to cache GNS resolution: %s\n"), 1903 _("Failed to cache GNS resolution: %s\n"),
1899 emsg); 1904 emsg);
@@ -1930,13 +1935,21 @@ handle_dht_response (void *cls,
1930 const struct GNUNET_PeerIdentity *put_path, 1935 const struct GNUNET_PeerIdentity *put_path,
1931 unsigned int put_path_length, 1936 unsigned int put_path_length,
1932 enum GNUNET_BLOCK_Type type, 1937 enum GNUNET_BLOCK_Type type,
1933 size_t size, const void *data) 1938 size_t size,
1939 const void *data)
1934{ 1940{
1935 struct GNS_ResolverHandle *rh = cls; 1941 struct GNS_ResolverHandle *rh = cls;
1936 struct AuthorityChain *ac = rh->ac_tail; 1942 struct AuthorityChain *ac = rh->ac_tail;
1937 const struct GNUNET_GNSRECORD_Block *block; 1943 const struct GNUNET_GNSRECORD_Block *block;
1938 struct CacheOps *co; 1944 struct CacheOps *co;
1939 1945
1946 (void) exp;
1947 (void) key;
1948 (void) get_path;
1949 (void) get_path_length;
1950 (void) put_path;
1951 (void) put_path_length;
1952 (void) type;
1940 GNUNET_DHT_get_stop (rh->get_handle); 1953 GNUNET_DHT_get_stop (rh->get_handle);
1941 rh->get_handle = NULL; 1954 rh->get_handle = NULL;
1942 GNUNET_CONTAINER_heap_remove_node (rh->dht_heap_node); 1955 GNUNET_CONTAINER_heap_remove_node (rh->dht_heap_node);
@@ -2239,16 +2252,18 @@ recursive_resolution (void *cls)
2239 * Begin the resolution process from 'name', starting with 2252 * Begin the resolution process from 'name', starting with
2240 * the identification of the zone specified by 'name'. 2253 * the identification of the zone specified by 'name'.
2241 * 2254 *
2242 * @param rh resolution to perform 2255 * @param cls the `struct GNS_ResolverHandle`
2243 */ 2256 */
2244static void 2257static void
2245start_resolver_lookup (struct GNS_ResolverHandle *rh) 2258start_resolver_lookup (void *cls)
2246{ 2259{
2260 struct GNS_ResolverHandle *rh = cls;
2247 struct AuthorityChain *ac; 2261 struct AuthorityChain *ac;
2248 char *y; 2262 char *y;
2249 struct in_addr v4; 2263 struct in_addr v4;
2250 struct in6_addr v6; 2264 struct in6_addr v6;
2251 2265
2266 rh->task_id = NULL;
2252 if (1 == inet_pton (AF_INET, 2267 if (1 == inet_pton (AF_INET,
2253 rh->name, 2268 rh->name,
2254 &v4)) 2269 &v4))
@@ -2388,7 +2403,8 @@ GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
2388 rh->record_type = record_type; 2403 rh->record_type = record_type;
2389 rh->name = GNUNET_strdup (name); 2404 rh->name = GNUNET_strdup (name);
2390 rh->name_resolution_pos = strlen (name); 2405 rh->name_resolution_pos = strlen (name);
2391 start_resolver_lookup (rh); 2406 rh->task_id = GNUNET_SCHEDULER_add_now (&start_resolver_lookup,
2407 rh);
2392 return rh; 2408 return rh;
2393} 2409}
2394 2410
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index af1eb2d1d..83a7b589b 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -559,11 +559,11 @@ hosts_directory_scan_callback (void *cls,
559 if (GNUNET_OK != 559 if (GNUNET_OK !=
560 GNUNET_HELLO_get_id (r.friend_only_hello, 560 GNUNET_HELLO_get_id (r.friend_only_hello,
561 &id_friend)) 561 &id_friend))
562 {
562 if (GNUNET_YES == dsc->remove_files) 563 if (GNUNET_YES == dsc->remove_files)
563 {
564 remove_garbage (fullname); 564 remove_garbage (fullname);
565 return GNUNET_OK; 565 return GNUNET_OK;
566 } 566 }
567 id = id_friend; 567 id = id_friend;
568 } 568 }
569 if (NULL != r.hello) 569 if (NULL != r.hello)
@@ -571,11 +571,11 @@ hosts_directory_scan_callback (void *cls,
571 if (GNUNET_OK != 571 if (GNUNET_OK !=
572 GNUNET_HELLO_get_id (r.hello, 572 GNUNET_HELLO_get_id (r.hello,
573 &id_public)) 573 &id_public))
574 {
574 if (GNUNET_YES == dsc->remove_files) 575 if (GNUNET_YES == dsc->remove_files)
575 {
576 remove_garbage (fullname); 576 remove_garbage (fullname);
577 return GNUNET_OK; 577 return GNUNET_OK;
578 } 578 }
579 id = id_public; 579 id = id_public;
580 } 580 }
581 581
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index ac72a667c..8d3e47f94 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -616,6 +616,8 @@ neighbours_changed_notification (const struct GNUNET_PeerIdentity *peer,
616 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 616 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
617 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) 617 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
618{ 618{
619 (void) bandwidth_in;
620 (void) bandwidth_out;
619 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 621 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
620 "Notifying about change for peer `%s' with address `%s' in state `%s' timing out at %s\n", 622 "Notifying about change for peer `%s' with address `%s' in state `%s' timing out at %s\n",
621 GNUNET_i2s (peer), 623 GNUNET_i2s (peer),
@@ -993,6 +995,10 @@ send_disconnect_cont (void *cls,
993{ 995{
994 struct NeighbourMapEntry *n; 996 struct NeighbourMapEntry *n;
995 997
998 (void) cls;
999 (void) result;
1000 (void) payload;
1001 (void) physical;
996 n = lookup_neighbour (target); 1002 n = lookup_neighbour (target);
997 if (NULL == n) 1003 if (NULL == n)
998 return; /* already gone */ 1004 return; /* already gone */
@@ -1133,8 +1139,10 @@ disconnect_neighbour (struct NeighbourMapEntry *n)
1133 * 1139 *
1134 * @param n neighbour entry to change qutoa for 1140 * @param n neighbour entry to change qutoa for
1135 * @param quota new quota 1141 * @param quota new quota
1142 * @return #GNUNET_YES if @a n is still valid, @GNUNET_NO if
1143 * @a n was freed
1136 */ 1144 */
1137static void 1145static int
1138set_incoming_quota (struct NeighbourMapEntry *n, 1146set_incoming_quota (struct NeighbourMapEntry *n,
1139 struct GNUNET_BANDWIDTH_Value32NBO quota) 1147 struct GNUNET_BANDWIDTH_Value32NBO quota)
1140{ 1148{
@@ -1158,7 +1166,7 @@ set_incoming_quota (struct NeighbourMapEntry *n,
1158 GNUNET_TIME_UNIT_FOREVER_REL, 1166 GNUNET_TIME_UNIT_FOREVER_REL,
1159 GNUNET_NO, 1167 GNUNET_NO,
1160 NULL, NULL); 1168 NULL, NULL);
1161 return; 1169 return GNUNET_YES;
1162 } 1170 }
1163 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1171 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1164 "Disconnecting peer `%s' due to SET_QUOTA\n", 1172 "Disconnecting peer `%s' due to SET_QUOTA\n",
@@ -1168,6 +1176,7 @@ set_incoming_quota (struct NeighbourMapEntry *n,
1168 gettext_noop ("# disconnects due to quota of 0"), 1176 gettext_noop ("# disconnects due to quota of 0"),
1169 1, GNUNET_NO); 1177 1, GNUNET_NO);
1170 disconnect_neighbour (n); 1178 disconnect_neighbour (n);
1179 return GNUNET_NO;
1171} 1180}
1172 1181
1173 1182
@@ -1196,8 +1205,10 @@ set_primary_address (struct NeighbourMapEntry *n,
1196 if (n->primary_address.bandwidth_in.value__ != bandwidth_in.value__) 1205 if (n->primary_address.bandwidth_in.value__ != bandwidth_in.value__)
1197 { 1206 {
1198 n->primary_address.bandwidth_in = bandwidth_in; 1207 n->primary_address.bandwidth_in = bandwidth_in;
1199 set_incoming_quota (n, 1208 if (GNUNET_YES !=
1200 bandwidth_in); 1209 set_incoming_quota (n,
1210 bandwidth_in))
1211 return;
1201 } 1212 }
1202 if (n->primary_address.bandwidth_out.value__ != bandwidth_out.value__) 1213 if (n->primary_address.bandwidth_out.value__ != bandwidth_out.value__)
1203 { 1214 {
@@ -1237,8 +1248,10 @@ set_primary_address (struct NeighbourMapEntry *n,
1237 /* subsystems about address use */ 1248 /* subsystems about address use */
1238 GST_validation_set_address_use (n->primary_address.address, 1249 GST_validation_set_address_use (n->primary_address.address,
1239 GNUNET_YES); 1250 GNUNET_YES);
1240 set_incoming_quota (n, 1251 if (GNUNET_YES !=
1241 bandwidth_in); 1252 set_incoming_quota (n,
1253 bandwidth_in))
1254 return;
1242 send_outbound_quota_to_clients (n); 1255 send_outbound_quota_to_clients (n);
1243 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1256 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1244 "Neighbour `%s' switched to address `%s'\n", 1257 "Neighbour `%s' switched to address `%s'\n",
@@ -1805,6 +1818,9 @@ send_session_syn_cont (void *cls,
1805{ 1818{
1806 struct NeighbourMapEntry *n; 1819 struct NeighbourMapEntry *n;
1807 1820
1821 (void) cls;
1822 (void) size_payload;
1823 (void) size_on_wire;
1808 n = lookup_neighbour (target); 1824 n = lookup_neighbour (target);
1809 if (NULL == n) 1825 if (NULL == n)
1810 { 1826 {
@@ -1978,6 +1994,9 @@ send_session_syn_ack_cont (void *cls,
1978{ 1994{
1979 struct NeighbourMapEntry *n; 1995 struct NeighbourMapEntry *n;
1980 1996
1997 (void) cls;
1998 (void) size_payload;
1999 (void) size_on_wire;
1981 n = lookup_neighbour (target); 2000 n = lookup_neighbour (target);
1982 if (NULL == n) 2001 if (NULL == n)
1983 { 2002 {
@@ -2393,8 +2412,10 @@ try_run_fast_ats_update (const struct GNUNET_HELLO_Address *address,
2393 if (n->primary_address.bandwidth_in.value__ != bandwidth_in.value__) 2412 if (n->primary_address.bandwidth_in.value__ != bandwidth_in.value__)
2394 { 2413 {
2395 n->primary_address.bandwidth_in = bandwidth_in; 2414 n->primary_address.bandwidth_in = bandwidth_in;
2396 set_incoming_quota (n, 2415 if (GNUNET_YES !=
2397 bandwidth_in); 2416 set_incoming_quota (n,
2417 bandwidth_in))
2418 return GNUNET_NO;
2398 } 2419 }
2399 if (n->primary_address.bandwidth_out.value__ != bandwidth_out.value__) 2420 if (n->primary_address.bandwidth_out.value__ != bandwidth_out.value__)
2400 { 2421 {
@@ -2805,6 +2826,7 @@ send_utilization_data (void *cls,
2805 uint32_t bps_out; 2826 uint32_t bps_out;
2806 struct GNUNET_TIME_Relative delta; 2827 struct GNUNET_TIME_Relative delta;
2807 2828
2829 (void) cls;
2808 if ( (GNUNET_YES != test_connected (n)) || 2830 if ( (GNUNET_YES != test_connected (n)) ||
2809 (NULL == n->primary_address.address) ) 2831 (NULL == n->primary_address.address) )
2810 return GNUNET_OK; 2832 return GNUNET_OK;
@@ -2835,11 +2857,12 @@ send_utilization_data (void *cls,
2835/** 2857/**
2836 * Task transmitting utilization in a regular interval 2858 * Task transmitting utilization in a regular interval
2837 * 2859 *
2838 * @param cls the 'struct NeighbourMapEntry' for which we are running 2860 * @param cls the `struct NeighbourMapEntry` for which we are running
2839 */ 2861 */
2840static void 2862static void
2841utilization_transmission (void *cls) 2863utilization_transmission (void *cls)
2842{ 2864{
2865 (void) cls;
2843 util_transmission_tk = NULL; 2866 util_transmission_tk = NULL;
2844 GNUNET_CONTAINER_multipeermap_iterate (neighbours, 2867 GNUNET_CONTAINER_multipeermap_iterate (neighbours,
2845 &send_utilization_data, 2868 &send_utilization_data,
@@ -3095,6 +3118,7 @@ GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *messag
3095 struct GNUNET_TIME_Absolute ts; 3118 struct GNUNET_TIME_Absolute ts;
3096 struct NeighbourMapEntry *n; 3119 struct NeighbourMapEntry *n;
3097 3120
3121 (void) session;
3098 if (ntohs (message->size) != sizeof (struct TransportSynMessage)) 3122 if (ntohs (message->size) != sizeof (struct TransportSynMessage))
3099 { 3123 {
3100 GNUNET_break_op (0); 3124 GNUNET_break_op (0);
@@ -3368,6 +3392,7 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message,
3368{ 3392{
3369 struct NeighbourMapEntry *n; 3393 struct NeighbourMapEntry *n;
3370 3394
3395 (void) session;
3371 if (ntohs (message->size) != sizeof (struct GNUNET_MessageHeader)) 3396 if (ntohs (message->size) != sizeof (struct GNUNET_MessageHeader))
3372 { 3397 {
3373 GNUNET_break_op (0); 3398 GNUNET_break_op (0);
@@ -3641,6 +3666,7 @@ neighbours_iterate (void *cls,
3641 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in; 3666 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in;
3642 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out; 3667 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out;
3643 3668
3669 (void) key;
3644 if (NULL != n->primary_address.address) 3670 if (NULL != n->primary_address.address)
3645 { 3671 {
3646 bandwidth_in = n->primary_address.bandwidth_in; 3672 bandwidth_in = n->primary_address.bandwidth_in;
@@ -3733,6 +3759,7 @@ GST_neighbour_get_current_address (const struct GNUNET_PeerIdentity *peer)
3733void 3759void
3734GST_neighbours_start (unsigned int max_fds) 3760GST_neighbours_start (unsigned int max_fds)
3735{ 3761{
3762 (void) max_fds;
3736 neighbours = GNUNET_CONTAINER_multipeermap_create (NEIGHBOUR_TABLE_SIZE, 3763 neighbours = GNUNET_CONTAINER_multipeermap_create (NEIGHBOUR_TABLE_SIZE,
3737 GNUNET_NO); 3764 GNUNET_NO);
3738 util_transmission_tk = GNUNET_SCHEDULER_add_delayed (UTIL_TRANSMISSION_INTERVAL, 3765 util_transmission_tk = GNUNET_SCHEDULER_add_delayed (UTIL_TRANSMISSION_INTERVAL,
@@ -3756,6 +3783,8 @@ disconnect_all_neighbours (void *cls,
3756{ 3783{
3757 struct NeighbourMapEntry *n = value; 3784 struct NeighbourMapEntry *n = value;
3758 3785
3786 (void) cls;
3787 (void) key;
3759 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3788 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3760 "Disconnecting peer `%4s' during shutdown\n", 3789 "Disconnecting peer `%4s' during shutdown\n",
3761 GNUNET_i2s (&n->id)); 3790 GNUNET_i2s (&n->id));
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index f214e7be4..0daac4443 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -3839,9 +3839,9 @@ libgnunet_plugin_transport_udp_init (void *cls)
3839 unsigned long long port; 3839 unsigned long long port;
3840 unsigned long long aport; 3840 unsigned long long aport;
3841 unsigned long long udp_max_bps; 3841 unsigned long long udp_max_bps;
3842 unsigned long long enable_v6; 3842 int enable_v6;
3843 unsigned long long enable_broadcasting; 3843 int enable_broadcasting;
3844 unsigned long long enable_broadcasting_recv; 3844 int enable_broadcasting_recv;
3845 char *bind4_address; 3845 char *bind4_address;
3846 char *bind6_address; 3846 char *bind6_address;
3847 struct GNUNET_TIME_Relative interval; 3847 struct GNUNET_TIME_Relative interval;
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 3e71fa476..ea5430191 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -976,20 +976,25 @@ mylog (enum GNUNET_ErrorType kind,
976 } 976 }
977 else 977 else
978 { 978 {
979 strftime (date2, 979 if (0 ==
980 DATE_STR_SIZE, 980 strftime (date2,
981 "%b %d %H:%M:%S-%%020llu", 981 DATE_STR_SIZE,
982 tmptr); 982 "%b %d %H:%M:%S-%%020llu",
983 snprintf (date, 983 tmptr))
984 sizeof (date), 984 abort ();
985 date2, 985 if (0 >
986 (long long) (pc.QuadPart / 986 snprintf (date,
987 (performance_frequency.QuadPart / 1000))); 987 sizeof (date),
988 date2,
989 (long long) (pc.QuadPart /
990 (performance_frequency.QuadPart / 1000))))
991 abort ();
988 } 992 }
989#else 993#else
990 struct timeval timeofday; 994 struct timeval timeofday;
991 995
992 gettimeofday (&timeofday, NULL); 996 gettimeofday (&timeofday,
997 NULL);
993 offset = GNUNET_TIME_get_offset (); 998 offset = GNUNET_TIME_get_offset ();
994 if (offset > 0) 999 if (offset > 0)
995 { 1000 {
@@ -1022,24 +1027,33 @@ mylog (enum GNUNET_ErrorType kind,
1022 } 1027 }
1023 else 1028 else
1024 { 1029 {
1025 strftime (date2, 1030 if (0 ==
1026 DATE_STR_SIZE, 1031 strftime (date2,
1027 "%b %d %H:%M:%S-%%06u", 1032 DATE_STR_SIZE,
1028 tmptr); 1033 "%b %d %H:%M:%S-%%06u",
1029 snprintf (date, 1034 tmptr))
1030 sizeof (date), 1035 abort ();
1031 date2, 1036 if (0 >
1032 timeofday.tv_usec); 1037 snprintf (date,
1038 sizeof (date),
1039 date2,
1040 timeofday.tv_usec))
1041 abort ();
1033 } 1042 }
1034#endif 1043#endif
1035 VSNPRINTF (buf, size, message, va); 1044 VSNPRINTF (buf,
1045 size,
1046 message,
1047 va);
1036#if ! (defined(GNUNET_CULL_LOGGING) || TALER_WALLET_ONLY) 1048#if ! (defined(GNUNET_CULL_LOGGING) || TALER_WALLET_ONLY)
1037 if (NULL != tmptr) 1049 if (NULL != tmptr)
1038 (void) setup_log_file (tmptr); 1050 (void) setup_log_file (tmptr);
1039#endif 1051#endif
1040 if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && 1052 if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) &&
1041 (0 != last_bulk_time.abs_value_us) && 1053 (0 != last_bulk_time.abs_value_us) &&
1042 (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) 1054 (0 == strncmp (buf,
1055 last_bulk,
1056 sizeof (last_bulk))))
1043 { 1057 {
1044 last_bulk_repeat++; 1058 last_bulk_repeat++;
1045 if ( (GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value_us > 1059 if ( (GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value_us >