aboutsummaryrefslogtreecommitdiff
path: root/src/gns
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-09-28 09:12:17 +0000
committerChristian Grothoff <christian@grothoff.org>2012-09-28 09:12:17 +0000
commit601e24eca9012c462021ccacb04c70dffdb31264 (patch)
tree9051e4b2a8e81d40d95b8c13377300094ce01329 /src/gns
parent5c70099f12dca398e9e6aaab13610207982f666f (diff)
downloadgnunet-601e24eca9012c462021ccacb04c70dffdb31264.tar.gz
gnunet-601e24eca9012c462021ccacb04c70dffdb31264.zip
-licenses, dce, etc
Diffstat (limited to 'src/gns')
-rw-r--r--src/gns/gnunet-gns-proxy.c80
-rw-r--r--src/gns/w32nsp-install.c27
-rw-r--r--src/gns/w32nsp-resolve.c26
-rw-r--r--src/gns/w32nsp.c2
4 files changed, 101 insertions, 34 deletions
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index bef3c75e0..45e36eae5 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1939,7 +1939,7 @@ create_response (void *cls,
1939 void **con_cls) 1939 void **con_cls)
1940{ 1940{
1941 struct MhdHttpList* hd = cls; 1941 struct MhdHttpList* hd = cls;
1942 const char* page = "<html><head><title>gnunet-gns-proxy</title>"\ 1942 const char* page = "<html><head><title>gnunet-gns-proxy</title>"
1943 "</head><body>cURL fail</body></html>"; 1943 "</head><body>cURL fail</body></html>";
1944 1944
1945 char curlurl[MAX_HTTP_URI_LENGTH]; // buffer overflow! 1945 char curlurl[MAX_HTTP_URI_LENGTH]; // buffer overflow!
@@ -2198,6 +2198,10 @@ run_httpds ()
2198 2198
2199} 2199}
2200 2200
2201
2202#define UNSIGNED_MHD_LONG_LONG unsigned MHD_LONG_LONG
2203
2204
2201/** 2205/**
2202 * schedule mhd 2206 * schedule mhd
2203 * 2207 *
@@ -2214,7 +2218,7 @@ run_httpd (struct MhdHttpList *hd)
2214 struct GNUNET_NETWORK_FDSet *wes; 2218 struct GNUNET_NETWORK_FDSet *wes;
2215 int max; 2219 int max;
2216 int haveto; 2220 int haveto;
2217 unsigned MHD_LONG_LONG timeout; 2221 UNSIGNED_MHD_LONG_LONG timeout;
2218 struct GNUNET_TIME_Relative tv; 2222 struct GNUNET_TIME_Relative tv;
2219 2223
2220 FD_ZERO (&rs); 2224 FD_ZERO (&rs);
@@ -2708,28 +2712,35 @@ add_handle_to_ssl_mhd (struct GNUNET_NETWORK_Handle *h, const char* domain)
2708 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2712 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2709 "No previous SSL instance found... starting new one for %s\n", 2713 "No previous SSL instance found... starting new one for %s\n",
2710 domain); 2714 domain);
2711 hd->daemon = MHD_start_daemon (MHD_USE_DEBUG
2712 | MHD_USE_SSL
2713#if HAVE_MHD_NO_LISTEN_SOCKET 2715#if HAVE_MHD_NO_LISTEN_SOCKET
2714 | MHD_USE_NO_LISTEN_SOCKET, 2716 hd->daemon = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_SSL | MHD_USE_NO_LISTEN_SOCKET,
2715 0, 2717 0,
2718 &accept_cb, NULL,
2719 &create_response, hd,
2720 MHD_OPTION_CONNECTION_LIMIT,
2721 MHD_MAX_CONNECTIONS,
2722 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
2723 MHD_OPTION_NOTIFY_COMPLETED, NULL, NULL,
2724 MHD_OPTION_HTTPS_MEM_KEY, pgc->key,
2725 MHD_OPTION_HTTPS_MEM_CERT, pgc->cert,
2726 MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback,
2727 NULL,
2728 MHD_OPTION_END);
2716#else 2729#else
2717 , 4444, //Dummy 2730 hd->daemon = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_SSL,
2718#endif 2731 4444 /* dummy port */,
2719 &accept_cb, NULL, 2732 &accept_cb, NULL,
2720 &create_response, hd, 2733 &create_response, hd,
2721#if !HAVE_MHD_NO_LISTEN_SOCKET 2734 MHD_OPTION_LISTEN_SOCKET, GNUNET_NETWORK_get_fd (mhd_unix_socket),
2722 MHD_OPTION_LISTEN_SOCKET, GNUNET_NETWORK_get_fd (mhd_unix_socket),
2723#endif
2724 MHD_OPTION_CONNECTION_LIMIT, 2735 MHD_OPTION_CONNECTION_LIMIT,
2725 MHD_MAX_CONNECTIONS, 2736 MHD_MAX_CONNECTIONS,
2726 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16, 2737 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
2727 MHD_OPTION_NOTIFY_COMPLETED, NULL, NULL, 2738 MHD_OPTION_NOTIFY_COMPLETED, NULL, NULL,
2728 MHD_OPTION_HTTPS_MEM_KEY, pgc->key, 2739 MHD_OPTION_HTTPS_MEM_KEY, pgc->key,
2729 MHD_OPTION_HTTPS_MEM_CERT, pgc->cert, 2740 MHD_OPTION_HTTPS_MEM_CERT, pgc->cert,
2730 MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback, 2741 MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback,
2731 NULL, 2742 NULL,
2732 MHD_OPTION_END); 2743 MHD_OPTION_END);
2733 2744
2734 GNUNET_assert (hd->daemon != NULL); 2745 GNUNET_assert (hd->daemon != NULL);
2735 hd->httpd_task = GNUNET_SCHEDULER_NO_TASK; 2746 hd->httpd_task = GNUNET_SCHEDULER_NO_TASK;
@@ -3516,24 +3527,31 @@ run (void *cls, char *const *args, const char *cfgfile,
3516 hd = GNUNET_malloc (sizeof (struct MhdHttpList)); 3527 hd = GNUNET_malloc (sizeof (struct MhdHttpList));
3517 hd->is_ssl = GNUNET_NO; 3528 hd->is_ssl = GNUNET_NO;
3518 strcpy (hd->domain, ""); 3529 strcpy (hd->domain, "");
3519 httpd = MHD_start_daemon (MHD_USE_DEBUG 3530
3520#if HAVE_MHD_NO_LISTEN_SOCKET 3531#if HAVE_MHD_NO_LISTEN_SOCKET
3521 | MHD_USE_NO_LISTEN_SOCKET, 3532 httpd = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_NO_LISTEN_SOCKET,
3522 0, 3533 0,
3534 &accept_cb, NULL,
3535 &create_response, hd,
3536 MHD_OPTION_CONNECTION_LIMIT, MHD_MAX_CONNECTIONS,
3537 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
3538 MHD_OPTION_NOTIFY_COMPLETED,
3539 NULL, NULL,
3540 MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback, NULL,
3541 MHD_OPTION_END);
3523#else 3542#else
3524 , 4444, //Dummy port 3543 httpd = MHD_start_daemon (MHD_USE_DEBUG,
3525#endif 3544 4444 /* Dummy port */,
3526 &accept_cb, NULL, 3545 &accept_cb, NULL,
3527 &create_response, hd, 3546 &create_response, hd,
3528#if !HAVE_MHD_NO_LISTEN_SOCKET 3547 MHD_OPTION_LISTEN_SOCKET, GNUNET_NETWORK_get_fd (mhd_unix_socket),
3529 MHD_OPTION_LISTEN_SOCKET, GNUNET_NETWORK_get_fd (mhd_unix_socket), 3548 MHD_OPTION_CONNECTION_LIMIT, MHD_MAX_CONNECTIONS,
3549 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
3550 MHD_OPTION_NOTIFY_COMPLETED,
3551 NULL, NULL,
3552 MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback, NULL,
3553 MHD_OPTION_END);
3530#endif 3554#endif
3531 MHD_OPTION_CONNECTION_LIMIT, MHD_MAX_CONNECTIONS,
3532 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
3533 MHD_OPTION_NOTIFY_COMPLETED,
3534 NULL, NULL,
3535 MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback, NULL,
3536 MHD_OPTION_END);
3537 3555
3538 GNUNET_assert (httpd != NULL); 3556 GNUNET_assert (httpd != NULL);
3539 hd->daemon = httpd; 3557 hd->daemon = httpd;
diff --git a/src/gns/w32nsp-install.c b/src/gns/w32nsp-install.c
index e5c168b6c..dcdd16a86 100644
--- a/src/gns/w32nsp-install.c
+++ b/src/gns/w32nsp-install.c
@@ -1,3 +1,28 @@
1/*
2 This file is part of GNUnet.
3 (C) 2012 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20/**
21 * @file gns/w32nsp-install.c
22 * @brief W32 integration installer for GNS
23 * @author LRN
24 */
25
1#define INITGUID 26#define INITGUID
2#include <windows.h> 27#include <windows.h>
3#include <nspapi.h> 28#include <nspapi.h>
@@ -53,4 +78,4 @@ main (int argc, char **argv)
53 } 78 }
54 WSACleanup(); 79 WSACleanup();
55 return r; 80 return r;
56} \ No newline at end of file 81}
diff --git a/src/gns/w32nsp-resolve.c b/src/gns/w32nsp-resolve.c
index 884e4ba43..4a116f594 100644
--- a/src/gns/w32nsp-resolve.c
+++ b/src/gns/w32nsp-resolve.c
@@ -1,3 +1,27 @@
1/*
2 This file is part of GNUnet.
3 (C) 2012 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20/**
21 * @file gns/w32nsp-resolve.c
22 * @brief W32 integration for GNS
23 * @author LRN
24 */
1#define INITGUID 25#define INITGUID
2#include <windows.h> 26#include <windows.h>
3#include <nspapi.h> 27#include <nspapi.h>
@@ -337,4 +361,4 @@ main (int argc, char **argv)
337 } 361 }
338 WSACleanup(); 362 WSACleanup();
339 return r; 363 return r;
340} \ No newline at end of file 364}
diff --git a/src/gns/w32nsp.c b/src/gns/w32nsp.c
index 86e83dc99..3e85da7e5 100644
--- a/src/gns/w32nsp.c
+++ b/src/gns/w32nsp.c
@@ -183,7 +183,7 @@ typedef struct _NSP_ROUTINE_XP {
183 LPNSPREMOVESERVICECLASS NSPRemoveServiceClass; 183 LPNSPREMOVESERVICECLASS NSPRemoveServiceClass;
184 LPNSPGETSERVICECLASSINFO NSPGetServiceClassInfo; 184 LPNSPGETSERVICECLASSINFO NSPGetServiceClassInfo;
185 LPNSPIOCTL NSPIoctl; 185 LPNSPIOCTL NSPIoctl;
186} NSP_ROUTINE_XP, *PNSP_ROUTINE_XP, *LPNSP_ROUTINE_XP; 186} NSP_ROUTINE_XP;
187 187
188static SOCKET 188static SOCKET
189connect_to_dns_resolver () 189connect_to_dns_resolver ()