src/arm/gnunet-arm.c
src/arm/gnunet-service-arm.c
src/arm/mockup-service.c
-src/ats-tests/ats-testing-experiment.c
-src/ats-tests/ats-testing-log.c
-src/ats-tests/ats-testing-preferences.c
-src/ats-tests/ats-testing-traffic.c
-src/ats-tests/ats-testing.c
-src/ats-tests/gnunet-ats-sim.c
-src/ats-tests/gnunet-solver-eval.c
-src/ats-tool/gnunet-ats.c
src/ats/ats_api_connectivity.c
src/ats/ats_api_performance.c
src/ats/ats_api_scanner.c
src/ats/ats_api_scheduling.c
src/ats/gnunet-ats-solver-eval.c
-src/ats/gnunet-service-ats.c
src/ats/gnunet-service-ats_addresses.c
+src/ats/gnunet-service-ats.c
src/ats/gnunet-service-ats_connectivity.c
src/ats/gnunet-service-ats_normalization.c
src/ats/gnunet-service-ats_performance.c
src/ats/plugin_ats_mlp.c
src/ats/plugin_ats_proportional.c
src/ats/plugin_ats_ril.c
+src/ats-tests/ats-testing.c
+src/ats-tests/ats-testing-experiment.c
+src/ats-tests/ats-testing-log.c
+src/ats-tests/ats-testing-preferences.c
+src/ats-tests/ats-testing-traffic.c
+src/ats-tests/gnunet-ats-sim.c
+src/ats-tests/gnunet-solver-eval.c
+src/ats-tool/gnunet-ats.c
src/auction/gnunet-auction-create.c
src/auction/gnunet-auction-info.c
src/auction/gnunet-auction-join.c
src/cadet/cadet_api.c
src/cadet/cadet_test_lib.c
src/cadet/desirability_table.c
-src/cadet/gnunet-cadet-profiler.c
src/cadet/gnunet-cadet.c
+src/cadet/gnunet-cadet-profiler.c
src/cadet/gnunet-service-cadet.c
src/cadet/gnunet-service-cadet_channel.c
src/cadet/gnunet-service-cadet_connection.c
src/consensus/plugin_block_consensus.c
src/conversation/conversation_api.c
src/conversation/conversation_api_call.c
-src/conversation/gnunet-conversation-test.c
src/conversation/gnunet-conversation.c
-src/conversation/gnunet-helper-audio-playback-gst.c
+src/conversation/gnunet-conversation-test.c
+src/conversation/gnunet_gst.c
+src/conversation/gnunet_gst_test.c
src/conversation/gnunet-helper-audio-playback.c
-src/conversation/gnunet-helper-audio-record-gst.c
+src/conversation/gnunet-helper-audio-playback-gst.c
src/conversation/gnunet-helper-audio-record.c
+src/conversation/gnunet-helper-audio-record-gst.c
src/conversation/gnunet-service-conversation.c
-src/conversation/gnunet_gst.c
-src/conversation/gnunet_gst_test.c
src/conversation/microphone.c
src/conversation/plugin_gnsrecord_conversation.c
src/conversation/speaker.c
src/dht/dht_test_lib.c
src/dht/gnunet-dht-get.c
src/dht/gnunet-dht-monitor.c
+src/dht/gnunet_dht_profiler.c
src/dht/gnunet-dht-put.c
src/dht/gnunet-service-dht.c
src/dht/gnunet-service-dht_clients.c
src/dht/gnunet-service-dht_neighbours.c
src/dht/gnunet-service-dht_nse.c
src/dht/gnunet-service-dht_routing.c
-src/dht/gnunet_dht_profiler.c
src/dht/plugin_block_dht.c
src/dns/dns_api.c
src/dns/dnsparser.c
src/dv/gnunet-service-dv.c
src/dv/plugin_transport_dv.c
src/exit/gnunet-daemon-exit.c
-src/exit/gnunet-helper-exit-windows.c
src/exit/gnunet-helper-exit.c
+src/exit/gnunet-helper-exit-windows.c
src/fragmentation/defragmentation.c
src/fragmentation/fragmentation.c
src/fs/fs_api.c
src/fs/gnunet-daemon-fsprofiler.c
src/fs/gnunet-directory.c
src/fs/gnunet-download.c
-src/fs/gnunet-fs-profiler.c
src/fs/gnunet-fs.c
+src/fs/gnunet-fs-profiler.c
src/fs/gnunet-helper-fs-publish.c
src/fs/gnunet-publish.c
src/fs/gnunet-search.c
src/gns/gnunet-bcd.c
src/gns/gnunet-dns2gns.c
src/gns/gnunet-gns-benchmark.c
+src/gns/gnunet-gns.c
src/gns/gnunet-gns-helper-service-w32.c
src/gns/gnunet-gns-import.c
src/gns/gnunet-gns-proxy.c
-src/gns/gnunet-gns.c
src/gns/gnunet-service-gns.c
src/gns/gnunet-service-gns_interceptor.c
src/gns/gnunet-service-gns_resolver.c
src/gns/plugin_block_gns.c
src/gns/plugin_gnsrecord_gns.c
src/gns/plugin_rest_gns.c
-src/gns/w32nsp-install.c
-src/gns/w32nsp-resolve.c
-src/gns/w32nsp-uninstall.c
-src/gns/w32nsp.c
src/gnsrecord/gnsrecord.c
src/gnsrecord/gnsrecord_crypto.c
src/gnsrecord/gnsrecord_misc.c
src/gnsrecord/gnsrecord_serialization.c
src/gnsrecord/plugin_gnsrecord_dns.c
+src/gns/w32nsp.c
+src/gns/w32nsp-install.c
+src/gns/w32nsp-resolve.c
+src/gns/w32nsp-uninstall.c
src/hello/address.c
src/hello/gnunet-hello.c
src/hello/hello.c
src/hostlist/gnunet-daemon-hostlist_server.c
src/identity-attribute/identity_attribute.c
src/identity-attribute/plugin_identity_attribute_gnuid.c
+src/identity/gnunet-identity.c
+src/identity/gnunet-service-identity.c
+src/identity/identity_api.c
+src/identity/identity_api_lookup.c
+src/identity/plugin_rest_identity.c
src/identity-provider/gnunet-idp.c
src/identity-provider/gnunet-service-identity-provider.c
src/identity-provider/identity_provider_api.c
src/identity-provider/plugin_identity_provider_sqlite.c
src/identity-provider/plugin_rest_identity_provider.c
src/identity-provider/plugin_rest_openid_connect.c
-src/identity/gnunet-identity.c
-src/identity/gnunet-service-identity.c
-src/identity/identity_api.c
-src/identity/identity_api_lookup.c
-src/identity/plugin_rest_identity.c
-src/json/json.c
-src/json/json_generator.c
-src/json/json_helper.c
-src/json/json_mhd.c
src/jsonapi/jsonapi.c
src/jsonapi/jsonapi_document.c
src/jsonapi/jsonapi_error.c
src/jsonapi/jsonapi_relationship.c
src/jsonapi/jsonapi_resource.c
+src/json/json.c
+src/json/json_generator.c
+src/json/json_helper.c
+src/json/json_mhd.c
src/multicast/gnunet-multicast.c
src/multicast/gnunet-service-multicast.c
src/multicast/multicast_api.c
src/namecache/plugin_namecache_flat.c
src/namecache/plugin_namecache_postgres.c
src/namecache/plugin_namecache_sqlite.c
-src/namestore/gnunet-namestore-fcfsd.c
src/namestore/gnunet-namestore.c
+src/namestore/gnunet-namestore-fcfsd.c
src/namestore/gnunet-service-namestore.c
src/namestore/gnunet-zoneimport.c
src/namestore/namestore_api.c
src/nat-auto/gnunet-service-nat-auto_legacy.c
src/nat-auto/nat_auto_api.c
src/nat-auto/nat_auto_api_test.c
-src/nat/gnunet-helper-nat-client-windows.c
src/nat/gnunet-helper-nat-client.c
-src/nat/gnunet-helper-nat-server-windows.c
+src/nat/gnunet-helper-nat-client-windows.c
src/nat/gnunet-helper-nat-server.c
+src/nat/gnunet-helper-nat-server-windows.c
src/nat/gnunet-nat.c
src/nat/gnunet-service-nat.c
src/nat/gnunet-service-nat_externalip.c
src/nat/gnunet-service-nat_stun.c
src/nat/nat_api.c
src/nat/nat_api_stun.c
-src/nse/gnunet-nse-profiler.c
src/nse/gnunet-nse.c
+src/nse/gnunet-nse-profiler.c
src/nse/gnunet-service-nse.c
src/nse/nse_api.c
-src/peerinfo-tool/gnunet-peerinfo.c
-src/peerinfo-tool/gnunet-peerinfo_plugins.c
src/peerinfo/gnunet-service-peerinfo.c
src/peerinfo/peerinfo_api.c
src/peerinfo/peerinfo_api_notify.c
+src/peerinfo-tool/gnunet-peerinfo.c
+src/peerinfo-tool/gnunet-peerinfo_plugins.c
src/peerstore/gnunet-peerstore.c
src/peerstore/gnunet-service-peerstore.c
src/peerstore/peerstore_api.c
src/rps/gnunet-service-rps_sampler.c
src/rps/gnunet-service-rps_sampler_elem.c
src/rps/gnunet-service-rps_view.c
-src/rps/rps-test_util.c
src/rps/rps_api.c
+src/rps/rps-test_util.c
src/scalarproduct/gnunet-scalarproduct.c
-src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
-src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
src/scalarproduct/gnunet-service-scalarproduct_alice.c
src/scalarproduct/gnunet-service-scalarproduct_bob.c
+src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
+src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
src/scalarproduct/scalarproduct_api.c
src/secretsharing/gnunet-secretsharing-profiler.c
src/secretsharing/gnunet-service-secretsharing.c
src/statistics/statistics_api.c
src/template/gnunet-service-template.c
src/template/gnunet-template.c
-src/testbed-logger/gnunet-service-testbed-logger.c
-src/testbed-logger/testbed_logger_api.c
src/testbed/generate-underlay-topology.c
src/testbed/gnunet-daemon-latency-logger.c
src/testbed/gnunet-daemon-testbed-blacklist.c
src/testbed/gnunet-daemon-testbed-underlay.c
src/testbed/gnunet-helper-testbed.c
+src/testbed/gnunet_mpi_test.c
src/testbed/gnunet-service-test-barriers.c
-src/testbed/gnunet-service-testbed.c
src/testbed/gnunet-service-testbed_barriers.c
+src/testbed/gnunet-service-testbed.c
src/testbed/gnunet-service-testbed_cache.c
src/testbed/gnunet-service-testbed_connectionpool.c
src/testbed/gnunet-service-testbed_cpustatus.c
src/testbed/gnunet-service-testbed_meminfo.c
src/testbed/gnunet-service-testbed_oc.c
src/testbed/gnunet-service-testbed_peers.c
-src/testbed/gnunet-testbed-profiler.c
-src/testbed/gnunet_mpi_test.c
src/testbed/gnunet_testbed_mpi_spawn.c
-src/testbed/testbed_api.c
+src/testbed/gnunet-testbed-profiler.c
+src/testbed-logger/gnunet-service-testbed-logger.c
+src/testbed-logger/testbed_logger_api.c
src/testbed/testbed_api_barriers.c
+src/testbed/testbed_api.c
src/testbed/testbed_api_hosts.c
src/testbed/testbed_api_operations.c
src/testbed/testbed_api_peers.c
src/testbed/testbed_api_sd.c
src/testbed/testbed_api_services.c
src/testbed/testbed_api_statistics.c
-src/testbed/testbed_api_test.c
src/testbed/testbed_api_testbed.c
+src/testbed/testbed_api_test.c
src/testbed/testbed_api_topology.c
src/testbed/testbed_api_underlay.c
src/testing/gnunet-testing.c
src/topology/friends.c
src/topology/gnunet-daemon-topology.c
src/transport/gnunet-helper-transport-bluetooth.c
-src/transport/gnunet-helper-transport-wlan-dummy.c
src/transport/gnunet-helper-transport-wlan.c
-src/transport/gnunet-service-transport.c
+src/transport/gnunet-helper-transport-wlan-dummy.c
src/transport/gnunet-service-transport_ats.c
+src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport_hello.c
src/transport/gnunet-service-transport_manipulation.c
src/transport/gnunet-service-transport_neighbours.c
src/transport/gnunet-service-transport_plugins.c
src/transport/gnunet-service-transport_validation.c
+src/transport/gnunet-transport.c
src/transport/gnunet-transport-certificate-creation.c
src/transport/gnunet-transport-profiler.c
src/transport/gnunet-transport-wlan-receiver.c
src/transport/gnunet-transport-wlan-sender.c
-src/transport/gnunet-transport.c
src/transport/plugin_transport_http_client.c
src/transport/plugin_transport_http_common.c
src/transport/plugin_transport_http_server.c
src/transport/plugin_transport_smtp.c
src/transport/plugin_transport_tcp.c
src/transport/plugin_transport_template.c
-src/transport/plugin_transport_udp.c
src/transport/plugin_transport_udp_broadcasting.c
+src/transport/plugin_transport_udp.c
src/transport/plugin_transport_unix.c
src/transport/plugin_transport_wlan.c
+src/transport/plugin_transport_xt.c
+src/transport/plugin_transport_xu.c
src/transport/tcp_connection_legacy.c
src/transport/tcp_server_legacy.c
src/transport/tcp_server_mst_legacy.c
src/transport/tcp_service_legacy.c
-src/transport/transport-testing-filenames.c
-src/transport/transport-testing-loggers.c
-src/transport/transport-testing-main.c
-src/transport/transport-testing-send.c
-src/transport/transport-testing.c
src/transport/transport_api_address_to_string.c
src/transport/transport_api_blacklist.c
src/transport/transport_api_core.c
src/transport/transport_api_monitor_peers.c
src/transport/transport_api_monitor_plugins.c
src/transport/transport_api_offer_hello.c
+src/transport/transport-testing.c
+src/transport/transport-testing-filenames.c
+src/transport/transport-testing-loggers.c
+src/transport/transport-testing-main.c
+src/transport/transport-testing-send.c
src/tun/regex.c
src/tun/tun.c
src/util/bandwidth.c
src/util/container_bloomfilter.c
src/util/container_heap.c
src/util/container_meta_data.c
-src/util/container_multihashmap.c
src/util/container_multihashmap32.c
+src/util/container_multihashmap.c
src/util/container_multipeermap.c
src/util/container_multishortmap.c
src/util/crypto_abe.c
src/util/disk.c
src/util/getopt.c
src/util/getopt_helpers.c
-src/util/gnunet-config-diff.c
src/util/gnunet-config.c
+src/util/gnunet-config-diff.c
src/util/gnunet-ecc.c
src/util/gnunet-helper-w32-console.c
src/util/gnunet-resolver.c
src/util/w32cat.c
src/util/win.c
src/util/winproc.c
-src/vpn/gnunet-helper-vpn-windows.c
src/vpn/gnunet-helper-vpn.c
+src/vpn/gnunet-helper-vpn-windows.c
src/vpn/gnunet-service-vpn.c
src/vpn/gnunet-vpn.c
src/vpn/vpn_api.c
-src/zonemaster/gnunet-service-zonemaster-monitor.c
src/zonemaster/gnunet-service-zonemaster.c
+src/zonemaster/gnunet-service-zonemaster-monitor.c
src/fs/fs_api.h
src/include/gnunet_common.h
src/include/gnunet_mq_lib.h
* @param fun name of curl_easy-function that gave the error
* @param rc return code from curl
*/
-#define LOG_CURL_EASY(level,fun,rc) GNUNET_log(level, _("%s failed at %s:%d: `%s'\n"), fun, __FILE__, __LINE__, curl_easy_strerror (rc))
+#define LOG_CURL_EASY(level,fun,rc) \
+ GNUNET_log (level, \
+ _("%s failed at %s:%d: `%s'\n"), \
+ fun, \
+ __FILE__, \
+ __LINE__, \
+ curl_easy_strerror (rc))
/* *************** Socks protocol definitions (move to TUN?) ****************** */
}
if ( (NULL != s5r->response) &&
(curl_failure_response != s5r->response) )
+ {
MHD_destroy_response (s5r->response);
+ s5r->response = NULL;
+ }
if (NULL != s5r->rtask)
+ {
GNUNET_SCHEDULER_cancel (s5r->rtask);
+ s5r->rtask = NULL;
+ }
if (NULL != s5r->timeout_task)
+ {
GNUNET_SCHEDULER_cancel (s5r->timeout_task);
+ s5r->timeout_task = NULL;
+ }
if (NULL != s5r->wtask)
+ {
GNUNET_SCHEDULER_cancel (s5r->wtask);
+ s5r->wtask = NULL;
+ }
if (NULL != s5r->gns_lookup)
+ {
GNUNET_GNS_lookup_with_tld_cancel (s5r->gns_lookup);
+ s5r->gns_lookup = NULL;
+ }
if (NULL != s5r->sock)
{
if (SOCKS5_SOCKET_WITH_MHD <= s5r->state)
GNUNET_NETWORK_socket_free_memory_only_ (s5r->sock);
else
GNUNET_NETWORK_socket_close (s5r->sock);
+ s5r->sock = NULL;
}
GNUNET_CONTAINER_DLL_remove (s5r_head,
s5r_tail,
domain_matched = GNUNET_NO; /* make sure we match domain at most once */
for (tok = strtok (hdr_val, ";"); NULL != tok; tok = strtok (NULL, ";"))
{
- if ( (0 == strncasecmp (tok, " domain", strlen (" domain"))) &&
+ if ( (0 == strncasecmp (tok,
+ " domain",
+ strlen (" domain"))) &&
(GNUNET_NO == domain_matched) )
{
domain_matched = GNUNET_YES;
if (strlen (cookie_domain) < strlen (s5r->leho))
{
delta_cdomain = strlen (s5r->leho) - strlen (cookie_domain);
- if (0 == strcasecmp (cookie_domain, s5r->leho + delta_cdomain))
+ if (0 == strcasecmp (cookie_domain,
+ s5r->leho + delta_cdomain))
{
offset += sprintf (new_cookie_hdr + offset,
" domain=%s;",
continue;
}
}
- else if (0 == strcmp (cookie_domain, s5r->leho))
+ else if (0 == strcmp (cookie_domain,
+ s5r->leho))
{
offset += sprintf (new_cookie_hdr + offset,
" domain=%s;",
_("Cookie domain `%s' supplied by server is invalid\n"),
tok);
}
- GNUNET_memcpy (new_cookie_hdr + offset, tok, strlen (tok));
+ GNUNET_memcpy (new_cookie_hdr + offset,
+ tok,
+ strlen (tok));
offset += strlen (tok);
new_cookie_hdr[offset++] = ';';
}
}
new_location = NULL;
- if (0 == strcasecmp (MHD_HTTP_HEADER_LOCATION, hdr_type))
+ if (0 == strcasecmp (MHD_HTTP_HEADER_LOCATION,
+ hdr_type))
{
char *leho_host;
s5r->domain,
s5r->url);
s5r->response_code = resp_code;
- s5r->response = MHD_create_response_from_callback ((-1 == content_length) ? MHD_SIZE_UNKNOWN : content_length,
+ s5r->response = MHD_create_response_from_callback ((-1 == content_length)
+ ? MHD_SIZE_UNKNOWN
+ : content_length,
IO_BUFFERSIZE,
&mhd_content_cb,
s5r,
return;
}
to = -1;
- GNUNET_break (CURLM_OK == curl_multi_timeout (curl_multi, &to));
+ GNUNET_break (CURLM_OK ==
+ curl_multi_timeout (curl_multi,
+ &to));
if (-1 == to)
rtime = GNUNET_TIME_UNIT_FOREVER_REL;
else
- rtime = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, to);
+ rtime = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
+ to);
if (-1 != max)
{
grs = GNUNET_NETWORK_fdset_create ();
gws = GNUNET_NETWORK_fdset_create ();
- GNUNET_NETWORK_fdset_copy_native (grs, &rs, max + 1);
- GNUNET_NETWORK_fdset_copy_native (gws, &ws, max + 1);
+ GNUNET_NETWORK_fdset_copy_native (grs,
+ &rs,
+ max + 1);
+ GNUNET_NETWORK_fdset_copy_native (gws,
+ &ws,
+ max + 1);
curl_download_task = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
rtime,
- grs, gws,
+ grs,
+ gws,
&curl_task_download,
curl_multi);
GNUNET_NETWORK_fdset_destroy (gws);
struct Socks5Request *s5r = cls;
char *hdr;
- if ( (0 == strcasecmp (MHD_HTTP_HEADER_HOST, key)) &&
+ if ( (0 == strcasecmp (MHD_HTTP_HEADER_HOST,
+ key)) &&
(NULL != s5r->leho) )
value = s5r->leho;
- if (0 == strcasecmp (MHD_HTTP_HEADER_CONTENT_LENGTH, key))
+ if (0 == strcasecmp (MHD_HTTP_HEADER_CONTENT_LENGTH,
+ key))
return MHD_YES;
- if (0 == strcasecmp (MHD_HTTP_HEADER_ACCEPT_ENCODING, key))
+ if (0 == strcasecmp (MHD_HTTP_HEADER_ACCEPT_ENCODING,
+ key))
return MHD_YES;
GNUNET_asprintf (&hdr,
"%s: %s",
return MHD_queue_response (con,
MHD_HTTP_INTERNAL_SERVER_ERROR,
curl_failure_response);
- curl_easy_setopt (s5r->curl, CURLOPT_HEADERFUNCTION, &curl_check_hdr);
- curl_easy_setopt (s5r->curl, CURLOPT_HEADERDATA, s5r);
- curl_easy_setopt (s5r->curl, CURLOPT_FOLLOWLOCATION, 0);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_HEADERFUNCTION,
+ &curl_check_hdr);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_HEADERDATA,
+ s5r);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_FOLLOWLOCATION,
+ 0);
if (s5r->is_gns)
curl_easy_setopt (s5r->curl,
CURLOPT_IPRESOLVE,
CURL_IPRESOLVE_V4);
- curl_easy_setopt (s5r->curl, CURLOPT_CONNECTTIMEOUT, 600L);
- curl_easy_setopt (s5r->curl, CURLOPT_TIMEOUT, 600L);
- curl_easy_setopt (s5r->curl, CURLOPT_NOSIGNAL, 1L);
- curl_easy_setopt (s5r->curl, CURLOPT_HTTP_CONTENT_DECODING, 0);
- // curl_easy_setopt (s5r->curl, CURLOPT_HTTP_TRANSFER_DECODING, 0);
- curl_easy_setopt (s5r->curl, CURLOPT_NOSIGNAL, 1L);
- curl_easy_setopt (s5r->curl, CURLOPT_PRIVATE, s5r);
- curl_easy_setopt (s5r->curl, CURLOPT_VERBOSE, 0L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_CONNECTTIMEOUT,
+ 600L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_TIMEOUT,
+ 600L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_NOSIGNAL,
+ 1L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_HTTP_CONTENT_DECODING,
+ 0);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_NOSIGNAL,
+ 1L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_PRIVATE,
+ s5r);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_VERBOSE,
+ 0L);
/**
* Pre-populate cache to resolve Hostname.
* This is necessary as the DNS name in the CURLOPT_URL is used
MHD_HTTP_METHOD_PUT))
{
s5r->state = SOCKS5_SOCKET_UPLOAD_STARTED;
- curl_easy_setopt (s5r->curl, CURLOPT_UPLOAD, 1L);
- curl_easy_setopt (s5r->curl, CURLOPT_WRITEFUNCTION, &curl_download_cb);
- curl_easy_setopt (s5r->curl, CURLOPT_WRITEDATA, s5r);
- curl_easy_setopt (s5r->curl, CURLOPT_READFUNCTION, &curl_upload_cb);
- curl_easy_setopt (s5r->curl, CURLOPT_READDATA, s5r);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_UPLOAD,
+ 1L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_WRITEFUNCTION,
+ &curl_download_cb);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_WRITEDATA,
+ s5r);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_READFUNCTION,
+ &curl_upload_cb);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_READDATA,
+ s5r);
{
const char *us;
long upload_size;
else if (0 == strcasecmp (meth, MHD_HTTP_METHOD_POST))
{
s5r->state = SOCKS5_SOCKET_UPLOAD_STARTED;
- curl_easy_setopt (s5r->curl, CURLOPT_POST, 1L);
- curl_easy_setopt (s5r->curl, CURLOPT_WRITEFUNCTION, &curl_download_cb);
- curl_easy_setopt (s5r->curl, CURLOPT_WRITEDATA, s5r);
- curl_easy_setopt (s5r->curl, CURLOPT_READFUNCTION, &curl_upload_cb);
- curl_easy_setopt (s5r->curl, CURLOPT_READDATA, s5r);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_POST,
+ 1L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_WRITEFUNCTION,
+ &curl_download_cb);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_WRITEDATA,
+ s5r);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_READFUNCTION,
+ &curl_upload_cb);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_READDATA,
+ s5r);
{
const char *us;
long upload_size;
}
}
}
- else if (0 == strcasecmp (meth, MHD_HTTP_METHOD_HEAD))
+ else if (0 == strcasecmp (meth,
+ MHD_HTTP_METHOD_HEAD))
{
s5r->state = SOCKS5_SOCKET_DOWNLOAD_STARTED;
- curl_easy_setopt (s5r->curl, CURLOPT_NOBODY, 1L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_NOBODY,
+ 1L);
}
- else if (0 == strcasecmp (meth, MHD_HTTP_METHOD_OPTIONS))
+ else if (0 == strcasecmp (meth,
+ MHD_HTTP_METHOD_OPTIONS))
{
s5r->state = SOCKS5_SOCKET_DOWNLOAD_STARTED;
- curl_easy_setopt (s5r->curl, CURLOPT_CUSTOMREQUEST, "OPTIONS");
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_CUSTOMREQUEST,
+ "OPTIONS");
}
- else if (0 == strcasecmp (meth, MHD_HTTP_METHOD_GET))
+ else if (0 == strcasecmp (meth,
+ MHD_HTTP_METHOD_GET))
{
s5r->state = SOCKS5_SOCKET_DOWNLOAD_STARTED;
- curl_easy_setopt (s5r->curl, CURLOPT_HTTPGET, 1L);
- curl_easy_setopt (s5r->curl, CURLOPT_WRITEFUNCTION, &curl_download_cb);
- curl_easy_setopt (s5r->curl, CURLOPT_WRITEDATA, s5r);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_HTTPGET,
+ 1L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_WRITEFUNCTION,
+ &curl_download_cb);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_WRITEDATA,
+ s5r);
}
else
{
if (0 == strcasecmp (ver, MHD_HTTP_VERSION_1_0))
{
- curl_easy_setopt (s5r->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_HTTP_VERSION,
+ CURL_HTTP_VERSION_1_0);
}
else if (0 == strcasecmp (ver, MHD_HTTP_VERSION_1_1))
{
- curl_easy_setopt (s5r->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_HTTP_VERSION,
+ CURL_HTTP_VERSION_1_1);
}
else
{
- curl_easy_setopt (s5r->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_NONE);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_HTTP_VERSION,
+ CURL_HTTP_VERSION_NONE);
}
if (HTTPS_PORT == s5r->port)
{
- curl_easy_setopt (s5r->curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_USE_SSL,
+ CURLUSESSL_ALL);
if (NULL != s5r->dane_data)
- curl_easy_setopt (s5r->curl, CURLOPT_SSL_VERIFYPEER, 0L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_SSL_VERIFYPEER,
+ 0L);
else
- curl_easy_setopt (s5r->curl, CURLOPT_SSL_VERIFYPEER, 1L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_SSL_VERIFYPEER,
+ 1L);
/* Disable cURL checking the hostname, as we will check ourselves
as only we have the domain name or the LEHO or the DANE record */
- curl_easy_setopt (s5r->curl, CURLOPT_SSL_VERIFYHOST, 0L);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_SSL_VERIFYHOST,
+ 0L);
}
else
{
- curl_easy_setopt (s5r->curl, CURLOPT_USE_SSL, CURLUSESSL_NONE);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_USE_SSL,
+ CURLUSESSL_NONE);
}
if (CURLM_OK !=
/* FIXME: This must be set or a header with Transfer-Encoding: chunked. Else
* upload callback is not called!
*/
- curl_easy_setopt (s5r->curl, CURLOPT_POSTFIELDSIZE, *upload_data_size);
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_POSTFIELDSIZE,
+ *upload_data_size);
left = GNUNET_MIN (*upload_data_size,
sizeof (s5r->io_buf) - s5r->io_len);
uint64_t fsize;
if (GNUNET_OK !=
- GNUNET_DISK_file_size (filename, &fsize,
- GNUNET_YES, GNUNET_YES))
+ GNUNET_DISK_file_size (filename,
+ &fsize,
+ GNUNET_YES,
+ GNUNET_YES))
return NULL;
if (fsize > MAX_PEM_SIZE)
return NULL;
gnutls_datum_t key_data;
int ret;
- key_data.data = load_file (keyfile, &key_data.size);
+ key_data.data = load_file (keyfile,
+ &key_data.size);
if (NULL == key_data.data)
return GNUNET_SYSERR;
ret = gnutls_x509_privkey_import (key, &key_data,
gnutls_datum_t cert_data;
int ret;
- cert_data.data = load_file (certfile, &cert_data.size);
+ cert_data.data = load_file (certfile,
+ &cert_data.size);
if (NULL == cert_data.data)
return GNUNET_SYSERR;
- ret = gnutls_x509_crt_import (crt, &cert_data,
+ ret = gnutls_x509_crt_import (crt,
+ &cert_data,
GNUTLS_X509_FMT_PEM);
if (GNUTLS_E_SUCCESS != ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Unable to import certificate %s\n"), certfile);
+ _("Unable to import certificate from `%s'\n"),
+ certfile);
}
GNUNET_free_non_null (cert_data.data);
return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK;
GNUNET_break (GNUTLS_E_SUCCESS == gnutls_x509_crt_init (&request));
GNUNET_break (GNUTLS_E_SUCCESS == gnutls_x509_crt_set_key (request, proxy_ca.key));
pgc = GNUNET_new (struct ProxyGNSCertificate);
- gnutls_x509_crt_set_dn_by_oid (request, GNUTLS_OID_X520_COUNTRY_NAME,
- 0, "ZZ", 2);
- gnutls_x509_crt_set_dn_by_oid (request, GNUTLS_OID_X520_ORGANIZATION_NAME,
- 0, "GNU Name System", 4);
- gnutls_x509_crt_set_dn_by_oid (request, GNUTLS_OID_X520_COMMON_NAME,
- 0, name, strlen (name));
- GNUNET_break (GNUTLS_E_SUCCESS == gnutls_x509_crt_set_version (request, 3));
- gnutls_rnd (GNUTLS_RND_NONCE, &serial, sizeof (serial));
+ gnutls_x509_crt_set_dn_by_oid (request,
+ GNUTLS_OID_X520_COUNTRY_NAME,
+ 0,
+ "ZZ",
+ strlen ("ZZ"));
+ gnutls_x509_crt_set_dn_by_oid (request,
+ GNUTLS_OID_X520_ORGANIZATION_NAME,
+ 0,
+ "GNU Name System",
+ strlen ("GNU Name System"));
+ gnutls_x509_crt_set_dn_by_oid (request,
+ GNUTLS_OID_X520_COMMON_NAME,
+ 0,
+ name,
+ strlen (name));
+ GNUNET_break (GNUTLS_E_SUCCESS ==
+ gnutls_x509_crt_set_version (request,
+ 3));
+ gnutls_rnd (GNUTLS_RND_NONCE,
+ &serial,
+ sizeof (serial));
gnutls_x509_crt_set_serial (request,
&serial,
sizeof (serial));
0);
key_buf_size = sizeof (pgc->key);
cert_buf_size = sizeof (pgc->cert);
- gnutls_x509_crt_export (request, GNUTLS_X509_FMT_PEM,
- pgc->cert, &cert_buf_size);
- gnutls_x509_privkey_export (proxy_ca.key, GNUTLS_X509_FMT_PEM,
- pgc->key, &key_buf_size);
+ gnutls_x509_crt_export (request,
+ GNUTLS_X509_FMT_PEM,
+ pgc->cert,
+ &cert_buf_size);
+ gnutls_x509_privkey_export (proxy_ca.key,
+ GNUTLS_X509_FMT_PEM,
+ pgc->key,
+ &key_buf_size);
gnutls_x509_crt_deinit (request);
return pgc;
}
s5r->rtask = NULL;
tc = GNUNET_SCHEDULER_get_task_context ();
if ( (NULL != tc->read_ready) &&
- (GNUNET_NETWORK_fdset_isset (tc->read_ready, s5r->sock)) )
+ (GNUNET_NETWORK_fdset_isset (tc->read_ready,
+ s5r->sock)) )
{
rlen = GNUNET_NETWORK_socket_recv (s5r->sock,
&s5r->rbuf[s5r->rbuf_len],
if (lsock == lsock4)
ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
lsock,
- &do_accept, lsock);
+ &do_accept,
+ lsock);
else if (lsock == lsock6)
ltask6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
lsock,
- &do_accept, lsock);
+ &do_accept,
+ lsock);
else
GNUNET_assert (0);
- s = GNUNET_NETWORK_socket_accept (lsock, NULL, NULL);
+ s = GNUNET_NETWORK_socket_accept (lsock,
+ NULL,
+ NULL);
if (NULL == s)
{
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "accept");
+ GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
+ "accept");
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
s5r->state = SOCKS5_INIT;
s5r->rtask = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
s5r->sock,
- &do_s5r_read, s5r);
+ &do_s5r_read,
+ s5r);
}
if (NULL == ls)
return NULL;
if (GNUNET_OK !=
- GNUNET_NETWORK_socket_bind (ls, (const struct sockaddr *) &sa4,
+ GNUNET_NETWORK_socket_bind (ls,
+ (const struct sockaddr *) &sa4,
sizeof (sa4)))
{
eno = errno;
if (NULL == ls)
return NULL;
if (GNUNET_OK !=
- GNUNET_NETWORK_socket_bind (ls, (const struct sockaddr *) &sa6,
+ GNUNET_NETWORK_socket_bind (ls,
+ (const struct sockaddr *) &sa6,
sizeof (sa6)))
{
eno = errno;
cafile = cafile_cfg;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Using %s as CA\n", cafile);
+ "Using `%s' as CA\n",
+ cafile);
gnutls_global_init ();
gnutls_x509_crt_init (&proxy_ca.cert);
* @return 0 ok, 1 on error
*/
int
-main (int argc, char *const *argv)
+main (int argc,
+ char *const *argv)
{
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_option_uint16 ('p',
"</head><body>cURL fail</body></html>";
int ret;
- if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv,
- &argc, &argv))
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
return 2;
GNUNET_log_setup ("gnunet-gns-proxy",
"WARNING",