aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-12-14 10:25:30 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-12-14 10:25:30 +0000
commit99f22366b29bf928a4fb18c36a63bf4d3b122e88 (patch)
tree7a302d0c0ee2c76f2dc2146a58a0a4b6fc54f083 /src/transport/plugin_transport_http_server.c
parent2a46bac24eaca8ce16d12359e88f4a9d3cf49c28 (diff)
downloadgnunet-99f22366b29bf928a4fb18c36a63bf4d3b122e88.tar.gz
gnunet-99f22366b29bf928a4fb18c36a63bf4d3b122e88.zip
WAN/LAN for HTTP/S
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 24c27aced..10c8268b1 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -369,7 +369,7 @@ server_lookup_session (struct Plugin *plugin,
369 struct Session *t; 369 struct Session *t;
370 struct ServerConnection *sc = NULL; 370 struct ServerConnection *sc = NULL;
371 const union MHD_ConnectionInfo *conn_info; 371 const union MHD_ConnectionInfo *conn_info;
372 372 struct GNUNET_ATS_Information ats;
373 struct IPv4HttpAddress a4; 373 struct IPv4HttpAddress a4;
374 struct IPv6HttpAddress a6; 374 struct IPv6HttpAddress a6;
375 struct sockaddr_in *s4; 375 struct sockaddr_in *s4;
@@ -521,6 +521,7 @@ create:
521 GNUNET_i2s (&target)); 521 GNUNET_i2s (&target));
522#endif 522#endif
523 523
524
524 switch (conn_info->client_addr->sa_family) 525 switch (conn_info->client_addr->sa_family)
525 { 526 {
526 case (AF_INET): 527 case (AF_INET):
@@ -529,6 +530,7 @@ create:
529 memcpy (&a4.ipv4_addr, &s4->sin_addr, sizeof (struct in_addr)); 530 memcpy (&a4.ipv4_addr, &s4->sin_addr, sizeof (struct in_addr));
530 a = &a4; 531 a = &a4;
531 a_len = sizeof (struct IPv4HttpAddress); 532 a_len = sizeof (struct IPv4HttpAddress);
533 ats = plugin->env->get_address_type (plugin->env->cls, (const struct sockaddr *) s4, sizeof (struct sockaddr_in));
532 break; 534 break;
533 case (AF_INET6): 535 case (AF_INET6):
534 s6 = ((struct sockaddr_in6 *) conn_info->client_addr); 536 s6 = ((struct sockaddr_in6 *) conn_info->client_addr);
@@ -536,12 +538,14 @@ create:
536 memcpy (&a6.ipv6_addr, &s6->sin6_addr, sizeof (struct in6_addr)); 538 memcpy (&a6.ipv6_addr, &s6->sin6_addr, sizeof (struct in6_addr));
537 a = &a6; 539 a = &a6;
538 a_len = sizeof (struct IPv6HttpAddress); 540 a_len = sizeof (struct IPv6HttpAddress);
541 ats = plugin->env->get_address_type (plugin->env->cls, (const struct sockaddr *) s6, sizeof (struct sockaddr_in6));
539 break; 542 break;
540 default: 543 default:
541 GNUNET_break (0); 544 GNUNET_break (0);
542 goto error; 545 goto error;
543 } 546 }
544 s = create_session (plugin, &target, a, a_len, NULL, NULL); 547 s = create_session (plugin, &target, a, a_len, NULL, NULL);
548 s->ats_address_network_type = ats.value;
545 549
546 s->inbound = GNUNET_YES; 550 s->inbound = GNUNET_YES;
547 s->next_receive = GNUNET_TIME_absolute_get_zero (); 551 s->next_receive = GNUNET_TIME_absolute_get_zero ();