[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r12803 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r12803 - gnunet/src/transport |
Date: |
Wed, 1 Sep 2010 17:26:25 +0200 |
Author: wachs
Date: 2010-09-01 17:26:24 +0200 (Wed, 01 Sep 2010)
New Revision: 12803
Modified:
gnunet/src/transport/plugin_transport_http.c
gnunet/src/transport/plugin_transport_https.c
Log:
changed MHD Buffer size and enabled TCP_NO_DELAY for curl
Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c 2010-09-01 13:53:27 UTC
(rev 12802)
+++ gnunet/src/transport/plugin_transport_http.c 2010-09-01 15:26:24 UTC
(rev 12803)
@@ -46,6 +46,8 @@
#define DEBUG_CONNECTIONS GNUNET_NO
#define DEBUG_SESSION_SELECTION GNUNET_NO
+#define CURL_TCP_NODELAY GNUNET_YES
+
#define INBOUND GNUNET_NO
#define OUTBOUND GNUNET_YES
@@ -731,11 +733,9 @@
int mhd_send_callback (void *cls, uint64_t pos, char *buf, int max)
{
int bytes_read = 0;
-
struct Session * ps = cls;
struct HTTP_PeerContext * pc;
struct HTTP_Message * msg;
-
GNUNET_assert (ps!=NULL);
pc = ps->peercontext;
msg = ps->pending_msgs_tail;
@@ -1260,7 +1260,6 @@
if (ps->send_active == GNUNET_NO)
return CURL_READFUNC_PAUSE;
-
if ((ps->pending_msgs_tail == NULL) && (ps->send_active == GNUNET_YES))
{
#if DEBUG_CONNECTIONS
@@ -1615,7 +1614,10 @@
curl_easy_setopt(ps->recv_endpoint, CURLOPT_TIMEOUT, (long)
timeout.value);
curl_easy_setopt(ps->recv_endpoint, CURLOPT_PRIVATE, ps);
curl_easy_setopt(ps->recv_endpoint, CURLOPT_CONNECTTIMEOUT,
HTTP_CONNECT_TIMEOUT);
- curl_easy_setopt(ps->recv_endpoint, CURLOPT_BUFFERSIZE,
GNUNET_SERVER_MAX_MESSAGE_SIZE);
+ curl_easy_setopt(ps->recv_endpoint, CURLOPT_BUFFERSIZE,
2*GNUNET_SERVER_MAX_MESSAGE_SIZE);
+#if CURL_TCP_NODELAY
+ curl_easy_setopt(ps->recv_endpoint, CURLOPT_TCP_NODELAY, 1);
+#endif
if (fresh==GNUNET_YES)
{
@@ -1702,7 +1704,10 @@
curl_easy_setopt(ps->send_endpoint, CURLOPT_TIMEOUT, (long)
timeout.value);
curl_easy_setopt(ps->send_endpoint, CURLOPT_PRIVATE, ps);
curl_easy_setopt(ps->send_endpoint, CURLOPT_CONNECTTIMEOUT,
HTTP_CONNECT_TIMEOUT);
- curl_easy_setopt(ps->send_endpoint, CURLOPT_BUFFERSIZE,
GNUNET_SERVER_MAX_MESSAGE_SIZE);
+ curl_easy_setopt(ps->send_endpoint, CURLOPT_BUFFERSIZE, 2 *
GNUNET_SERVER_MAX_MESSAGE_SIZE);
+#if CURL_TCP_NODELAY
+ curl_easy_setopt(ps->send_endpoint, CURLOPT_TCP_NODELAY, 1);
+#endif
if (fresh==GNUNET_YES)
{
@@ -2466,7 +2471,7 @@
MHD_OPTION_CONNECTION_LIMIT, (unsigned
int) 32,
//MHD_OPTION_PER_IP_CONNECTION_LIMIT,
(unsigned int) 6,
MHD_OPTION_CONNECTION_TIMEOUT,
(unsigned int) timeout,
- MHD_OPTION_CONNECTION_MEMORY_LIMIT,
(size_t) (16 * 1024),
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT,
(size_t) (2 * GNUNET_SERVER_MAX_MESSAGE_SIZE),
MHD_OPTION_NOTIFY_COMPLETED,
&mhd_termination_cb, NULL,
MHD_OPTION_EXTERNAL_LOGGER, mhd_logger,
plugin->mhd_log,
MHD_OPTION_END);
@@ -2485,7 +2490,7 @@
MHD_OPTION_CONNECTION_LIMIT, (unsigned
int) 32,
//MHD_OPTION_PER_IP_CONNECTION_LIMIT,
(unsigned int) 6,
MHD_OPTION_CONNECTION_TIMEOUT,
(unsigned int) timeout,
- MHD_OPTION_CONNECTION_MEMORY_LIMIT,
(size_t) (16 * 1024),
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT,
(size_t) (2 * GNUNET_SERVER_MAX_MESSAGE_SIZE),
MHD_OPTION_NOTIFY_COMPLETED,
&mhd_termination_cb, NULL,
MHD_OPTION_EXTERNAL_LOGGER, mhd_logger,
plugin->mhd_log,
MHD_OPTION_END);
Modified: gnunet/src/transport/plugin_transport_https.c
===================================================================
--- gnunet/src/transport/plugin_transport_https.c 2010-09-01 13:53:27 UTC
(rev 12802)
+++ gnunet/src/transport/plugin_transport_https.c 2010-09-01 15:26:24 UTC
(rev 12803)
@@ -48,6 +48,8 @@
#define DEBUG_CONNECTIONS GNUNET_NO
#define DEBUG_SESSION_SELECTION GNUNET_NO
+#define CURL_TCP_NODELAY GNUNET_YES
+
#define INBOUND GNUNET_NO
#define OUTBOUND GNUNET_YES
@@ -1688,6 +1690,9 @@
curl_easy_setopt(ps->recv_endpoint, CURLOPT_PRIVATE, ps);
curl_easy_setopt(ps->recv_endpoint, CURLOPT_CONNECTTIMEOUT,
HTTP_CONNECT_TIMEOUT);
curl_easy_setopt(ps->recv_endpoint, CURLOPT_BUFFERSIZE,
GNUNET_SERVER_MAX_MESSAGE_SIZE);
+#if CURL_TCP_NODELAY
+ curl_easy_setopt(ps->recv_endpoint, CURLOPT_TCP_NODELAY, 1);
+#endif
if (fresh==GNUNET_YES)
{
@@ -1779,6 +1784,9 @@
curl_easy_setopt(ps->send_endpoint, CURLOPT_PRIVATE, ps);
curl_easy_setopt(ps->send_endpoint, CURLOPT_CONNECTTIMEOUT,
HTTP_CONNECT_TIMEOUT);
curl_easy_setopt(ps->send_endpoint, CURLOPT_BUFFERSIZE,
GNUNET_SERVER_MAX_MESSAGE_SIZE);
+#if CURL_TCP_NODELAY
+ curl_easy_setopt(ps->send_endpoint, CURLOPT_TCP_NODELAY, 1);
+#endif
if (fresh==GNUNET_YES)
{
@@ -2608,18 +2616,14 @@
port,
&mhd_accept_cb,
plugin , &mdh_access_cb, plugin,
- /*MHD_OPTION_HTTPS_PRIORITIES,
"NORMAL:",*/
- /*MHD_OPTION_HTTPS_PRIORITIES,
"PERFORMANCE:",*/
- /* MHD_OPTION_HTTPS_PRIORITIES,
"NONE:+VERS-TLS1.0:+ARCFOUR-128:+SHA1:+RSA:+COMP-NULL", */
- /*MHD_OPTION_HTTPS_PRIORITIES,
"NONE:+VERS-TLS1.0:+ARCFOUR-128:+MD5:+RSA:+COMP-NULL",*/
- MHD_OPTION_HTTPS_PRIORITIES,
plugin->crypto_init,
+ MHD_OPTION_HTTPS_PRIORITIES,
plugin->crypto_init,
MHD_OPTION_HTTPS_MEM_KEY, plugin->key,
MHD_OPTION_HTTPS_MEM_CERT, plugin->cert,
MHD_OPTION_SOCK_ADDR, tmp,
MHD_OPTION_CONNECTION_LIMIT, (unsigned
int) 32,
//MHD_OPTION_PER_IP_CONNECTION_LIMIT,
(unsigned int) 6,
MHD_OPTION_CONNECTION_TIMEOUT,
(unsigned int) timeout,
- MHD_OPTION_CONNECTION_MEMORY_LIMIT,
(size_t) (16 * 1024),
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT,
(size_t) 2 * GNUNET_SERVER_MAX_MESSAGE_SIZE,
MHD_OPTION_NOTIFY_COMPLETED,
&mhd_termination_cb, NULL,
MHD_OPTION_EXTERNAL_LOGGER, mhd_logger,
plugin->mhd_log,
MHD_OPTION_END);
@@ -2634,18 +2638,14 @@
port,
&mhd_accept_cb,
plugin , &mdh_access_cb, plugin,
- /*MHD_OPTION_HTTPS_PRIORITIES,
"NORMAL:",*/
- /*MHD_OPTION_HTTPS_PRIORITIES,
"PERFORMANCE:",*/
- /* MHD_OPTION_HTTPS_PRIORITIES,
"NONE:+VERS-TLS1.0:+ARCFOUR-128:+SHA1:+RSA:+COMP-NULL", */
- /*MHD_OPTION_HTTPS_PRIORITIES,
"NONE:+VERS-TLS1.0:+ARCFOUR-128:+MD5:+RSA:+COMP-NULL",*/
- MHD_OPTION_HTTPS_PRIORITIES,
plugin->crypto_init,
+
MHD_OPTION_HTTPS_PRIORITIES, plugin->crypto_init,
MHD_OPTION_HTTPS_MEM_KEY, plugin->key,
MHD_OPTION_HTTPS_MEM_CERT, plugin->cert,
MHD_OPTION_SOCK_ADDR, (struct
sockaddr_in *)plugin->bind4_address,
MHD_OPTION_CONNECTION_LIMIT, (unsigned
int) 32,
//MHD_OPTION_PER_IP_CONNECTION_LIMIT,
(unsigned int) 6,
MHD_OPTION_CONNECTION_TIMEOUT,
(unsigned int) timeout,
- MHD_OPTION_CONNECTION_MEMORY_LIMIT,
(size_t) (16 * 1024),
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT,
(size_t) 2 * GNUNET_SERVER_MAX_MESSAGE_SIZE,
MHD_OPTION_NOTIFY_COMPLETED,
&mhd_termination_cb, NULL,
MHD_OPTION_EXTERNAL_LOGGER, mhd_logger,
plugin->mhd_log,
MHD_OPTION_END);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r12803 - gnunet/src/transport,
gnunet <=