aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxrs <xrs@mail36.net>2018-07-03 23:28:27 +0200
committerxrs <xrs@mail36.net>2018-07-03 23:28:27 +0200
commitf293763907abc5e9da76adb44b9648eb43a56f57 (patch)
treee32e2cfb6f5312859087c2dc5f2e66e52a3bada3
parentbdb1ee3242fe915f2648295f7430fab70eb31121 (diff)
parent00fc4513ebdb851c79b8f7c2591dffb6bd70c5bd (diff)
downloadgnunet-f293763907abc5e9da76adb44b9648eb43a56f57.tar.gz
gnunet-f293763907abc5e9da76adb44b9648eb43a56f57.zip
Merge branch 'master' of ssh://gnunet.org/gnunet
-rw-r--r--contrib/.gitignore1
-rw-r--r--contrib/Makefile.am11
-rw-r--r--doc/documentation/chapters/contributing.texi19
-rw-r--r--doc/documentation/chapters/developer.texi13
-rw-r--r--doc/documentation/chapters/installation.texi8
-rw-r--r--doc/documentation/gnunet.texi1
-rw-r--r--doc/man/Makefile.am1
-rw-r--r--doc/man/gnunet-gns.12
-rw-r--r--doc/man/gnunet-timeout.120
-rw-r--r--po/POTFILES.in126
-rw-r--r--src/cadet/cadet_api.c1
-rw-r--r--src/gns/gns_api.c7
-rw-r--r--src/gns/gnunet-gns.c10
-rw-r--r--src/gns/nss/nss_gns.c269
-rw-r--r--src/gns/nss/nss_gns_query.c25
-rw-r--r--src/gns/nss/nss_gns_query.h30
-rw-r--r--src/identity-provider/plugin_rest_openid_connect.c15
-rw-r--r--src/identity/identity_api_lookup.c8
-rw-r--r--src/rps/gnunet-rps-profiler.c4
-rw-r--r--src/rps/gnunet-service-rps.c67
-rw-r--r--src/rps/rps-test_util.c80
-rw-r--r--src/set/gnunet-service-set_intersection.c19
-rw-r--r--src/set/gnunet-service-set_union.c19
-rw-r--r--src/util/.gitignore5
-rw-r--r--src/util/Makefile.am16
-rw-r--r--src/util/client.c13
-rw-r--r--src/util/dnsparser.c9
-rw-r--r--src/util/gnunet-timeout-w32.c (renamed from contrib/timeout_watchdog_w32.c)6
-rw-r--r--src/util/gnunet-timeout.c (renamed from contrib/timeout_watchdog.c)82
29 files changed, 541 insertions, 346 deletions
diff --git a/contrib/.gitignore b/contrib/.gitignore
index 304706d7e..d6ef469ba 100644
--- a/contrib/.gitignore
+++ b/contrib/.gitignore
@@ -2,7 +2,6 @@ gnunet_janitor.py
2gnunet_pyexpect.py 2gnunet_pyexpect.py
3pydiffer.py 3pydiffer.py
4terminate.py 4terminate.py
5timeout_watchdog
6gnunet_pyexpect.py 5gnunet_pyexpect.py
7gnunet_pyexpect.pyc 6gnunet_pyexpect.pyc
8pydiffer.pyc 7pydiffer.pyc
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 158e43998..eec3300b9 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -5,17 +5,6 @@ tap32dir = $(pkgdatadir)/openvpn-tap32/tapw32/
5 5
6tap64dir = $(pkgdatadir)/openvpn-tap32/tapw64/ 6tap64dir = $(pkgdatadir)/openvpn-tap32/tapw64/
7 7
8noinst_PROGRAMS = \
9 timeout_watchdog
10
11if !MINGW
12timeout_watchdog_SOURCES = \
13 timeout_watchdog.c
14else
15timeout_watchdog_SOURCES = \
16 timeout_watchdog_w32.c
17endif
18
19noinst_SCRIPTS = \ 8noinst_SCRIPTS = \
20 scripts/terminate.py \ 9 scripts/terminate.py \
21 scripts/pydiffer.py \ 10 scripts/pydiffer.py \
diff --git a/doc/documentation/chapters/contributing.texi b/doc/documentation/chapters/contributing.texi
index dc87de3d6..a92df45c3 100644
--- a/doc/documentation/chapters/contributing.texi
+++ b/doc/documentation/chapters/contributing.texi
@@ -6,6 +6,7 @@
6* Licenses of contributions:: 6* Licenses of contributions::
7* Copyright Assignment:: 7* Copyright Assignment::
8* Contributing to the Reference Manual:: 8* Contributing to the Reference Manual::
9* Contributing testcases::
9@end menu 10@end menu
10 11
11@node Contributing to GNUnet 12@node Contributing to GNUnet
@@ -90,3 +91,21 @@ In a 200+ pages handbook it's better to have footnotes accessible
90without having to skip over to the end. 91without having to skip over to the end.
91 92
92@end itemize 93@end itemize
94
95@node Contributing testcases
96@section Contributing testcases
97
98In the core of gnunet, we restrict new testcases to a small subset
99of languages, in order of preference:
100@enumerate
101@item C
102@item Bash (preferable portable without too much specifics to Bash)
103@item Python (@geq{}3.6)
104@end enumerate
105
106We welcome efforts to remove our existing python-2.7 scripts to
107replace them either with Bash or, at your choice, python-3.6+.
108
109If you contribute new python based testcases, we advise you to
110not repeat our past misfortunes and write the tests in a standard
111test framework like for example pytest.
diff --git a/doc/documentation/chapters/developer.texi b/doc/documentation/chapters/developer.texi
index 1f74a8163..e82e32b59 100644
--- a/doc/documentation/chapters/developer.texi
+++ b/doc/documentation/chapters/developer.texi
@@ -214,9 +214,7 @@ Installation and update tool
214Template for starting 'external' GNUnet projects 214Template for starting 'external' GNUnet projects
215@item @command{gnunet-java} 215@item @command{gnunet-java}
216Java APIs for writing GNUnet services and applications 216Java APIs for writing GNUnet services and applications
217@c ** FIXME: Point to new website repository once we have it: 217@item @command{gnunet-java-ext}
218@c ** @item svn/gnunet-www/ Code and media helping drive the GNUnet
219@c website
220@item @command{eclectic} 218@item @command{eclectic}
221Code to run GNUnet nodes on testbeds for research, development, 219Code to run GNUnet nodes on testbeds for research, development,
222testing and evaluation 220testing and evaluation
@@ -227,6 +225,8 @@ Qt-based GNUnet GUI (is it deprecated?)
227cocoa-based GNUnet GUI (is it deprecated?) 225cocoa-based GNUnet GUI (is it deprecated?)
228@item @command{gnunet-guile} 226@item @command{gnunet-guile}
229Guile bindings for GNUnet 227Guile bindings for GNUnet
228@item @command{gnunet-python}
229Python bindings for GNUnet
230 230
231@end table 231@end table
232 232
@@ -246,6 +246,13 @@ Tool for automated debugging of distributed systems
246Library for accessing satellite connection quality reports 246Library for accessing satellite connection quality reports
247@item @command{libgnurl} 247@item @command{libgnurl}
248gnURL (feature-restricted variant of cURL/libcurl) 248gnURL (feature-restricted variant of cURL/libcurl)
249@item @command{www}
250work in progress of the new gnunet.org website (Jinja2 framework based to
251replace our current Drupal website)
252@item @command{bibliography}
253Our collected bibliography, papers, references, and so forth
254@item @command{gnunet-videos-}
255Videos about and around gnunet activities
249@end table 256@end table
250 257
251Finally, there are various external projects (see links for a list of 258Finally, there are various external projects (see links for a list of
diff --git a/doc/documentation/chapters/installation.texi b/doc/documentation/chapters/installation.texi
index f6dd69216..559a97f96 100644
--- a/doc/documentation/chapters/installation.texi
+++ b/doc/documentation/chapters/installation.texi
@@ -28,13 +28,13 @@ link to the project websites.
28The mandatory libraries and applications are 28The mandatory libraries and applications are
29@itemize @bullet 29@itemize @bullet
30@item libtool 30@item libtool
31@item autoconf >= version 2.59 31@item autoconf @geq{}2.59
32@item automake >= version 1.11.1 32@item automake @geq{}1.11.1
33@item pkg-config 33@item pkg-config
34@item libgcrypt >= version 1.6 34@item libgcrypt @geq{}1.6
35@item libextractor 35@item libextractor
36@item libidn 36@item libidn
37@item libmicrohttpd >= version 0.9.52 37@item libmicrohttpd @geq{}0.9.52
38@item libnss 38@item libnss
39@item libunistring 39@item libunistring
40@item gettext 40@item gettext
diff --git a/doc/documentation/gnunet.texi b/doc/documentation/gnunet.texi
index 747df5cf5..7743fddea 100644
--- a/doc/documentation/gnunet.texi
+++ b/doc/documentation/gnunet.texi
@@ -150,6 +150,7 @@ GNUnet Contributors Handbook
150* Licenses of contributions:: 150* Licenses of contributions::
151* Copyright Assignment:: 151* Copyright Assignment::
152* Contributing to the Reference Manual:: 152* Contributing to the Reference Manual::
153* Contributing testcases::
153 154
154GNUnet Developer Handbook 155GNUnet Developer Handbook
155 156
diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
index a6a116dca..37f881d60 100644
--- a/doc/man/Makefile.am
+++ b/doc/man/Makefile.am
@@ -37,6 +37,7 @@ man_MANS = \
37 gnunet-statistics.1 \ 37 gnunet-statistics.1 \
38 gnunet-testbed-profiler.1 \ 38 gnunet-testbed-profiler.1 \
39 gnunet-testing-run-service.1 \ 39 gnunet-testing-run-service.1 \
40 gnunet-timeout.1 \
40 gnunet-transport.1 \ 41 gnunet-transport.1 \
41 gnunet-transport-certificate-creation.1 \ 42 gnunet-transport-certificate-creation.1 \
42 gnunet-unindex.1 \ 43 gnunet-unindex.1 \
diff --git a/doc/man/gnunet-gns.1 b/doc/man/gnunet-gns.1
index 9466dae03..9e4482653 100644
--- a/doc/man/gnunet-gns.1
+++ b/doc/man/gnunet-gns.1
@@ -46,7 +46,7 @@ Print GNUnet version number.
46.SH RETURN VALUE 46.SH RETURN VALUE
47 47
48gnunet\-gns will return 0 on success, 1 on internal failures, 2 on 48gnunet\-gns will return 0 on success, 1 on internal failures, 2 on
49launch failures, 3 if the given name is not configured to use GNS. 49launch failures, 4 if the given name is not configured to use GNS.
50 50
51 51
52.SH BUGS 52.SH BUGS
diff --git a/doc/man/gnunet-timeout.1 b/doc/man/gnunet-timeout.1
new file mode 100644
index 000000000..e413254f4
--- /dev/null
+++ b/doc/man/gnunet-timeout.1
@@ -0,0 +1,20 @@
1.TH GNUNET\-TIMOUET 1 "Jun 5, 2018" "GNUnet"
2
3.SH NAME
4gnunet\-timeout \- run process with timeout
5
6.SH SYNOPSIS
7.B gnunet\-timeout
8.RI TIMEOUT PROGRAM ARGS
9.br
10
11.SH DESCRIPTION
12\fBgnunet\-timeout\fP can be used to run another process with a
13timeout. Provided as the standard "timout" utility may not be
14available on all platforms.
15
16.SH BUGS
17Report bugs by using Mantis <https://gnunet.org/bugs/> or by sending electronic mail to <gnunet\-developers@gnu.org>
18
19.SH SEE
20timeout(1)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 38fa52508..83c3c7bdd 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,13 +4,21 @@ src/arm/arm_monitor_api.c
4src/arm/gnunet-arm.c 4src/arm/gnunet-arm.c
5src/arm/gnunet-service-arm.c 5src/arm/gnunet-service-arm.c
6src/arm/mockup-service.c 6src/arm/mockup-service.c
7src/ats-tests/ats-testing-experiment.c
8src/ats-tests/ats-testing-log.c
9src/ats-tests/ats-testing-preferences.c
10src/ats-tests/ats-testing-traffic.c
11src/ats-tests/ats-testing.c
12src/ats-tests/gnunet-ats-sim.c
13src/ats-tests/gnunet-solver-eval.c
14src/ats-tool/gnunet-ats.c
7src/ats/ats_api_connectivity.c 15src/ats/ats_api_connectivity.c
8src/ats/ats_api_performance.c 16src/ats/ats_api_performance.c
9src/ats/ats_api_scanner.c 17src/ats/ats_api_scanner.c
10src/ats/ats_api_scheduling.c 18src/ats/ats_api_scheduling.c
11src/ats/gnunet-ats-solver-eval.c 19src/ats/gnunet-ats-solver-eval.c
12src/ats/gnunet-service-ats_addresses.c
13src/ats/gnunet-service-ats.c 20src/ats/gnunet-service-ats.c
21src/ats/gnunet-service-ats_addresses.c
14src/ats/gnunet-service-ats_connectivity.c 22src/ats/gnunet-service-ats_connectivity.c
15src/ats/gnunet-service-ats_normalization.c 23src/ats/gnunet-service-ats_normalization.c
16src/ats/gnunet-service-ats_performance.c 24src/ats/gnunet-service-ats_performance.c
@@ -21,14 +29,6 @@ src/ats/gnunet-service-ats_scheduling.c
21src/ats/plugin_ats_mlp.c 29src/ats/plugin_ats_mlp.c
22src/ats/plugin_ats_proportional.c 30src/ats/plugin_ats_proportional.c
23src/ats/plugin_ats_ril.c 31src/ats/plugin_ats_ril.c
24src/ats-tests/ats-testing.c
25src/ats-tests/ats-testing-experiment.c
26src/ats-tests/ats-testing-log.c
27src/ats-tests/ats-testing-preferences.c
28src/ats-tests/ats-testing-traffic.c
29src/ats-tests/gnunet-ats-sim.c
30src/ats-tests/gnunet-solver-eval.c
31src/ats-tool/gnunet-ats.c
32src/auction/gnunet-auction-create.c 32src/auction/gnunet-auction-create.c
33src/auction/gnunet-auction-info.c 33src/auction/gnunet-auction-info.c
34src/auction/gnunet-auction-join.c 34src/auction/gnunet-auction-join.c
@@ -40,8 +40,8 @@ src/block/plugin_block_test.c
40src/cadet/cadet_api.c 40src/cadet/cadet_api.c
41src/cadet/cadet_test_lib.c 41src/cadet/cadet_test_lib.c
42src/cadet/desirability_table.c 42src/cadet/desirability_table.c
43src/cadet/gnunet-cadet.c
44src/cadet/gnunet-cadet-profiler.c 43src/cadet/gnunet-cadet-profiler.c
44src/cadet/gnunet-cadet.c
45src/cadet/gnunet-service-cadet.c 45src/cadet/gnunet-service-cadet.c
46src/cadet/gnunet-service-cadet_channel.c 46src/cadet/gnunet-service-cadet_channel.c
47src/cadet/gnunet-service-cadet_connection.c 47src/cadet/gnunet-service-cadet_connection.c
@@ -57,15 +57,15 @@ src/consensus/gnunet-service-consensus.c
57src/consensus/plugin_block_consensus.c 57src/consensus/plugin_block_consensus.c
58src/conversation/conversation_api.c 58src/conversation/conversation_api.c
59src/conversation/conversation_api_call.c 59src/conversation/conversation_api_call.c
60src/conversation/gnunet-conversation.c
61src/conversation/gnunet-conversation-test.c 60src/conversation/gnunet-conversation-test.c
62src/conversation/gnunet_gst.c 61src/conversation/gnunet-conversation.c
63src/conversation/gnunet_gst_test.c
64src/conversation/gnunet-helper-audio-playback.c
65src/conversation/gnunet-helper-audio-playback-gst.c 62src/conversation/gnunet-helper-audio-playback-gst.c
66src/conversation/gnunet-helper-audio-record.c 63src/conversation/gnunet-helper-audio-playback.c
67src/conversation/gnunet-helper-audio-record-gst.c 64src/conversation/gnunet-helper-audio-record-gst.c
65src/conversation/gnunet-helper-audio-record.c
68src/conversation/gnunet-service-conversation.c 66src/conversation/gnunet-service-conversation.c
67src/conversation/gnunet_gst.c
68src/conversation/gnunet_gst_test.c
69src/conversation/microphone.c 69src/conversation/microphone.c
70src/conversation/plugin_gnsrecord_conversation.c 70src/conversation/plugin_gnsrecord_conversation.c
71src/conversation/speaker.c 71src/conversation/speaker.c
@@ -102,7 +102,6 @@ src/dht/dht_api.c
102src/dht/dht_test_lib.c 102src/dht/dht_test_lib.c
103src/dht/gnunet-dht-get.c 103src/dht/gnunet-dht-get.c
104src/dht/gnunet-dht-monitor.c 104src/dht/gnunet-dht-monitor.c
105src/dht/gnunet_dht_profiler.c
106src/dht/gnunet-dht-put.c 105src/dht/gnunet-dht-put.c
107src/dht/gnunet-service-dht.c 106src/dht/gnunet-service-dht.c
108src/dht/gnunet-service-dht_clients.c 107src/dht/gnunet-service-dht_clients.c
@@ -111,6 +110,7 @@ src/dht/gnunet-service-dht_hello.c
111src/dht/gnunet-service-dht_neighbours.c 110src/dht/gnunet-service-dht_neighbours.c
112src/dht/gnunet-service-dht_nse.c 111src/dht/gnunet-service-dht_nse.c
113src/dht/gnunet-service-dht_routing.c 112src/dht/gnunet-service-dht_routing.c
113src/dht/gnunet_dht_profiler.c
114src/dht/plugin_block_dht.c 114src/dht/plugin_block_dht.c
115src/dns/dns_api.c 115src/dns/dns_api.c
116src/dns/gnunet-dns-monitor.c 116src/dns/gnunet-dns-monitor.c
@@ -124,8 +124,8 @@ src/dv/gnunet-dv.c
124src/dv/gnunet-service-dv.c 124src/dv/gnunet-service-dv.c
125src/dv/plugin_transport_dv.c 125src/dv/plugin_transport_dv.c
126src/exit/gnunet-daemon-exit.c 126src/exit/gnunet-daemon-exit.c
127src/exit/gnunet-helper-exit.c
128src/exit/gnunet-helper-exit-windows.c 127src/exit/gnunet-helper-exit-windows.c
128src/exit/gnunet-helper-exit.c
129src/fragmentation/defragmentation.c 129src/fragmentation/defragmentation.c
130src/fragmentation/fragmentation.c 130src/fragmentation/fragmentation.c
131src/fs/fs_api.c 131src/fs/fs_api.c
@@ -150,8 +150,8 @@ src/fs/gnunet-auto-share.c
150src/fs/gnunet-daemon-fsprofiler.c 150src/fs/gnunet-daemon-fsprofiler.c
151src/fs/gnunet-directory.c 151src/fs/gnunet-directory.c
152src/fs/gnunet-download.c 152src/fs/gnunet-download.c
153src/fs/gnunet-fs.c
154src/fs/gnunet-fs-profiler.c 153src/fs/gnunet-fs-profiler.c
154src/fs/gnunet-fs.c
155src/fs/gnunet-helper-fs-publish.c 155src/fs/gnunet-helper-fs-publish.c
156src/fs/gnunet-publish.c 156src/fs/gnunet-publish.c
157src/fs/gnunet-search.c 157src/fs/gnunet-search.c
@@ -171,10 +171,10 @@ src/gns/gns_tld_api.c
171src/gns/gnunet-bcd.c 171src/gns/gnunet-bcd.c
172src/gns/gnunet-dns2gns.c 172src/gns/gnunet-dns2gns.c
173src/gns/gnunet-gns-benchmark.c 173src/gns/gnunet-gns-benchmark.c
174src/gns/gnunet-gns.c
175src/gns/gnunet-gns-helper-service-w32.c 174src/gns/gnunet-gns-helper-service-w32.c
176src/gns/gnunet-gns-import.c 175src/gns/gnunet-gns-import.c
177src/gns/gnunet-gns-proxy.c 176src/gns/gnunet-gns-proxy.c
177src/gns/gnunet-gns.c
178src/gns/gnunet-service-gns.c 178src/gns/gnunet-service-gns.c
179src/gns/gnunet-service-gns_interceptor.c 179src/gns/gnunet-service-gns_interceptor.c
180src/gns/gnunet-service-gns_resolver.c 180src/gns/gnunet-service-gns_resolver.c
@@ -183,15 +183,15 @@ src/gns/nss/nss_gns_query.c
183src/gns/plugin_block_gns.c 183src/gns/plugin_block_gns.c
184src/gns/plugin_gnsrecord_gns.c 184src/gns/plugin_gnsrecord_gns.c
185src/gns/plugin_rest_gns.c 185src/gns/plugin_rest_gns.c
186src/gns/w32nsp-install.c
187src/gns/w32nsp-resolve.c
188src/gns/w32nsp-uninstall.c
189src/gns/w32nsp.c
186src/gnsrecord/gnsrecord.c 190src/gnsrecord/gnsrecord.c
187src/gnsrecord/gnsrecord_crypto.c 191src/gnsrecord/gnsrecord_crypto.c
188src/gnsrecord/gnsrecord_misc.c 192src/gnsrecord/gnsrecord_misc.c
189src/gnsrecord/gnsrecord_serialization.c 193src/gnsrecord/gnsrecord_serialization.c
190src/gnsrecord/plugin_gnsrecord_dns.c 194src/gnsrecord/plugin_gnsrecord_dns.c
191src/gns/w32nsp.c
192src/gns/w32nsp-install.c
193src/gns/w32nsp-resolve.c
194src/gns/w32nsp-uninstall.c
195src/hello/address.c 195src/hello/address.c
196src/hello/gnunet-hello.c 196src/hello/gnunet-hello.c
197src/hello/hello.c 197src/hello/hello.c
@@ -200,11 +200,6 @@ src/hostlist/gnunet-daemon-hostlist_client.c
200src/hostlist/gnunet-daemon-hostlist_server.c 200src/hostlist/gnunet-daemon-hostlist_server.c
201src/identity-attribute/identity_attribute.c 201src/identity-attribute/identity_attribute.c
202src/identity-attribute/plugin_identity_attribute_gnuid.c 202src/identity-attribute/plugin_identity_attribute_gnuid.c
203src/identity/gnunet-identity.c
204src/identity/gnunet-service-identity.c
205src/identity/identity_api.c
206src/identity/identity_api_lookup.c
207src/identity/plugin_rest_identity.c
208src/identity-provider/gnunet-idp.c 203src/identity-provider/gnunet-idp.c
209src/identity-provider/gnunet-service-identity-provider.c 204src/identity-provider/gnunet-service-identity-provider.c
210src/identity-provider/identity_provider_api.c 205src/identity-provider/identity_provider_api.c
@@ -213,15 +208,20 @@ src/identity-provider/plugin_gnsrecord_identity_provider.c
213src/identity-provider/plugin_identity_provider_sqlite.c 208src/identity-provider/plugin_identity_provider_sqlite.c
214src/identity-provider/plugin_rest_identity_provider.c 209src/identity-provider/plugin_rest_identity_provider.c
215src/identity-provider/plugin_rest_openid_connect.c 210src/identity-provider/plugin_rest_openid_connect.c
211src/identity/gnunet-identity.c
212src/identity/gnunet-service-identity.c
213src/identity/identity_api.c
214src/identity/identity_api_lookup.c
215src/identity/plugin_rest_identity.c
216src/json/json.c
217src/json/json_generator.c
218src/json/json_helper.c
219src/json/json_mhd.c
216src/jsonapi/jsonapi.c 220src/jsonapi/jsonapi.c
217src/jsonapi/jsonapi_document.c 221src/jsonapi/jsonapi_document.c
218src/jsonapi/jsonapi_error.c 222src/jsonapi/jsonapi_error.c
219src/jsonapi/jsonapi_relationship.c 223src/jsonapi/jsonapi_relationship.c
220src/jsonapi/jsonapi_resource.c 224src/jsonapi/jsonapi_resource.c
221src/json/json.c
222src/json/json_generator.c
223src/json/json_helper.c
224src/json/json_mhd.c
225src/multicast/gnunet-multicast.c 225src/multicast/gnunet-multicast.c
226src/multicast/gnunet-service-multicast.c 226src/multicast/gnunet-service-multicast.c
227src/multicast/multicast_api.c 227src/multicast/multicast_api.c
@@ -235,8 +235,8 @@ src/namecache/namecache_api.c
235src/namecache/plugin_namecache_flat.c 235src/namecache/plugin_namecache_flat.c
236src/namecache/plugin_namecache_postgres.c 236src/namecache/plugin_namecache_postgres.c
237src/namecache/plugin_namecache_sqlite.c 237src/namecache/plugin_namecache_sqlite.c
238src/namestore/gnunet-namestore.c
239src/namestore/gnunet-namestore-fcfsd.c 238src/namestore/gnunet-namestore-fcfsd.c
239src/namestore/gnunet-namestore.c
240src/namestore/gnunet-service-namestore.c 240src/namestore/gnunet-service-namestore.c
241src/namestore/gnunet-zoneimport.c 241src/namestore/gnunet-zoneimport.c
242src/namestore/namestore_api.c 242src/namestore/namestore_api.c
@@ -252,10 +252,10 @@ src/nat-auto/gnunet-service-nat-auto.c
252src/nat-auto/gnunet-service-nat-auto_legacy.c 252src/nat-auto/gnunet-service-nat-auto_legacy.c
253src/nat-auto/nat_auto_api.c 253src/nat-auto/nat_auto_api.c
254src/nat-auto/nat_auto_api_test.c 254src/nat-auto/nat_auto_api_test.c
255src/nat/gnunet-helper-nat-client.c
256src/nat/gnunet-helper-nat-client-windows.c 255src/nat/gnunet-helper-nat-client-windows.c
257src/nat/gnunet-helper-nat-server.c 256src/nat/gnunet-helper-nat-client.c
258src/nat/gnunet-helper-nat-server-windows.c 257src/nat/gnunet-helper-nat-server-windows.c
258src/nat/gnunet-helper-nat-server.c
259src/nat/gnunet-nat.c 259src/nat/gnunet-nat.c
260src/nat/gnunet-service-nat.c 260src/nat/gnunet-service-nat.c
261src/nat/gnunet-service-nat_externalip.c 261src/nat/gnunet-service-nat_externalip.c
@@ -264,15 +264,15 @@ src/nat/gnunet-service-nat_mini.c
264src/nat/gnunet-service-nat_stun.c 264src/nat/gnunet-service-nat_stun.c
265src/nat/nat_api.c 265src/nat/nat_api.c
266src/nat/nat_api_stun.c 266src/nat/nat_api_stun.c
267src/nse/gnunet-nse.c
268src/nse/gnunet-nse-profiler.c 267src/nse/gnunet-nse-profiler.c
268src/nse/gnunet-nse.c
269src/nse/gnunet-service-nse.c 269src/nse/gnunet-service-nse.c
270src/nse/nse_api.c 270src/nse/nse_api.c
271src/peerinfo-tool/gnunet-peerinfo.c
272src/peerinfo-tool/gnunet-peerinfo_plugins.c
271src/peerinfo/gnunet-service-peerinfo.c 273src/peerinfo/gnunet-service-peerinfo.c
272src/peerinfo/peerinfo_api.c 274src/peerinfo/peerinfo_api.c
273src/peerinfo/peerinfo_api_notify.c 275src/peerinfo/peerinfo_api_notify.c
274src/peerinfo-tool/gnunet-peerinfo.c
275src/peerinfo-tool/gnunet-peerinfo_plugins.c
276src/peerstore/gnunet-peerstore.c 276src/peerstore/gnunet-peerstore.c
277src/peerstore/gnunet-service-peerstore.c 277src/peerstore/gnunet-service-peerstore.c
278src/peerstore/peerstore_api.c 278src/peerstore/peerstore_api.c
@@ -317,20 +317,20 @@ src/revocation/gnunet-revocation.c
317src/revocation/gnunet-service-revocation.c 317src/revocation/gnunet-service-revocation.c
318src/revocation/plugin_block_revocation.c 318src/revocation/plugin_block_revocation.c
319src/revocation/revocation_api.c 319src/revocation/revocation_api.c
320src/rps/gnunet-rps.c
321src/rps/gnunet-rps-profiler.c 320src/rps/gnunet-rps-profiler.c
321src/rps/gnunet-rps.c
322src/rps/gnunet-service-rps.c 322src/rps/gnunet-service-rps.c
323src/rps/gnunet-service-rps_custommap.c 323src/rps/gnunet-service-rps_custommap.c
324src/rps/gnunet-service-rps_sampler.c 324src/rps/gnunet-service-rps_sampler.c
325src/rps/gnunet-service-rps_sampler_elem.c 325src/rps/gnunet-service-rps_sampler_elem.c
326src/rps/gnunet-service-rps_view.c 326src/rps/gnunet-service-rps_view.c
327src/rps/rps_api.c
328src/rps/rps-test_util.c 327src/rps/rps-test_util.c
328src/rps/rps_api.c
329src/scalarproduct/gnunet-scalarproduct.c 329src/scalarproduct/gnunet-scalarproduct.c
330src/scalarproduct/gnunet-service-scalarproduct_alice.c
331src/scalarproduct/gnunet-service-scalarproduct_bob.c
332src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c 330src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
333src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c 331src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
332src/scalarproduct/gnunet-service-scalarproduct_alice.c
333src/scalarproduct/gnunet-service-scalarproduct_bob.c
334src/scalarproduct/scalarproduct_api.c 334src/scalarproduct/scalarproduct_api.c
335src/secretsharing/gnunet-secretsharing-profiler.c 335src/secretsharing/gnunet-secretsharing-profiler.c
336src/secretsharing/gnunet-service-secretsharing.c 336src/secretsharing/gnunet-service-secretsharing.c
@@ -359,15 +359,16 @@ src/statistics/gnunet-statistics.c
359src/statistics/statistics_api.c 359src/statistics/statistics_api.c
360src/template/gnunet-service-template.c 360src/template/gnunet-service-template.c
361src/template/gnunet-template.c 361src/template/gnunet-template.c
362src/testbed-logger/gnunet-service-testbed-logger.c
363src/testbed-logger/testbed_logger_api.c
362src/testbed/generate-underlay-topology.c 364src/testbed/generate-underlay-topology.c
363src/testbed/gnunet-daemon-latency-logger.c 365src/testbed/gnunet-daemon-latency-logger.c
364src/testbed/gnunet-daemon-testbed-blacklist.c 366src/testbed/gnunet-daemon-testbed-blacklist.c
365src/testbed/gnunet-daemon-testbed-underlay.c 367src/testbed/gnunet-daemon-testbed-underlay.c
366src/testbed/gnunet-helper-testbed.c 368src/testbed/gnunet-helper-testbed.c
367src/testbed/gnunet_mpi_test.c
368src/testbed/gnunet-service-test-barriers.c 369src/testbed/gnunet-service-test-barriers.c
369src/testbed/gnunet-service-testbed_barriers.c
370src/testbed/gnunet-service-testbed.c 370src/testbed/gnunet-service-testbed.c
371src/testbed/gnunet-service-testbed_barriers.c
371src/testbed/gnunet-service-testbed_cache.c 372src/testbed/gnunet-service-testbed_cache.c
372src/testbed/gnunet-service-testbed_connectionpool.c 373src/testbed/gnunet-service-testbed_connectionpool.c
373src/testbed/gnunet-service-testbed_cpustatus.c 374src/testbed/gnunet-service-testbed_cpustatus.c
@@ -375,20 +376,19 @@ src/testbed/gnunet-service-testbed_links.c
375src/testbed/gnunet-service-testbed_meminfo.c 376src/testbed/gnunet-service-testbed_meminfo.c
376src/testbed/gnunet-service-testbed_oc.c 377src/testbed/gnunet-service-testbed_oc.c
377src/testbed/gnunet-service-testbed_peers.c 378src/testbed/gnunet-service-testbed_peers.c
378src/testbed/gnunet_testbed_mpi_spawn.c
379src/testbed/gnunet-testbed-profiler.c 379src/testbed/gnunet-testbed-profiler.c
380src/testbed-logger/gnunet-service-testbed-logger.c 380src/testbed/gnunet_mpi_test.c
381src/testbed-logger/testbed_logger_api.c 381src/testbed/gnunet_testbed_mpi_spawn.c
382src/testbed/testbed_api_barriers.c
383src/testbed/testbed_api.c 382src/testbed/testbed_api.c
383src/testbed/testbed_api_barriers.c
384src/testbed/testbed_api_hosts.c 384src/testbed/testbed_api_hosts.c
385src/testbed/testbed_api_operations.c 385src/testbed/testbed_api_operations.c
386src/testbed/testbed_api_peers.c 386src/testbed/testbed_api_peers.c
387src/testbed/testbed_api_sd.c 387src/testbed/testbed_api_sd.c
388src/testbed/testbed_api_services.c 388src/testbed/testbed_api_services.c
389src/testbed/testbed_api_statistics.c 389src/testbed/testbed_api_statistics.c
390src/testbed/testbed_api_testbed.c
391src/testbed/testbed_api_test.c 390src/testbed/testbed_api_test.c
391src/testbed/testbed_api_testbed.c
392src/testbed/testbed_api_topology.c 392src/testbed/testbed_api_topology.c
393src/testbed/testbed_api_underlay.c 393src/testbed/testbed_api_underlay.c
394src/testing/gnunet-testing.c 394src/testing/gnunet-testing.c
@@ -397,28 +397,28 @@ src/testing/testing.c
397src/topology/friends.c 397src/topology/friends.c
398src/topology/gnunet-daemon-topology.c 398src/topology/gnunet-daemon-topology.c
399src/transport/gnunet-helper-transport-bluetooth.c 399src/transport/gnunet-helper-transport-bluetooth.c
400src/transport/gnunet-helper-transport-wlan.c
401src/transport/gnunet-helper-transport-wlan-dummy.c 400src/transport/gnunet-helper-transport-wlan-dummy.c
402src/transport/gnunet-service-transport_ats.c 401src/transport/gnunet-helper-transport-wlan.c
403src/transport/gnunet-service-transport.c 402src/transport/gnunet-service-transport.c
403src/transport/gnunet-service-transport_ats.c
404src/transport/gnunet-service-transport_hello.c 404src/transport/gnunet-service-transport_hello.c
405src/transport/gnunet-service-transport_manipulation.c 405src/transport/gnunet-service-transport_manipulation.c
406src/transport/gnunet-service-transport_neighbours.c 406src/transport/gnunet-service-transport_neighbours.c
407src/transport/gnunet-service-transport_plugins.c 407src/transport/gnunet-service-transport_plugins.c
408src/transport/gnunet-service-transport_validation.c 408src/transport/gnunet-service-transport_validation.c
409src/transport/gnunet-transport.c
410src/transport/gnunet-transport-certificate-creation.c 409src/transport/gnunet-transport-certificate-creation.c
411src/transport/gnunet-transport-profiler.c 410src/transport/gnunet-transport-profiler.c
412src/transport/gnunet-transport-wlan-receiver.c 411src/transport/gnunet-transport-wlan-receiver.c
413src/transport/gnunet-transport-wlan-sender.c 412src/transport/gnunet-transport-wlan-sender.c
413src/transport/gnunet-transport.c
414src/transport/plugin_transport_http_client.c 414src/transport/plugin_transport_http_client.c
415src/transport/plugin_transport_http_common.c 415src/transport/plugin_transport_http_common.c
416src/transport/plugin_transport_http_server.c 416src/transport/plugin_transport_http_server.c
417src/transport/plugin_transport_smtp.c 417src/transport/plugin_transport_smtp.c
418src/transport/plugin_transport_tcp.c 418src/transport/plugin_transport_tcp.c
419src/transport/plugin_transport_template.c 419src/transport/plugin_transport_template.c
420src/transport/plugin_transport_udp_broadcasting.c
421src/transport/plugin_transport_udp.c 420src/transport/plugin_transport_udp.c
421src/transport/plugin_transport_udp_broadcasting.c
422src/transport/plugin_transport_unix.c 422src/transport/plugin_transport_unix.c
423src/transport/plugin_transport_wlan.c 423src/transport/plugin_transport_wlan.c
424src/transport/plugin_transport_xt.c 424src/transport/plugin_transport_xt.c
@@ -427,6 +427,11 @@ src/transport/tcp_connection_legacy.c
427src/transport/tcp_server_legacy.c 427src/transport/tcp_server_legacy.c
428src/transport/tcp_server_mst_legacy.c 428src/transport/tcp_server_mst_legacy.c
429src/transport/tcp_service_legacy.c 429src/transport/tcp_service_legacy.c
430src/transport/transport-testing-filenames.c
431src/transport/transport-testing-loggers.c
432src/transport/transport-testing-main.c
433src/transport/transport-testing-send.c
434src/transport/transport-testing.c
430src/transport/transport_api_address_to_string.c 435src/transport/transport_api_address_to_string.c
431src/transport/transport_api_blacklist.c 436src/transport/transport_api_blacklist.c
432src/transport/transport_api_core.c 437src/transport/transport_api_core.c
@@ -435,11 +440,6 @@ src/transport/transport_api_manipulation.c
435src/transport/transport_api_monitor_peers.c 440src/transport/transport_api_monitor_peers.c
436src/transport/transport_api_monitor_plugins.c 441src/transport/transport_api_monitor_plugins.c
437src/transport/transport_api_offer_hello.c 442src/transport/transport_api_offer_hello.c
438src/transport/transport-testing.c
439src/transport/transport-testing-filenames.c
440src/transport/transport-testing-loggers.c
441src/transport/transport-testing-main.c
442src/transport/transport-testing-send.c
443src/util/bandwidth.c 443src/util/bandwidth.c
444src/util/bio.c 444src/util/bio.c
445src/util/client.c 445src/util/client.c
@@ -451,8 +451,8 @@ src/util/configuration_loader.c
451src/util/container_bloomfilter.c 451src/util/container_bloomfilter.c
452src/util/container_heap.c 452src/util/container_heap.c
453src/util/container_meta_data.c 453src/util/container_meta_data.c
454src/util/container_multihashmap32.c
455src/util/container_multihashmap.c 454src/util/container_multihashmap.c
455src/util/container_multihashmap32.c
456src/util/container_multipeermap.c 456src/util/container_multipeermap.c
457src/util/container_multishortmap.c 457src/util/container_multishortmap.c
458src/util/crypto_abe.c 458src/util/crypto_abe.c
@@ -474,13 +474,15 @@ src/util/dnsparser.c
474src/util/dnsstub.c 474src/util/dnsstub.c
475src/util/getopt.c 475src/util/getopt.c
476src/util/getopt_helpers.c 476src/util/getopt_helpers.c
477src/util/gnunet-config.c
478src/util/gnunet-config-diff.c 477src/util/gnunet-config-diff.c
478src/util/gnunet-config.c
479src/util/gnunet-ecc.c 479src/util/gnunet-ecc.c
480src/util/gnunet-helper-w32-console.c 480src/util/gnunet-helper-w32-console.c
481src/util/gnunet-resolver.c 481src/util/gnunet-resolver.c
482src/util/gnunet-scrypt.c 482src/util/gnunet-scrypt.c
483src/util/gnunet-service-resolver.c 483src/util/gnunet-service-resolver.c
484src/util/gnunet-timeout-w32.c
485src/util/gnunet-timeout.c
484src/util/gnunet-uri.c 486src/util/gnunet-uri.c
485src/util/helper.c 487src/util/helper.c
486src/util/load.c 488src/util/load.c
@@ -508,13 +510,13 @@ src/util/tun.c
508src/util/w32cat.c 510src/util/w32cat.c
509src/util/win.c 511src/util/win.c
510src/util/winproc.c 512src/util/winproc.c
511src/vpn/gnunet-helper-vpn.c
512src/vpn/gnunet-helper-vpn-windows.c 513src/vpn/gnunet-helper-vpn-windows.c
514src/vpn/gnunet-helper-vpn.c
513src/vpn/gnunet-service-vpn.c 515src/vpn/gnunet-service-vpn.c
514src/vpn/gnunet-vpn.c 516src/vpn/gnunet-vpn.c
515src/vpn/vpn_api.c 517src/vpn/vpn_api.c
516src/zonemaster/gnunet-service-zonemaster.c
517src/zonemaster/gnunet-service-zonemaster-monitor.c 518src/zonemaster/gnunet-service-zonemaster-monitor.c
519src/zonemaster/gnunet-service-zonemaster.c
518src/fs/fs_api.h 520src/fs/fs_api.h
519src/include/gnunet_common.h 521src/include/gnunet_common.h
520src/include/gnunet_mq_lib.h 522src/include/gnunet_mq_lib.h
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 319279110..92dd39b97 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -841,6 +841,7 @@ handle_mq_error (void *cls,
841 h); 841 h);
842 GNUNET_MQ_destroy (h->mq); 842 GNUNET_MQ_destroy (h->mq);
843 h->mq = NULL; 843 h->mq = NULL;
844 GNUNET_assert (NULL == h->reconnect_task);
844 h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time, 845 h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time,
845 &reconnect_cbk, 846 &reconnect_cbk,
846 h); 847 h);
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c
index 0ec9209da..3b658da92 100644
--- a/src/gns/gns_api.c
+++ b/src/gns/gns_api.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -232,7 +232,6 @@ reconnect (struct GNUNET_GNS_Handle *handle)
232 handle), 232 handle),
233 GNUNET_MQ_handler_end () 233 GNUNET_MQ_handler_end ()
234 }; 234 };
235 struct GNUNET_GNS_LookupRequest *lh;
236 235
237 GNUNET_assert (NULL == handle->mq); 236 GNUNET_assert (NULL == handle->mq);
238 LOG (GNUNET_ERROR_TYPE_DEBUG, 237 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -244,7 +243,9 @@ reconnect (struct GNUNET_GNS_Handle *handle)
244 handle); 243 handle);
245 if (NULL == handle->mq) 244 if (NULL == handle->mq)
246 return; 245 return;
247 for (lh = handle->lookup_head; NULL != lh; lh = lh->next) 246 for (struct GNUNET_GNS_LookupRequest *lh = handle->lookup_head;
247 NULL != lh;
248 lh = lh->next)
248 GNUNET_MQ_send_copy (handle->mq, 249 GNUNET_MQ_send_copy (handle->mq,
249 lh->env); 250 lh->env);
250} 251}
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c
index 149c8a7bb..463348ed3 100644
--- a/src/gns/gnunet-gns.c
+++ b/src/gns/gnunet-gns.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -65,8 +65,9 @@ static struct GNUNET_GNS_LookupWithTldRequest *lr;
65/** 65/**
66 * Global return value. 66 * Global return value.
67 * 0 on success (default), 67 * 0 on success (default),
68 * 1 on internal failures, 2 on launch failure, 68 * 1 on internal failures
69 * 3 if the name is not a GNS-supported TLD, 69 * 2 on launch failure,
70 * 4 if the name is not a GNS-supported TLD,
70 */ 71 */
71static int global_ret; 72static int global_ret;
72 73
@@ -114,7 +115,7 @@ process_lookup_result (void *cls,
114 lr = NULL; 115 lr = NULL;
115 if (GNUNET_NO == was_gns) 116 if (GNUNET_NO == was_gns)
116 { 117 {
117 global_ret = 3; 118 global_ret = 4; /* not for GNS */
118 GNUNET_SCHEDULER_shutdown (); 119 GNUNET_SCHEDULER_shutdown ();
119 return; 120 return;
120 } 121 }
@@ -183,7 +184,6 @@ run (void *cls,
183 global_ret = 2; 184 global_ret = 2;
184 return; 185 return;
185 } 186 }
186
187 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, 187 GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
188 NULL); 188 NULL);
189 189
diff --git a/src/gns/nss/nss_gns.c b/src/gns/nss/nss_gns.c
index 9c9233d35..58aab47fd 100644
--- a/src/gns/nss/nss_gns.c
+++ b/src/gns/nss/nss_gns.c
@@ -54,121 +54,126 @@
54 * @return a nss_status code 54 * @return a nss_status code
55 */ 55 */
56enum nss_status 56enum nss_status
57_nss_gns_gethostbyname2_r( 57_nss_gns_gethostbyname2_r(const char *name,
58 const char *name, 58 int af,
59 int af, 59 struct hostent *result,
60 struct hostent * result, 60 char *buffer,
61 char *buffer, 61 size_t buflen,
62 size_t buflen, 62 int *errnop,
63 int *errnop, 63 int *h_errnop)
64 int *h_errnop) { 64{
65 65 struct userdata u;
66 struct userdata u; 66 enum nss_status status = NSS_STATUS_UNAVAIL;
67 enum nss_status status = NSS_STATUS_UNAVAIL; 67 int i;
68 int i; 68 size_t address_length;
69 size_t address_length, l, idx, astart; 69 size_t l;
70 70 size_t idx;
71 if (af == AF_UNSPEC) 71 size_t astart;
72
73 if (af == AF_UNSPEC)
72#ifdef NSS_IPV6_ONLY 74#ifdef NSS_IPV6_ONLY
73 af = AF_INET6; 75 af = AF_INET6;
74#else 76#else
75 af = AF_INET; 77 af = AF_INET;
76#endif 78#endif
77 79
78#ifdef NSS_IPV4_ONLY 80#ifdef NSS_IPV4_ONLY
79 if (af != AF_INET) 81 if (af != AF_INET)
80#elif NSS_IPV6_ONLY 82#elif NSS_IPV6_ONLY
81 if (af != AF_INET6) 83 if (af != AF_INET6)
82#else 84#else
83 if (af != AF_INET && af != AF_INET6) 85 if ( (af != AF_INET) &&
86 (af != AF_INET6) )
84#endif 87#endif
85 { 88 {
86 *errnop = EINVAL; 89 *errnop = EINVAL;
87 *h_errnop = NO_RECOVERY; 90 *h_errnop = NO_RECOVERY;
88 91
89 goto finish; 92 goto finish;
90 } 93 }
91
92 address_length = af == AF_INET ? sizeof(ipv4_address_t) : sizeof(ipv6_address_t);
93 if (buflen <
94 sizeof(char*)+ /* alias names */
95 strlen(name)+1) { /* official name */
96
97 *errnop = ERANGE;
98 *h_errnop = NO_RECOVERY;
99 status = NSS_STATUS_TRYAGAIN;
100
101 goto finish;
102 }
103
104 u.count = 0;
105 u.data_len = 0;
106
107 i = gns_resolve_name(af, name, &u);
108 if (-3 == i)
109 {
110 status = NSS_STATUS_NOTFOUND;
111 goto finish;
112 }
113 if (-2 == i)
114 {
115 status = NSS_STATUS_UNAVAIL;
116 goto finish;
117 }
118 if ( (-1 == i) ||
119 (u.count == 0) )
120 {
121 *errnop = ETIMEDOUT;
122 *h_errnop = HOST_NOT_FOUND;
123 status = NSS_STATUS_NOTFOUND;
124 goto finish;
125 }
126
127
128 /* Alias names */
129 *((char**) buffer) = NULL;
130 result->h_aliases = (char**) buffer;
131 idx = sizeof(char*);
132
133 /* Official name */
134 strcpy(buffer+idx, name);
135 result->h_name = buffer+idx;
136 idx += strlen(name)+1;
137
138 ALIGN(idx);
139
140 result->h_addrtype = af;
141 result->h_length = address_length;
142
143 /* Check if there's enough space for the addresses */
144 if (buflen < idx+u.data_len+sizeof(char*)*(u.count+1)) {
145 *errnop = ERANGE;
146 *h_errnop = NO_RECOVERY;
147 status = NSS_STATUS_TRYAGAIN;
148 goto finish;
149 }
150 94
95 address_length = (af == AF_INET) ? sizeof(ipv4_address_t) : sizeof(ipv6_address_t);
96 if (buflen <
97 sizeof(char*)+ /* alias names */
98 strlen(name)+1)
99 { /* official name */
100 *errnop = ERANGE;
101 *h_errnop = NO_RECOVERY;
102 status = NSS_STATUS_TRYAGAIN;
103
104 goto finish;
105 }
106 u.count = 0;
107 u.data_len = 0;
108 i = gns_resolve_name (af,
109 name,
110 &u);
111 if (-3 == i)
112 {
113 status = NSS_STATUS_NOTFOUND;
114 goto finish;
115 }
116 if (-2 == i)
117 {
118 status = NSS_STATUS_UNAVAIL;
119 goto finish;
120 }
121 if ( (-1 == i) ||
122 (u.count == 0) )
123 {
124 *errnop = ETIMEDOUT;
125 *h_errnop = HOST_NOT_FOUND;
126 status = NSS_STATUS_NOTFOUND;
127 goto finish;
128 }
129 /* Alias names */
130 *((char**) buffer) = NULL;
131 result->h_aliases = (char**) buffer;
132 idx = sizeof(char*);
133
134 /* Official name */
135 strcpy (buffer+idx,
136 name);
137 result->h_name = buffer+idx;
138 idx += strlen (name)+1;
139
140 ALIGN(idx);
141
142 result->h_addrtype = af;
143 result->h_length = address_length;
144
145 /* Check if there's enough space for the addresses */
146 if (buflen < idx+u.data_len+sizeof(char*)*(u.count+1))
147 {
148 *errnop = ERANGE;
149 *h_errnop = NO_RECOVERY;
150 status = NSS_STATUS_TRYAGAIN;
151 goto finish;
152 }
151 /* Addresses */ 153 /* Addresses */
152 astart = idx; 154 astart = idx;
153 l = u.count*address_length; 155 l = u.count*address_length;
154 if (0 != l) 156 if (0 != l)
155 memcpy(buffer+astart, &u.data, l); 157 memcpy (buffer+astart,
156 /* address_length is a multiple of 32bits, so idx is still aligned 158 &u.data,
157 * correctly */ 159 l);
158 idx += l; 160 /* address_length is a multiple of 32bits, so idx is still aligned
159 161 * correctly */
160 /* Address array address_length is always a multiple of 32bits */ 162 idx += l;
161 for (i = 0; i < u.count; i++) 163
162 ((char**) (buffer+idx))[i] = buffer+astart+address_length*i; 164 /* Address array address_length is always a multiple of 32bits */
163 ((char**) (buffer+idx))[i] = NULL; 165 for (i = 0; i < u.count; i++)
164 result->h_addr_list = (char**) (buffer+idx); 166 ((char**) (buffer+idx))[i] = buffer+astart+address_length*i;
165 167 ((char**) (buffer+idx))[i] = NULL;
166 status = NSS_STATUS_SUCCESS; 168 result->h_addr_list = (char**) (buffer+idx);
169
170 status = NSS_STATUS_SUCCESS;
167 171
168finish: 172finish:
169 return status; 173 return status;
170} 174}
171 175
176
172/** 177/**
173 * The gethostbyname hook executed by nsswitch 178 * The gethostbyname hook executed by nsswitch
174 * 179 *
@@ -176,29 +181,28 @@ finish:
176 * @param result the result hostent 181 * @param result the result hostent
177 * @param buffer the result buffer 182 * @param buffer the result buffer
178 * @param buflen length of the buffer 183 * @param buflen length of the buffer
179 * @param errnop idk 184 * @param errnop[out] the low-level error code to return to the application
180 * @param h_errnop idk 185 * @param h_errnop idk
181 * @return a nss_status code 186 * @return a nss_status code
182 */ 187 */
183enum nss_status 188enum nss_status
184_nss_gns_gethostbyname_r ( 189_nss_gns_gethostbyname_r (const char *name,
185 const char *name, 190 struct hostent *result,
186 struct hostent *result, 191 char *buffer,
187 char *buffer, 192 size_t buflen,
188 size_t buflen, 193 int *errnop,
189 int *errnop, 194 int *h_errnop)
190 int *h_errnop) { 195{
191 196 return _nss_gns_gethostbyname2_r (name,
192 return _nss_gns_gethostbyname2_r( 197 AF_UNSPEC,
193 name, 198 result,
194 AF_UNSPEC, 199 buffer,
195 result, 200 buflen,
196 buffer, 201 errnop,
197 buflen, 202 h_errnop);
198 errnop,
199 h_errnop);
200} 203}
201 204
205
202/** 206/**
203 * The gethostbyaddr hook executed by nsswitch 207 * The gethostbyaddr hook executed by nsswitch
204 * We can't do this so we always return NSS_STATUS_UNAVAIL 208 * We can't do this so we always return NSS_STATUS_UNAVAIL
@@ -209,23 +213,22 @@ _nss_gns_gethostbyname_r (
209 * @param result the result hostent 213 * @param result the result hostent
210 * @param buffer the result buffer 214 * @param buffer the result buffer
211 * @param buflen length of the buffer 215 * @param buflen length of the buffer
212 * @param errnop idk 216 * @param errnop[out] the low-level error code to return to the application
213 * @param h_errnop idk 217 * @param h_errnop idk
214 * @return NSS_STATUS_UNAVAIL 218 * @return NSS_STATUS_UNAVAIL
215 */ 219 */
216enum nss_status 220enum nss_status
217_nss_gns_gethostbyaddr_r( 221_nss_gns_gethostbyaddr_r (const void* addr,
218 const void* addr, 222 int len,
219 int len, 223 int af,
220 int af, 224 struct hostent *result,
221 struct hostent *result, 225 char *buffer,
222 char *buffer, 226 size_t buflen,
223 size_t buflen, 227 int *errnop,
224 int *errnop, 228 int *h_errnop)
225 int *h_errnop) { 229{
226 230 *errnop = EINVAL;
227 *errnop = EINVAL; 231 *h_errnop = NO_RECOVERY;
228 *h_errnop = NO_RECOVERY; 232 //NOTE we allow to leak this into DNS so no NOTFOUND
229 //NOTE we allow to leak this into DNS so no NOTFOUND 233 return NSS_STATUS_UNAVAIL;
230 return NSS_STATUS_UNAVAIL;
231} 234}
diff --git a/src/gns/nss/nss_gns_query.c b/src/gns/nss/nss_gns_query.c
index 094e25ed5..867ead624 100644
--- a/src/gns/nss/nss_gns_query.c
+++ b/src/gns/nss/nss_gns_query.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -48,14 +48,16 @@ gns_resolve_name (int af,
48 { 48 {
49 if (-1 == asprintf (&cmd, 49 if (-1 == asprintf (&cmd,
50 "%s -t AAAA -u %s\n", 50 "%s -t AAAA -u %s\n",
51 "gnunet-gns -r", name)) 51 "gnunet-gns -r",
52 name))
52 return -1; 53 return -1;
53 } 54 }
54 else 55 else
55 { 56 {
56 if (-1 == asprintf (&cmd, 57 if (-1 == asprintf (&cmd,
57 "%s %s\n", 58 "%s %s\n",
58 "gnunet-gns -r -u", name)) 59 "gnunet-gns -r -u",
60 name))
59 return -1; 61 return -1;
60 } 62 }
61 if (NULL == (p = popen (cmd, "r"))) 63 if (NULL == (p = popen (cmd, "r")))
@@ -63,7 +65,9 @@ gns_resolve_name (int af,
63 free (cmd); 65 free (cmd);
64 return -1; 66 return -1;
65 } 67 }
66 while (NULL != fgets (line, sizeof(line), p)) 68 while (NULL != fgets (line,
69 sizeof(line),
70 p))
67 { 71 {
68 if (u->count >= MAX_ENTRIES) 72 if (u->count >= MAX_ENTRIES)
69 break; 73 break;
@@ -72,7 +76,9 @@ gns_resolve_name (int af,
72 line[strlen(line)-1] = '\0'; 76 line[strlen(line)-1] = '\0';
73 if (AF_INET == af) 77 if (AF_INET == af)
74 { 78 {
75 if (inet_pton(af, line, &(u->data.ipv4[u->count]))) 79 if (inet_pton(af,
80 line,
81 &u->data.ipv4[u->count]))
76 { 82 {
77 u->count++; 83 u->count++;
78 u->data_len += sizeof(ipv4_address_t); 84 u->data_len += sizeof(ipv4_address_t);
@@ -86,7 +92,9 @@ gns_resolve_name (int af,
86 } 92 }
87 else if (AF_INET6 == af) 93 else if (AF_INET6 == af)
88 { 94 {
89 if (inet_pton(af, line, &(u->data.ipv6[u->count]))) 95 if (inet_pton(af,
96 line,
97 &u->data.ipv6[u->count]))
90 { 98 {
91 u->count++; 99 u->count++;
92 u->data_len += sizeof(ipv6_address_t); 100 u->data_len += sizeof(ipv6_address_t);
@@ -105,7 +113,10 @@ gns_resolve_name (int af,
105 if (4 == ret) 113 if (4 == ret)
106 return -2; /* not for GNS */ 114 return -2; /* not for GNS */
107 if (3 == ret) 115 if (3 == ret)
108 return -3; /* timeout */ 116 return -3; /* timeout -> not found */
117 if ( (2 == ret) || (1 == ret) )
118 return -2; /* launch failure -> service unavailable */
109 return 0; 119 return 0;
110} 120}
121
111/* end of nss_gns_query.c */ 122/* end of nss_gns_query.c */
diff --git a/src/gns/nss/nss_gns_query.h b/src/gns/nss/nss_gns_query.h
index bb04f9004..48cab4b22 100644
--- a/src/gns/nss/nss_gns_query.h
+++ b/src/gns/nss/nss_gns_query.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -26,25 +26,30 @@
26/* Maximum number of entries to return */ 26/* Maximum number of entries to return */
27#define MAX_ENTRIES 16 27#define MAX_ENTRIES 16
28 28
29typedef struct { 29typedef struct
30 uint32_t address; 30{
31 uint32_t address;
31} ipv4_address_t; 32} ipv4_address_t;
32 33
33typedef struct { 34
34 uint8_t address[16]; 35typedef struct
36{
37 uint8_t address[16];
35} ipv6_address_t; 38} ipv6_address_t;
36 39
37 40
38struct userdata { 41struct userdata
42{
39 int count; 43 int count;
40 int data_len; /* only valid when doing reverse lookup */ 44 int data_len; /* only valid when doing reverse lookup */
41 union { 45 union {
42 ipv4_address_t ipv4[MAX_ENTRIES]; 46 ipv4_address_t ipv4[MAX_ENTRIES];
43 ipv6_address_t ipv6[MAX_ENTRIES]; 47 ipv6_address_t ipv6[MAX_ENTRIES];
44 char *name[MAX_ENTRIES]; 48 char *name[MAX_ENTRIES];
45 } data; 49 } data;
46}; 50};
47 51
52
48/** 53/**
49 * Wrapper function that uses gnunet-gns cli tool to resolve 54 * Wrapper function that uses gnunet-gns cli tool to resolve
50 * an IPv4/6 address. 55 * an IPv4/6 address.
@@ -54,8 +59,9 @@ struct userdata {
54 * @param u the userdata (result struct) 59 * @param u the userdata (result struct)
55 * @return -1 on error else 0 60 * @return -1 on error else 0
56 */ 61 */
57int gns_resolve_name(int af, 62int
58 const char *name, 63gns_resolve_name(int af,
59 struct userdata *userdata); 64 const char *name,
65 struct userdata *userdata);
60 66
61#endif 67#endif
diff --git a/src/identity-provider/plugin_rest_openid_connect.c b/src/identity-provider/plugin_rest_openid_connect.c
index d87a345cf..9c2f7fb3d 100644
--- a/src/identity-provider/plugin_rest_openid_connect.c
+++ b/src/identity-provider/plugin_rest_openid_connect.c
@@ -732,6 +732,8 @@ cookie_identity_interpretation (struct RequestHandle *handle)
732 { 732 {
733 handle->oidc->login_identity = strtok(handle->oidc->login_identity, OIDC_COOKIE_HEADER_INFORMATION_KEY); 733 handle->oidc->login_identity = strtok(handle->oidc->login_identity, OIDC_COOKIE_HEADER_INFORMATION_KEY);
734 handle->oidc->login_identity = GNUNET_strdup(handle->oidc->login_identity); 734 handle->oidc->login_identity = GNUNET_strdup(handle->oidc->login_identity);
735 } else {
736 handle->oidc->login_identity = NULL;
735 } 737 }
736 } 738 }
737 else 739 else
@@ -1014,10 +1016,11 @@ login_check (void *cls)
1014 return; 1016 return;
1015 } 1017 }
1016 } 1018 }
1017 handle->emsg = GNUNET_strdup("invalid_cookie"); 1019 //handle->emsg = GNUNET_strdup("invalid_cookie");
1018 handle->edesc = GNUNET_strdup( 1020 //handle->edesc = GNUNET_strdup(
1019 "The cookie of the login identity is not valid"); 1021 // "The cookie of the login identity is not valid");
1020 GNUNET_SCHEDULER_add_now (&do_redirect_error, handle); 1022 //GNUNET_SCHEDULER_add_now (&do_redirect_error, handle);
1023 GNUNET_SCHEDULER_add_now (&login_redirection,handle);
1021 return; 1024 return;
1022 } 1025 }
1023 } 1026 }
@@ -1359,8 +1362,8 @@ login_cont (struct GNUNET_REST_RequestHandle *con_handle,
1359 1362
1360 current_time = GNUNET_new(struct GNUNET_TIME_Absolute); 1363 current_time = GNUNET_new(struct GNUNET_TIME_Absolute);
1361 *current_time = GNUNET_TIME_relative_to_absolute ( 1364 *current_time = GNUNET_TIME_relative_to_absolute (
1362 GNUNET_TIME_relative_multiply (GNUNET_TIME_relative_get_minute_ (), 1365 GNUNET_TIME_relative_multiply (GNUNET_TIME_relative_get_second_ (),
1363 30)); 1366 5));
1364 last_time = GNUNET_CONTAINER_multihashmap_get(OIDC_identity_login_time, &cache_key); 1367 last_time = GNUNET_CONTAINER_multihashmap_get(OIDC_identity_login_time, &cache_key);
1365 if (NULL != last_time) 1368 if (NULL != last_time)
1366 { 1369 {
diff --git a/src/identity/identity_api_lookup.c b/src/identity/identity_api_lookup.c
index 593a5dbb0..25aec8ede 100644
--- a/src/identity/identity_api_lookup.c
+++ b/src/identity/identity_api_lookup.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -131,6 +131,12 @@ GNUNET_IDENTITY_ego_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg,
131 el->identity = GNUNET_IDENTITY_connect (cfg, 131 el->identity = GNUNET_IDENTITY_connect (cfg,
132 &identity_cb, 132 &identity_cb,
133 el); 133 el);
134 if (NULL == el->identity)
135 {
136 GNUNET_free (el->name);
137 GNUNET_free (el);
138 return NULL;
139 }
134 return el; 140 return el;
135} 141}
136 142
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index 16f23e86c..ec73f1803 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -888,6 +888,7 @@ shutdown_op (void *cls)
888 if (NULL != post_test_task) 888 if (NULL != post_test_task)
889 { 889 {
890 GNUNET_SCHEDULER_cancel (post_test_task); 890 GNUNET_SCHEDULER_cancel (post_test_task);
891 post_test_task = NULL;
891 } 892 }
892 if (NULL != churn_task) 893 if (NULL != churn_task)
893 { 894 {
@@ -899,6 +900,7 @@ shutdown_op (void *cls)
899 if (NULL != rps_peers[i].rps_handle) 900 if (NULL != rps_peers[i].rps_handle)
900 { 901 {
901 GNUNET_RPS_disconnect (rps_peers[i].rps_handle); 902 GNUNET_RPS_disconnect (rps_peers[i].rps_handle);
903 rps_peers[i].rps_handle = NULL;
902 } 904 }
903 if (NULL != rps_peers[i].op) 905 if (NULL != rps_peers[i].op)
904 { 906 {
@@ -2570,7 +2572,7 @@ test_run (void *cls,
2570 if (NULL != churn_task) 2572 if (NULL != churn_task)
2571 GNUNET_SCHEDULER_cancel (churn_task); 2573 GNUNET_SCHEDULER_cancel (churn_task);
2572 post_test_task = GNUNET_SCHEDULER_add_delayed (timeout, &post_test_op, NULL); 2574 post_test_task = GNUNET_SCHEDULER_add_delayed (timeout, &post_test_op, NULL);
2573 timeout = GNUNET_TIME_relative_multiply (timeout, 1 + (0.1 * num_peers)); 2575 timeout = GNUNET_TIME_relative_multiply (timeout, 1.2 + (0.01 * num_peers));
2574 shutdown_task = GNUNET_SCHEDULER_add_shutdown (shutdown_op, NULL); 2576 shutdown_task = GNUNET_SCHEDULER_add_shutdown (shutdown_op, NULL);
2575 shutdown_task = GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_op, NULL); 2577 shutdown_task = GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_op, NULL);
2576 2578
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 84fb33be2..db09c68d2 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -1045,12 +1045,10 @@ restore_valid_peers ()
1045 */ 1045 */
1046void 1046void
1047Peers_initialise (char* fn_valid_peers, 1047Peers_initialise (char* fn_valid_peers,
1048 struct GNUNET_CADET_Handle *cadet_h, 1048 struct GNUNET_CADET_Handle *cadet_h)
1049 const struct GNUNET_PeerIdentity *own_id)
1050{ 1049{
1051 filename_valid_peers = GNUNET_strdup (fn_valid_peers); 1050 filename_valid_peers = GNUNET_strdup (fn_valid_peers);
1052 cadet_handle = cadet_h; 1051 cadet_handle = cadet_h;
1053 own_identity = *own_id;
1054 peer_map = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO); 1052 peer_map = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO);
1055 valid_peers = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO); 1053 valid_peers = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO);
1056 restore_valid_peers (); 1054 restore_valid_peers ();
@@ -1136,14 +1134,12 @@ Peers_get_valid_peers (PeersIterator iterator,
1136 * @param peer the new #GNUNET_PeerIdentity 1134 * @param peer the new #GNUNET_PeerIdentity
1137 * 1135 *
1138 * @return #GNUNET_YES if peer was inserted 1136 * @return #GNUNET_YES if peer was inserted
1139 * #GNUNET_NO otherwise (if peer was already known or 1137 * #GNUNET_NO otherwise
1140 * peer was #own_identity)
1141 */ 1138 */
1142int 1139int
1143Peers_insert_peer (const struct GNUNET_PeerIdentity *peer) 1140Peers_insert_peer (const struct GNUNET_PeerIdentity *peer)
1144{ 1141{
1145 if ( (GNUNET_YES == Peers_check_peer_known (peer)) || 1142 if (GNUNET_YES == Peers_check_peer_known (peer))
1146 (0 == GNUNET_CRYPTO_cmp_peer_identity (peer, &own_identity)) )
1147 { 1143 {
1148 return GNUNET_NO; /* We already know this peer - nothing to do */ 1144 return GNUNET_NO; /* We already know this peer - nothing to do */
1149 } 1145 }
@@ -1161,8 +1157,7 @@ Peers_check_peer_flag (const struct GNUNET_PeerIdentity *peer, enum Peers_PeerFl
1161 * 1157 *
1162 * @param peer the peer whose liveliness is to be checked 1158 * @param peer the peer whose liveliness is to be checked
1163 * @return #GNUNET_YES if peer had to be inserted 1159 * @return #GNUNET_YES if peer had to be inserted
1164 * #GNUNET_NO otherwise (if peer was already known or 1160 * #GNUNET_NO otherwise
1165 * peer was #own_identity)
1166 */ 1161 */
1167int 1162int
1168Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer) 1163Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer)
@@ -1170,10 +1165,6 @@ Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer)
1170 struct PeerContext *peer_ctx; 1165 struct PeerContext *peer_ctx;
1171 int ret; 1166 int ret;
1172 1167
1173 if (0 == GNUNET_CRYPTO_cmp_peer_identity (peer, &own_identity))
1174 {
1175 return GNUNET_NO;
1176 }
1177 ret = Peers_insert_peer (peer); 1168 ret = Peers_insert_peer (peer);
1178 peer_ctx = get_peer_ctx (peer); 1169 peer_ctx = get_peer_ctx (peer);
1179 if (GNUNET_NO == Peers_check_peer_flag (peer, Peers_ONLINE)) 1170 if (GNUNET_NO == Peers_check_peer_flag (peer, Peers_ONLINE))
@@ -1666,10 +1657,11 @@ Peers_cleanup_destroyed_channel (void *cls,
1666{ 1657{
1667 struct GNUNET_PeerIdentity *peer = cls; 1658 struct GNUNET_PeerIdentity *peer = cls;
1668 struct PeerContext *peer_ctx; 1659 struct PeerContext *peer_ctx;
1660 uint32_t *channel_flag;
1669 1661
1670 if (GNUNET_NO == Peers_check_peer_known (peer)) 1662 if (GNUNET_NO == Peers_check_peer_known (peer))
1671 {/* We don't want to implicitly create a context that we're about to kill */ 1663 {/* We don't want to implicitly create a context that we're about to kill */
1672 LOG (GNUNET_ERROR_TYPE_DEBUG, 1664 LOG (GNUNET_ERROR_TYPE_WARNING,
1673 "channel (%s) without associated context was destroyed\n", 1665 "channel (%s) without associated context was destroyed\n",
1674 GNUNET_i2s (peer)); 1666 GNUNET_i2s (peer));
1675 return; 1667 return;
@@ -1697,12 +1689,16 @@ Peers_cleanup_destroyed_channel (void *cls,
1697 if (NULL != peer_ctx->send_channel) 1689 if (NULL != peer_ctx->send_channel)
1698 { 1690 {
1699 GNUNET_CADET_channel_destroy (peer_ctx->send_channel); 1691 GNUNET_CADET_channel_destroy (peer_ctx->send_channel);
1692 channel_flag = Peers_get_channel_flag (&peer_ctx->peer_id, Peers_CHANNEL_ROLE_SENDING);
1693 Peers_set_channel_flag (channel_flag, Peers_CHANNEL_DESTROING);
1700 peer_ctx->send_channel = NULL; 1694 peer_ctx->send_channel = NULL;
1701 peer_ctx->mq = NULL; 1695 peer_ctx->mq = NULL;
1702 } 1696 }
1703 if (NULL != peer_ctx->recv_channel) 1697 if (NULL != peer_ctx->recv_channel)
1704 { 1698 {
1705 GNUNET_CADET_channel_destroy (peer_ctx->recv_channel); 1699 GNUNET_CADET_channel_destroy (peer_ctx->recv_channel);
1700 channel_flag = Peers_get_channel_flag (&peer_ctx->peer_id, Peers_CHANNEL_ROLE_RECEIVING);
1701 Peers_set_channel_flag (channel_flag, Peers_CHANNEL_DESTROING);
1706 peer_ctx->recv_channel = NULL; 1702 peer_ctx->recv_channel = NULL;
1707 } 1703 }
1708 /* Set the #Peers_ONLINE flag accordingly */ 1704 /* Set the #Peers_ONLINE flag accordingly */
@@ -1786,10 +1782,6 @@ Peers_schedule_operation (const struct GNUNET_PeerIdentity *peer,
1786 struct PeerPendingOp pending_op; 1782 struct PeerPendingOp pending_op;
1787 struct PeerContext *peer_ctx; 1783 struct PeerContext *peer_ctx;
1788 1784
1789 if (0 == GNUNET_CRYPTO_cmp_peer_identity (peer, &own_identity))
1790 {
1791 return GNUNET_NO;
1792 }
1793 GNUNET_assert (GNUNET_YES == Peers_check_peer_known (peer)); 1785 GNUNET_assert (GNUNET_YES == Peers_check_peer_known (peer));
1794 1786
1795 //TODO if LIVE/ONLINE execute immediately 1787 //TODO if LIVE/ONLINE execute immediately
@@ -3368,9 +3360,7 @@ handle_peer_pull_reply (void *cls,
3368 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (att_peer_set, 3360 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (att_peer_set,
3369 &peers[i]) 3361 &peers[i])
3370 && GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (mal_peer_set, 3362 && GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (mal_peer_set,
3371 &peers[i]) 3363 &peers[i]))
3372 && 0 != GNUNET_CRYPTO_cmp_peer_identity (&peers[i],
3373 &own_identity))
3374 { 3364 {
3375 tmp_att_peer = GNUNET_new (struct AttackedPeer); 3365 tmp_att_peer = GNUNET_new (struct AttackedPeer);
3376 tmp_att_peer->peer_id = peers[i]; 3366 tmp_att_peer->peer_id = peers[i];
@@ -3382,21 +3372,17 @@ handle_peer_pull_reply (void *cls,
3382 continue; 3372 continue;
3383 } 3373 }
3384 #endif /* ENABLE_MALICIOUS */ 3374 #endif /* ENABLE_MALICIOUS */
3385 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&own_identity, 3375 /* Make sure we 'know' about this peer */
3386 &peers[i])) 3376 (void) Peers_insert_peer (&peers[i]);
3387 {
3388 /* Make sure we 'know' about this peer */
3389 (void) Peers_insert_peer (&peers[i]);
3390 3377
3391 if (GNUNET_YES == Peers_check_peer_valid (&peers[i])) 3378 if (GNUNET_YES == Peers_check_peer_valid (&peers[i]))
3392 { 3379 {
3393 CustomPeerMap_put (pull_map, &peers[i]); 3380 CustomPeerMap_put (pull_map, &peers[i]);
3394 } 3381 }
3395 else 3382 else
3396 { 3383 {
3397 Peers_schedule_operation (&peers[i], insert_in_pull_map); 3384 Peers_schedule_operation (&peers[i], insert_in_pull_map);
3398 (void) Peers_issue_peer_liveliness_check (&peers[i]); 3385 (void) Peers_issue_peer_liveliness_check (&peers[i]);
3399 }
3400 } 3386 }
3401 } 3387 }
3402 3388
@@ -3831,10 +3817,8 @@ do_round (void *cls)
3831 for (i = 0; i < a_peers; i++) 3817 for (i = 0; i < a_peers; i++)
3832 { 3818 {
3833 peer = view_array[permut[i]]; 3819 peer = view_array[permut[i]];
3834 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&own_identity, &peer)) // TODO 3820 // FIXME if this fails schedule/loop this for later
3835 { // FIXME if this fails schedule/loop this for later 3821 send_push (&peer);
3836 send_push (&peer);
3837 }
3838 } 3822 }
3839 3823
3840 /* Send PULL requests */ 3824 /* Send PULL requests */
@@ -3852,8 +3836,7 @@ do_round (void *cls)
3852 for (i = first_border; i < second_border; i++) 3836 for (i = first_border; i < second_border; i++)
3853 { 3837 {
3854 peer = view_array[permut[i]]; 3838 peer = view_array[permut[i]];
3855 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&own_identity, &peer) && 3839 if ( GNUNET_NO == Peers_check_peer_flag (&peer, Peers_PULL_REPLY_PENDING))
3856 GNUNET_NO == Peers_check_peer_flag (&peer, Peers_PULL_REPLY_PENDING)) // TODO
3857 { // FIXME if this fails schedule/loop this for later 3840 { // FIXME if this fails schedule/loop this for later
3858 send_pull_request (&peer); 3841 send_pull_request (&peer);
3859 } 3842 }
@@ -4367,7 +4350,7 @@ run (void *cls,
4367 4350
4368 4351
4369 peerinfo_handle = GNUNET_PEERINFO_connect (cfg); 4352 peerinfo_handle = GNUNET_PEERINFO_connect (cfg);
4370 Peers_initialise (fn_valid_peers, cadet_handle, &own_identity); 4353 Peers_initialise (fn_valid_peers, cadet_handle);
4371 GNUNET_free (fn_valid_peers); 4354 GNUNET_free (fn_valid_peers);
4372 4355
4373 /* Initialise sampler */ 4356 /* Initialise sampler */
diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c
index d47e4952f..08fe96097 100644
--- a/src/rps/rps-test_util.c
+++ b/src/rps/rps-test_util.c
@@ -31,6 +31,17 @@
31 31
32#define LOG(kind, ...) GNUNET_log_from(kind,"rps-test_util",__VA_ARGS__) 32#define LOG(kind, ...) GNUNET_log_from(kind,"rps-test_util",__VA_ARGS__)
33 33
34#define B2B_PAT "%c%c%c%c%c%c%c%c"
35#define B2B(byte) \
36 (byte & 0x80 ? '1' : '0'), \
37 (byte & 0x40 ? '1' : '0'), \
38 (byte & 0x20 ? '1' : '0'), \
39 (byte & 0x10 ? '1' : '0'), \
40 (byte & 0x08 ? '1' : '0'), \
41 (byte & 0x04 ? '1' : '0'), \
42 (byte & 0x02 ? '1' : '0'), \
43 (byte & 0x01 ? '1' : '0')
44
34#ifndef TO_FILE 45#ifndef TO_FILE
35#define TO_FILE 46#define TO_FILE
36#endif /* TO_FILE */ 47#endif /* TO_FILE */
@@ -155,6 +166,9 @@ to_file_raw (const char *file_name, const char *buf, size_t size_buf)
155 166
156 return; 167 return;
157 } 168 }
169 LOG (GNUNET_ERROR_TYPE_WARNING,
170 "Wrote %u bytes raw.\n",
171 size_written);
158 if (GNUNET_YES != GNUNET_DISK_file_close (f)) 172 if (GNUNET_YES != GNUNET_DISK_file_close (f))
159 LOG (GNUNET_ERROR_TYPE_WARNING, 173 LOG (GNUNET_ERROR_TYPE_WARNING,
160 "Unable to close file\n"); 174 "Unable to close file\n");
@@ -180,6 +194,8 @@ to_file_raw_unaligned (const char *file_name,
180 // num_bits_buf_unaligned = bits_needed % 8; 194 // num_bits_buf_unaligned = bits_needed % 8;
181 // return; 195 // return;
182 //} 196 //}
197 LOG (GNUNET_ERROR_TYPE_DEBUG,
198 "Was asked to write %u bits\n", bits_needed);
183 199
184 char buf_write[size_buf + 1]; 200 char buf_write[size_buf + 1];
185 const unsigned bytes_iter = (0 != bits_needed % 8? 201 const unsigned bytes_iter = (0 != bits_needed % 8?
@@ -187,6 +203,14 @@ to_file_raw_unaligned (const char *file_name,
187 bits_needed/8); 203 bits_needed/8);
188 // TODO what if no iteration happens? 204 // TODO what if no iteration happens?
189 unsigned size_buf_write = 0; 205 unsigned size_buf_write = 0;
206 LOG (GNUNET_ERROR_TYPE_DEBUG,
207 "num_bits_buf_unaligned: %u\n",
208 num_bits_buf_unaligned);
209 LOG (GNUNET_ERROR_TYPE_DEBUG,
210 "ua args: size_buf: %u, bits_needed: %u -> iter: %u\n",
211 size_buf,
212 bits_needed,
213 bytes_iter);
190 buf_write[0] = buf_unaligned; 214 buf_write[0] = buf_unaligned;
191 /* Iterate over input bytes */ 215 /* Iterate over input bytes */
192 for (unsigned i = 0; i < bytes_iter; i++) 216 for (unsigned i = 0; i < bytes_iter; i++)
@@ -227,17 +251,57 @@ to_file_raw_unaligned (const char *file_name,
227 { 251 {
228 num_bits_needed_iter = 8; 252 num_bits_needed_iter = 8;
229 } 253 }
254 LOG (GNUNET_ERROR_TYPE_DEBUG,
255 "number of bits needed in this iteration: %u\n",
256 num_bits_needed_iter);
230 mask_bits_needed_iter = ((char) 1 << num_bits_needed_iter) - 1; 257 mask_bits_needed_iter = ((char) 1 << num_bits_needed_iter) - 1;
258 LOG (GNUNET_ERROR_TYPE_DEBUG,
259 "mask needed bits (current iter): "B2B_PAT"\n",
260 B2B(mask_bits_needed_iter));
261 LOG (GNUNET_ERROR_TYPE_DEBUG,
262 "Unaligned byte: "B2B_PAT" (%u bits)\n",
263 B2B(buf_unaligned),
264 num_bits_buf_unaligned);
231 byte_input = buf[i]; 265 byte_input = buf[i];
266 LOG (GNUNET_ERROR_TYPE_DEBUG,
267 "next whole input byte: "B2B_PAT"\n",
268 B2B(byte_input));
232 byte_input &= mask_bits_needed_iter; 269 byte_input &= mask_bits_needed_iter;
233 num_bits_to_align = 8 - num_bits_buf_unaligned; 270 num_bits_to_align = 8 - num_bits_buf_unaligned;
271 LOG (GNUNET_ERROR_TYPE_DEBUG,
272 "input byte, needed bits: "B2B_PAT"\n",
273 B2B(byte_input));
274 LOG (GNUNET_ERROR_TYPE_DEBUG,
275 "number of bits needed to align unaligned bit: %u\n",
276 num_bits_to_align);
234 num_bits_to_move = min (num_bits_to_align, num_bits_needed_iter); 277 num_bits_to_move = min (num_bits_to_align, num_bits_needed_iter);
278 LOG (GNUNET_ERROR_TYPE_DEBUG,
279 "number of bits of new byte to move: %u\n",
280 num_bits_to_move);
235 mask_input_to_move = ((char) 1 << num_bits_to_move) - 1; 281 mask_input_to_move = ((char) 1 << num_bits_to_move) - 1;
282 LOG (GNUNET_ERROR_TYPE_DEBUG,
283 "mask of bits of new byte to take for moving: "B2B_PAT"\n",
284 B2B(mask_input_to_move));
236 bits_to_move = byte_input & mask_input_to_move; 285 bits_to_move = byte_input & mask_input_to_move;
286 LOG (GNUNET_ERROR_TYPE_DEBUG,
287 "masked bits of new byte to take for moving: "B2B_PAT"\n",
288 B2B(bits_to_move));
237 distance_shift_bits = num_bits_buf_unaligned; 289 distance_shift_bits = num_bits_buf_unaligned;
290 LOG (GNUNET_ERROR_TYPE_DEBUG,
291 "distance needed to shift bits to their correct spot: %u\n",
292 distance_shift_bits);
238 bits_moving = bits_to_move << distance_shift_bits; 293 bits_moving = bits_to_move << distance_shift_bits;
294 LOG (GNUNET_ERROR_TYPE_DEBUG,
295 "shifted, masked bits of new byte being moved: "B2B_PAT"\n",
296 B2B(bits_moving));
239 byte_to_fill = buf_unaligned | bits_moving; 297 byte_to_fill = buf_unaligned | bits_moving;
240 if (num_bits_buf_unaligned + num_bits_needed_iter > 8) 298 LOG (GNUNET_ERROR_TYPE_DEBUG,
299 "byte being filled: "B2B_PAT"\n",
300 B2B(byte_to_fill));
301 LOG (GNUNET_ERROR_TYPE_DEBUG,
302 "pending bytes: %u\n",
303 num_bits_buf_unaligned + num_bits_needed_iter);
304 if (num_bits_buf_unaligned + num_bits_needed_iter >= 8)
241 { 305 {
242 /* buf_unaligned was aligned by filling 306 /* buf_unaligned was aligned by filling
243 * -> can be written to storage */ 307 * -> can be written to storage */
@@ -246,10 +310,22 @@ to_file_raw_unaligned (const char *file_name,
246 310
247 /* store the leftover, unaligned bits in buffer */ 311 /* store the leftover, unaligned bits in buffer */
248 mask_input_leftover = mask_bits_needed_iter & (~ mask_input_to_move); 312 mask_input_leftover = mask_bits_needed_iter & (~ mask_input_to_move);
313 LOG (GNUNET_ERROR_TYPE_DEBUG,
314 "mask of leftover bits of new byte: "B2B_PAT"\n",
315 B2B(mask_input_leftover));
249 byte_input_leftover = byte_input & mask_input_leftover; 316 byte_input_leftover = byte_input & mask_input_leftover;
317 LOG (GNUNET_ERROR_TYPE_DEBUG,
318 "masked, leftover bits of new byte: "B2B_PAT"\n",
319 B2B(byte_input_leftover));
250 num_bits_leftover = num_bits_needed_iter - num_bits_to_move; 320 num_bits_leftover = num_bits_needed_iter - num_bits_to_move;
251 num_bits_discard = 8 - num_bits_needed_iter; 321 LOG (GNUNET_ERROR_TYPE_DEBUG,
322 "number of unaligned bits left: %u\n",
323 num_bits_leftover);
324 //num_bits_discard = 8 - num_bits_needed_iter;
252 byte_unaligned_new = byte_input_leftover >> num_bits_to_move; 325 byte_unaligned_new = byte_input_leftover >> num_bits_to_move;
326 LOG (GNUNET_ERROR_TYPE_DEBUG,
327 "new unaligned byte: "B2B_PAT"\n",
328 B2B(byte_unaligned_new));
253 buf_unaligned = byte_unaligned_new; 329 buf_unaligned = byte_unaligned_new;
254 num_bits_buf_unaligned = num_bits_leftover % 8; 330 num_bits_buf_unaligned = num_bits_leftover % 8;
255 } 331 }
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index 254763b45..1083384f5 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -23,6 +23,7 @@
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_util_lib.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_statistics_service.h"
26#include "gnunet-service-set.h" 27#include "gnunet-service-set.h"
27#include "gnunet_block_lib.h" 28#include "gnunet_block_lib.h"
28#include "gnunet-service-set_protocol.h" 29#include "gnunet-service-set_protocol.h"
@@ -215,6 +216,10 @@ send_client_removed_element (struct Operation *op,
215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 216 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
216 "Sending removed element (size %u) to client\n", 217 "Sending removed element (size %u) to client\n",
217 element->size); 218 element->size);
219 GNUNET_STATISTICS_update (_GSS_statistics,
220 "# Element removed messages sent",
221 1,
222 GNUNET_NO);
218 GNUNET_assert (0 != op->client_request_id); 223 GNUNET_assert (0 != op->client_request_id);
219 ev = GNUNET_MQ_msg_extra (rm, 224 ev = GNUNET_MQ_msg_extra (rm,
220 element->size, 225 element->size,
@@ -406,6 +411,10 @@ fail_intersection_operation (struct Operation *op)
406 411
407 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 412 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
408 "Intersection operation failed\n"); 413 "Intersection operation failed\n");
414 GNUNET_STATISTICS_update (_GSS_statistics,
415 "# Intersection operations failed",
416 1,
417 GNUNET_NO);
409 if (NULL != op->state->my_elements) 418 if (NULL != op->state->my_elements)
410 { 419 {
411 GNUNET_CONTAINER_multihashmap_destroy (op->state->my_elements); 420 GNUNET_CONTAINER_multihashmap_destroy (op->state->my_elements);
@@ -466,6 +475,10 @@ send_bloomfilter (struct Operation *op)
466 op); 475 op);
467 476
468 /* send our Bloom filter */ 477 /* send our Bloom filter */
478 GNUNET_STATISTICS_update (_GSS_statistics,
479 "# Intersection Bloom filters sent",
480 1,
481 GNUNET_NO);
469 chunk_size = 60 * 1024 - sizeof (struct BFMessage); 482 chunk_size = 60 * 1024 - sizeof (struct BFMessage);
470 if (bf_size <= chunk_size) 483 if (bf_size <= chunk_size)
471 { 484 {
@@ -534,6 +547,10 @@ send_client_done_and_destroy (void *cls)
534 547
535 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 548 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
536 "Intersection succeeded, sending DONE to local client\n"); 549 "Intersection succeeded, sending DONE to local client\n");
550 GNUNET_STATISTICS_update (_GSS_statistics,
551 "# Intersection operations succeeded",
552 1,
553 GNUNET_NO);
537 ev = GNUNET_MQ_msg (rm, 554 ev = GNUNET_MQ_msg (rm,
538 GNUNET_MESSAGE_TYPE_SET_RESULT); 555 GNUNET_MESSAGE_TYPE_SET_RESULT);
539 rm->request_id = htonl (op->client_request_id); 556 rm->request_id = htonl (op->client_request_id);
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index c3c14f1ba..c1268948a 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -758,8 +758,8 @@ get_order_from_difference (unsigned int diff)
758 */ 758 */
759static int 759static int
760send_full_element_iterator (void *cls, 760send_full_element_iterator (void *cls,
761 const struct GNUNET_HashCode *key, 761 const struct GNUNET_HashCode *key,
762 void *value) 762 void *value)
763{ 763{
764 struct Operation *op = cls; 764 struct Operation *op = cls;
765 struct GNUNET_SET_ElementMessage *emsg; 765 struct GNUNET_SET_ElementMessage *emsg;
@@ -1371,7 +1371,8 @@ send_client_element (struct Operation *op,
1371 * 1371 *
1372 * @param op operation 1372 * @param op operation
1373 */ 1373 */
1374void destroy_channel (struct Operation *op) 1374static void
1375destroy_channel (struct Operation *op)
1375{ 1376{
1376 struct GNUNET_CADET_Channel *channel; 1377 struct GNUNET_CADET_Channel *channel;
1377 1378
@@ -1404,7 +1405,11 @@ send_client_done (void *cls)
1404 1405
1405 if (PHASE_DONE != op->state->phase) { 1406 if (PHASE_DONE != op->state->phase) {
1406 LOG (GNUNET_ERROR_TYPE_WARNING, 1407 LOG (GNUNET_ERROR_TYPE_WARNING,
1407 "union operation failed\n"); 1408 "Union operation failed\n");
1409 GNUNET_STATISTICS_update (_GSS_statistics,
1410 "# Union operations failed",
1411 1,
1412 GNUNET_NO);
1408 ev = GNUNET_MQ_msg (rm, GNUNET_MESSAGE_TYPE_SET_RESULT); 1413 ev = GNUNET_MQ_msg (rm, GNUNET_MESSAGE_TYPE_SET_RESULT);
1409 rm->result_status = htons (GNUNET_SET_STATUS_FAILURE); 1414 rm->result_status = htons (GNUNET_SET_STATUS_FAILURE);
1410 rm->request_id = htonl (op->client_request_id); 1415 rm->request_id = htonl (op->client_request_id);
@@ -1416,6 +1421,10 @@ send_client_done (void *cls)
1416 1421
1417 op->state->client_done_sent = GNUNET_YES; 1422 op->state->client_done_sent = GNUNET_YES;
1418 1423
1424 GNUNET_STATISTICS_update (_GSS_statistics,
1425 "# Union operations succeeded",
1426 1,
1427 GNUNET_NO);
1419 LOG (GNUNET_ERROR_TYPE_INFO, 1428 LOG (GNUNET_ERROR_TYPE_INFO,
1420 "Signalling client that union operation is done\n"); 1429 "Signalling client that union operation is done\n");
1421 ev = GNUNET_MQ_msg (rm, 1430 ev = GNUNET_MQ_msg (rm,
diff --git a/src/util/.gitignore b/src/util/.gitignore
index 8e7093568..7b190ca76 100644
--- a/src/util/.gitignore
+++ b/src/util/.gitignore
@@ -69,4 +69,7 @@ perf_crypto_hash
69perf_crypto_symmetric 69perf_crypto_symmetric
70perf_crypto_rsa 70perf_crypto_rsa
71perf_crypto_ecc_dlog 71perf_crypto_ecc_dlog
72test_hexcoder test_regex test_tun 72test_hexcoder
73test_regex
74test_tun
75gnunet-timeout
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index ec7bcb016..4ae073c2c 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -166,6 +166,7 @@ lib_LTLIBRARIES = libgnunetutil.la
166 166
167libexec_PROGRAMS = \ 167libexec_PROGRAMS = \
168 gnunet-service-resolver \ 168 gnunet-service-resolver \
169 gnunet-timeout \
169 $(W32CONSOLEHELPER) 170 $(W32CONSOLEHELPER)
170 171
171bin_SCRIPTS =\ 172bin_SCRIPTS =\
@@ -192,6 +193,15 @@ endif
192endif 193endif
193 194
194 195
196if !MINGW
197gnunet_timeout_SOURCES = \
198 gnunet-timeout.c
199else
200gnunet_timeout_SOURCES = \
201 gnunet-timeout-w32.c
202endif
203
204
195do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' 205do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
196 206
197gnunet-qr: gnunet-qr.py.in Makefile 207gnunet-qr: gnunet-qr.py.in Makefile
@@ -334,12 +344,12 @@ test_hexcoder_LDADD = \
334test_tun_SOURCES = \ 344test_tun_SOURCES = \
335 test_tun.c 345 test_tun.c
336test_tun_LDADD = \ 346test_tun_LDADD = \
337 libgnunetutil.la 347 libgnunetutil.la
338 348
339test_regex_SOURCES = \ 349test_regex_SOURCES = \
340 test_regex.c 350 test_regex.c
341test_regex_LDADD = \ 351test_regex_LDADD = \
342 libgnunetutil.la 352 libgnunetutil.la
343 353
344test_os_start_process_SOURCES = \ 354test_os_start_process_SOURCES = \
345 test_os_start_process.c 355 test_os_start_process.c
@@ -622,4 +632,4 @@ EXTRA_DIST = \
622 test_resolver_api_data.conf \ 632 test_resolver_api_data.conf \
623 test_service_data.conf \ 633 test_service_data.conf \
624 test_speedup_data.conf \ 634 test_speedup_data.conf \
625 gnunet-qr.py.in 635 gnunet-qr.py.in
diff --git a/src/util/client.c b/src/util/client.c
index 44e326eab..1f569255a 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -721,6 +721,17 @@ test_service_configuration (const char *service_name,
721 &unixpath)) && 721 &unixpath)) &&
722 (0 < strlen (unixpath))) 722 (0 < strlen (unixpath)))
723 ret = GNUNET_OK; 723 ret = GNUNET_OK;
724 else if ((GNUNET_OK ==
725 GNUNET_CONFIGURATION_have_value (cfg,
726 service_name,
727 "UNIXPATH")))
728 {
729 GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
730 service_name,
731 "UNIXPATH",
732 _("not a valid filename"));
733 return GNUNET_SYSERR; /* UNIXPATH specified but invalid! */
734 }
724 GNUNET_free_non_null (unixpath); 735 GNUNET_free_non_null (unixpath);
725#endif 736#endif
726 737
diff --git a/src/util/dnsparser.c b/src/util/dnsparser.c
index 57d0a014c..6fb6d657f 100644
--- a/src/util/dnsparser.c
+++ b/src/util/dnsparser.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
@@ -956,8 +956,11 @@ GNUNET_DNSPARSER_builder_add_name (char *dst,
956 len = dot - idna_name; 956 len = dot - idna_name;
957 if ( (len >= 64) || (0 == len) ) 957 if ( (len >= 64) || (0 == len) )
958 { 958 {
959 GNUNET_break (0); 959 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
960 goto fail; /* segment too long or empty */ 960 "Invalid DNS name `%s': label with %u characters encountered\n",
961 name,
962 len);
963 goto fail; /* label too long or empty */
961 } 964 }
962 dst[pos++] = (char) (uint8_t) len; 965 dst[pos++] = (char) (uint8_t) len;
963 GNUNET_memcpy (&dst[pos], 966 GNUNET_memcpy (&dst[pos],
diff --git a/contrib/timeout_watchdog_w32.c b/src/util/gnunet-timeout-w32.c
index 901eb6207..78b268fe2 100644
--- a/contrib/timeout_watchdog_w32.c
+++ b/src/util/gnunet-timeout-w32.c
@@ -11,13 +11,13 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
18 18
19/** 19/**
20 * @file contrib/timeout_watchdog_w32.c 20 * @file src/util/gnunet-timeout-w32.c
21 * @brief small tool starting a child process, waiting that it terminates or killing it after a given timeout period 21 * @brief small tool starting a child process, waiting that it terminates or killing it after a given timeout period
22 * @author LRN 22 * @author LRN
23 */ 23 */
@@ -182,7 +182,7 @@ main (int argc, char *argv[])
182 exit (0); 182 exit (0);
183 } 183 }
184 printf ("Child processes were killed after timeout of %u seconds\n", 184 printf ("Child processes were killed after timeout of %u seconds\n",
185 timeout); 185 timeout);
186 TerminateJobObject (job, 1); 186 TerminateJobObject (job, 1);
187 CloseHandle (proc.hProcess); 187 CloseHandle (proc.hProcess);
188 exit (1); 188 exit (1);
diff --git a/contrib/timeout_watchdog.c b/src/util/gnunet-timeout.c
index 70e840d55..8dfb6ad17 100644
--- a/contrib/timeout_watchdog.c
+++ b/src/util/gnunet-timeout.c
@@ -11,13 +11,13 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
18 18
19/** 19/**
20 * @file contrib/timeout_watchdog.c 20 * @file src/util/gnunet-timeout.c
21 * @brief small tool starting a child process, waiting that it terminates or killing it after a given timeout period 21 * @brief small tool starting a child process, waiting that it terminates or killing it after a given timeout period
22 * @author Matthias Wachs 22 * @author Matthias Wachs
23 */ 23 */
@@ -39,25 +39,35 @@ sigchld_handler (int val)
39 int ret = 0; 39 int ret = 0;
40 40
41 (void) val; 41 (void) val;
42 waitpid (child, &status, 0); 42 waitpid (child,
43 &status,
44 0);
43 if (WIFEXITED (status) != 0) 45 if (WIFEXITED (status) != 0)
44 { 46 {
45 ret = WEXITSTATUS (status); 47 ret = WEXITSTATUS (status);
46 printf ("Test process exited with result %u\n", ret); 48 fprintf (stderr,
47 } 49 "Process exited with result %u\n",
50 ret);
51 exit (ret); /* return same status code */
52 }
48 if (WIFSIGNALED (status) != 0) 53 if (WIFSIGNALED (status) != 0)
49 { 54 {
50 ret = WTERMSIG (status); 55 ret = WTERMSIG (status);
51 printf ("Test process was signaled %u\n", ret); 56 fprintf (stderr,
52 } 57 "Process received signal %u\n",
53 exit (ret); 58 ret);
59 kill (getpid (),
60 ret); /* kill self with the same signal */
61 }
62 exit (-1);
54} 63}
55 64
56 65
57static void 66static void
58sigint_handler (int val) 67sigint_handler (int val)
59{ 68{
60 kill (0, val); 69 kill (0,
70 val);
61 exit (val); 71 exit (val);
62} 72}
63 73
@@ -70,18 +80,18 @@ main (int argc,
70 pid_t gpid = 0; 80 pid_t gpid = 0;
71 81
72 if (argc < 3) 82 if (argc < 3)
73 { 83 {
74 printf 84 fprintf (stderr,
75 ("arg 1: timeout in sec., arg 2: executable, arg<n> arguments\n"); 85 "arg 1: timeout in sec., arg 2: executable, arg<n> arguments\n");
76 exit (1); 86 exit (-1);
77 } 87 }
78 88
79 timeout = atoi (argv[1]); 89 timeout = atoi (argv[1]);
80 90
81 if (timeout == 0) 91 if (timeout == 0)
82 timeout = 600; 92 timeout = 600;
83 93
84/* with getpgid() it does not compile, but getpgrp is the BSD version and working */ 94 /* with getpgid() it does not compile, but getpgrp is the BSD version and working */
85 gpid = getpgrp (); 95 gpid = getpgrp ();
86 96
87 signal (SIGCHLD, sigchld_handler); 97 signal (SIGCHLD, sigchld_handler);
@@ -94,23 +104,25 @@ main (int argc,
94 104
95 child = fork (); 105 child = fork ();
96 if (child == 0) 106 if (child == 0)
97 { 107 {
98 /* int setpgrp(pid_t pid, pid_t pgid); is not working on this machine */ 108 /* int setpgrp(pid_t pid, pid_t pgid); is not working on this machine */
99 //setpgrp (0, pid_t gpid); 109 //setpgrp (0, pid_t gpid);
100 if (-1 != gpid) 110 if (-1 != gpid)
101 setpgid (0, gpid); 111 setpgid (0, gpid);
102 execvp (argv[2], &argv[2]); 112 execvp (argv[2],
103 exit (1); 113 &argv[2]);
104 } 114 exit (-1);
115 }
105 if (child > 0) 116 if (child > 0)
106 { 117 {
107 sleep (timeout); 118 sleep (timeout);
108 printf ("Child processes were killed after timeout of %u seconds\n", 119 printf ("Child processes were killed after timeout of %u seconds\n",
109 timeout); 120 timeout);
110 kill (0, SIGTERM); 121 kill (0,
111 exit (1); 122 SIGTERM);
112 } 123 exit (3);
113 exit (1); 124 }
125 exit (-1);
114} 126}
115 127
116/* end of timeout_watchdog.c */ 128/* end of timeout_watchdog.c */