aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-07-11 13:48:18 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-07-11 13:48:18 +0000
commit36c4ecff1e4892ba9a54e9bc3c80af7f0fb97c53 (patch)
treed7b8662bb154d13998a5a3b86de237e7ae818389 /src/transport/plugin_transport_http_server.c
parent8a03d1738d8db6293778be8becb6eaf2ed3a9a0a (diff)
downloadgnunet-36c4ecff1e4892ba9a54e9bc3c80af7f0fb97c53.tar.gz
gnunet-36c4ecff1e4892ba9a54e9bc3c80af7f0fb97c53.zip
fixed:
inbound address size reporting inbound sessions
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index b5b27aa0f..0d072c9e9 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -1118,10 +1118,6 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin,
1118 ats.type = htonl (GNUNET_ATS_NET_WAN); 1118 ats.type = htonl (GNUNET_ATS_NET_WAN);
1119 return NULL; 1119 return NULL;
1120 } 1120 }
1121 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
1122 "Creating new session for peer `%s' connecting from `%s'\n",
1123 GNUNET_i2s (&target),
1124 http_common_plugin_address_to_string (NULL, p->protocol, addr, addr_len));
1125 1121
1126 s = GNUNET_malloc (sizeof (struct Session)); 1122 s = GNUNET_malloc (sizeof (struct Session));
1127 memcpy (&s->target, &target, sizeof (struct GNUNET_PeerIdentity)); 1123 memcpy (&s->target, &target, sizeof (struct GNUNET_PeerIdentity));
@@ -1138,6 +1134,11 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin,
1138 s->connect_in_progress = GNUNET_YES; 1134 s->connect_in_progress = GNUNET_YES;
1139 server_start_session_timeout(s); 1135 server_start_session_timeout(s);
1140 GNUNET_CONTAINER_DLL_insert (plugin->head, plugin->tail, s); 1136 GNUNET_CONTAINER_DLL_insert (plugin->head, plugin->tail, s);
1137
1138 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
1139 "Creating new session %p for peer `%s' connecting from `%s'\n",
1140 s, GNUNET_i2s (&target),
1141 http_common_plugin_address_to_string (NULL, p->protocol, addr, addr_len));
1141 } 1142 }
1142 sc = GNUNET_malloc (sizeof (struct ServerConnection)); 1143 sc = GNUNET_malloc (sizeof (struct ServerConnection));
1143 if (conn_info->client_addr->sa_family == AF_INET) 1144 if (conn_info->client_addr->sa_family == AF_INET)
@@ -1156,7 +1157,7 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin,
1156 if ((NULL != s->server_send) && (NULL != s->server_recv)) 1157 if ((NULL != s->server_send) && (NULL != s->server_recv))
1157 { 1158 {
1158 s->connect_in_progress = GNUNET_NO; /* PUT and GET are connected */ 1159 s->connect_in_progress = GNUNET_NO; /* PUT and GET are connected */
1159 plugin->env->session_start (NULL, &s->target, PLUGIN_NAME,s->addr, s->addrlen,s, NULL, 0); 1160 plugin->env->session_start (NULL, &s->target, PLUGIN_NAME, NULL, 0 ,s, NULL, 0);
1160 } 1161 }
1161 1162
1162#if MHD_VERSION >= 0x00090E00 1163#if MHD_VERSION >= 0x00090E00
@@ -1305,14 +1306,11 @@ server_receive_mst_cb (void *cls, void *client,
1305 delay = plugin->env->receive (plugin->env->cls, 1306 delay = plugin->env->receive (plugin->env->cls,
1306 &s->target, 1307 &s->target,
1307 message, 1308 message,
1308 s, s->addr, s->addrlen); 1309 s, NULL, 0);
1309 1310
1310 plugin->env->update_address_metrics (plugin->env->cls, 1311 plugin->env->update_address_metrics (plugin->env->cls,
1311 &s->target, 1312 &s->target,
1312 s->addr, 1313 NULL, 0, s, &atsi, 1);
1313 s->addrlen,
1314 s,
1315 &atsi, 1);
1316 1314
1317 GNUNET_asprintf (&stat_txt, "# bytes received via %s_server", plugin->protocol); 1315 GNUNET_asprintf (&stat_txt, "# bytes received via %s_server", plugin->protocol);
1318 GNUNET_STATISTICS_update (plugin->env->stats, 1316 GNUNET_STATISTICS_update (plugin->env->stats,