struct ProxyCurlTask *ctask = cls;
struct ProxyREMatch *re_match;
ssize_t copied = 0;
- long long int bytes_to_copy = ctask->buffer_write_ptr - ctask->buffer_read_ptr;
+ size_t bytes_to_copy = ctask->buffer_write_ptr - ctask->buffer_read_ptr;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "MHD: content cb for %s. To copy: %lld\n",
- ctask->url, bytes_to_copy);
- GNUNET_assert (bytes_to_copy >= 0);
-
+ "MHD: content cb for %s. To copy: %u\n",
+ ctask->url, (unsigned int) bytes_to_copy);
if ((GNUNET_YES == ctask->download_is_finished) &&
(GNUNET_NO == ctask->download_error) &&
(0 == bytes_to_copy))
"MHD: Processing PP %s\n",
re_match->hostname);
bytes_to_copy = re_match->start - ctask->buffer_read_ptr;
- GNUNET_assert (bytes_to_copy >= 0);
-
if (bytes_to_copy+copied > max)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "MHD: buffer in response too small for %d. Using available space (%d). (%s)\n",
- bytes_to_copy,
- max,
- ctask->url);
+ "MHD: buffer in response too small for %u. Using available space (%d). (%s)\n",
+ (unsigned int) bytes_to_copy,
+ max,
+ ctask->url);
memcpy (buf+copied, ctask->buffer_read_ptr, max-copied);
ctask->buffer_read_ptr += max-copied;
copied = max;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "MHD: copying %d bytes to mhd response at offset %d\n",
- bytes_to_copy, ctask->buffer_read_ptr);
+ "MHD: copying %u bytes to mhd response at offset %d\n",
+ (unsigned int) bytes_to_copy, ctask->buffer_read_ptr);
memcpy (buf+copied, ctask->buffer_read_ptr, bytes_to_copy);
copied += bytes_to_copy;
bytes_to_copy = ctask->buffer_write_ptr - ctask->buffer_read_ptr;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "MHD: copied: %d left: %d, space left in buf: %d\n",
+ "MHD: copied: %d left: %u, space left in buf: %d\n",
copied,
- bytes_to_copy, (int) (max - copied));
+ (unsigned int) bytes_to_copy, (int) (max - copied));
- GNUNET_assert (0 <= bytes_to_copy);
-
if (GNUNET_NO == ctask->download_is_finished)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
void **con_cls)
{
struct MhdHttpList* hd = cls;
- const char* page = "<html><head><title>gnunet-gns-proxy</title>"\
+ const char* page = "<html><head><title>gnunet-gns-proxy</title>"
"</head><body>cURL fail</body></html>";
char curlurl[MAX_HTTP_URI_LENGTH]; // buffer overflow!
}
+
+#define UNSIGNED_MHD_LONG_LONG unsigned MHD_LONG_LONG
+
+
/**
* schedule mhd
*
struct GNUNET_NETWORK_FDSet *wes;
int max;
int haveto;
- unsigned MHD_LONG_LONG timeout;
+ UNSIGNED_MHD_LONG_LONG timeout;
struct GNUNET_TIME_Relative tv;
FD_ZERO (&rs);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"No previous SSL instance found... starting new one for %s\n",
domain);
- hd->daemon = MHD_start_daemon (MHD_USE_DEBUG
- | MHD_USE_SSL
#if HAVE_MHD_NO_LISTEN_SOCKET
- | MHD_USE_NO_LISTEN_SOCKET,
+ hd->daemon = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_SSL | MHD_USE_NO_LISTEN_SOCKET,
0,
+ &accept_cb, NULL,
+ &create_response, hd,
+ MHD_OPTION_CONNECTION_LIMIT,
+ MHD_MAX_CONNECTIONS,
+ MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
+ MHD_OPTION_NOTIFY_COMPLETED, NULL, NULL,
+ MHD_OPTION_HTTPS_MEM_KEY, pgc->key,
+ MHD_OPTION_HTTPS_MEM_CERT, pgc->cert,
+ MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback,
+ NULL,
+ MHD_OPTION_END);
#else
- , 4444, //Dummy
-#endif
+ hd->daemon = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_SSL,
+ 4444 /* dummy port */,
&accept_cb, NULL,
&create_response, hd,
-#if !HAVE_MHD_NO_LISTEN_SOCKET
- MHD_OPTION_LISTEN_SOCKET, GNUNET_NETWORK_get_fd (mhd_unix_socket),
-#endif
+ MHD_OPTION_LISTEN_SOCKET, GNUNET_NETWORK_get_fd (mhd_unix_socket),
MHD_OPTION_CONNECTION_LIMIT,
MHD_MAX_CONNECTIONS,
- MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
- MHD_OPTION_NOTIFY_COMPLETED, NULL, NULL,
- MHD_OPTION_HTTPS_MEM_KEY, pgc->key,
- MHD_OPTION_HTTPS_MEM_CERT, pgc->cert,
- MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback,
- NULL,
- MHD_OPTION_END);
+ MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
+ MHD_OPTION_NOTIFY_COMPLETED, NULL, NULL,
+ MHD_OPTION_HTTPS_MEM_KEY, pgc->key,
+ MHD_OPTION_HTTPS_MEM_CERT, pgc->cert,
+ MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback,
+ NULL,
+ MHD_OPTION_END);
GNUNET_assert (hd->daemon != NULL);
hd->httpd_task = GNUNET_SCHEDULER_NO_TASK;
hd = GNUNET_malloc (sizeof (struct MhdHttpList));
hd->is_ssl = GNUNET_NO;
strcpy (hd->domain, "");
- httpd = MHD_start_daemon (MHD_USE_DEBUG
+
#if HAVE_MHD_NO_LISTEN_SOCKET
- | MHD_USE_NO_LISTEN_SOCKET,
+ httpd = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_NO_LISTEN_SOCKET,
0,
+ &accept_cb, NULL,
+ &create_response, hd,
+ MHD_OPTION_CONNECTION_LIMIT, MHD_MAX_CONNECTIONS,
+ MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
+ MHD_OPTION_NOTIFY_COMPLETED,
+ NULL, NULL,
+ MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback, NULL,
+ MHD_OPTION_END);
#else
- , 4444, //Dummy port
-#endif
- &accept_cb, NULL,
- &create_response, hd,
-#if !HAVE_MHD_NO_LISTEN_SOCKET
- MHD_OPTION_LISTEN_SOCKET, GNUNET_NETWORK_get_fd (mhd_unix_socket),
+ httpd = MHD_start_daemon (MHD_USE_DEBUG,
+ 4444 /* Dummy port */,
+ &accept_cb, NULL,
+ &create_response, hd,
+ MHD_OPTION_LISTEN_SOCKET, GNUNET_NETWORK_get_fd (mhd_unix_socket),
+ MHD_OPTION_CONNECTION_LIMIT, MHD_MAX_CONNECTIONS,
+ MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
+ MHD_OPTION_NOTIFY_COMPLETED,
+ NULL, NULL,
+ MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback, NULL,
+ MHD_OPTION_END);
#endif
- MHD_OPTION_CONNECTION_LIMIT, MHD_MAX_CONNECTIONS,
- MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
- MHD_OPTION_NOTIFY_COMPLETED,
- NULL, NULL,
- MHD_OPTION_URI_LOG_CALLBACK, &mhd_log_callback, NULL,
- MHD_OPTION_END);
GNUNET_assert (httpd != NULL);
hd->daemon = httpd;