diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-12-06 17:43:49 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-12-06 17:43:49 +0000 |
commit | 197c25b64e8cf36d25914dccc45247cb7e70f4b3 (patch) | |
tree | ff8ad89d2260463da08925061d1fac8c2dd71fe8 /src/transport/plugin_transport_http.c | |
parent | 00392968edfba24d572cc5fe200b62f51b597f5e (diff) | |
download | gnunet-197c25b64e8cf36d25914dccc45247cb7e70f4b3.tar.gz gnunet-197c25b64e8cf36d25914dccc45247cb7e70f4b3.zip |
- modified transport plugin interface to support ATS
- modified transport plugins to support ATS
Diffstat (limited to 'src/transport/plugin_transport_http.c')
-rw-r--r-- | src/transport/plugin_transport_http.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index d94740654..a39893a86 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -873,9 +873,18 @@ static void mhd_write_mst_cb (void *cls, | |||
873 | ntohs(message->size), | 873 | ntohs(message->size), |
874 | GNUNET_i2s(&(ps->peercontext)->identity),http_plugin_address_to_string(NULL,ps->addr,ps->addrlen)); | 874 | GNUNET_i2s(&(ps->peercontext)->identity),http_plugin_address_to_string(NULL,ps->addr,ps->addrlen)); |
875 | #endif | 875 | #endif |
876 | struct GNUNET_TRANSPORT_ATS_Information distance[2]; | ||
877 | distance[0].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE); | ||
878 | distance[0].value = htonl (1); | ||
879 | distance[1].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); | ||
880 | distance[1].value = htonl (0); | ||
881 | |||
876 | delay = pc->plugin->env->receive (ps->peercontext->plugin->env->cls, | 882 | delay = pc->plugin->env->receive (ps->peercontext->plugin->env->cls, |
877 | &pc->identity, | 883 | &pc->identity, |
878 | message, 1, ps, | 884 | message, |
885 | (const struct GNUNET_TRANSPORT_ATS_Information *) &distance, | ||
886 | 2, | ||
887 | ps, | ||
879 | NULL, | 888 | NULL, |
880 | 0); | 889 | 0); |
881 | pc->delay = delay; | 890 | pc->delay = delay; |
@@ -1576,9 +1585,17 @@ static void curl_receive_mst_cb (void *cls, | |||
1576 | ntohs(message->size), | 1585 | ntohs(message->size), |
1577 | GNUNET_i2s(&(pc->identity)),http_plugin_address_to_string(NULL,ps->addr,ps->addrlen)); | 1586 | GNUNET_i2s(&(pc->identity)),http_plugin_address_to_string(NULL,ps->addr,ps->addrlen)); |
1578 | #endif | 1587 | #endif |
1588 | struct GNUNET_TRANSPORT_ATS_Information distance[2]; | ||
1589 | distance[0].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE); | ||
1590 | distance[0].value = htonl (1); | ||
1591 | distance[1].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); | ||
1592 | distance[1].value = htonl (0); | ||
1593 | |||
1579 | delay = pc->plugin->env->receive (pc->plugin->env->cls, | 1594 | delay = pc->plugin->env->receive (pc->plugin->env->cls, |
1580 | &pc->identity, | 1595 | &pc->identity, |
1581 | message, 1, ps, | 1596 | message, |
1597 | (const struct GNUNET_TRANSPORT_ATS_Information *) &distance, 2, | ||
1598 | ps, | ||
1582 | ps->addr, | 1599 | ps->addr, |
1583 | ps->addrlen); | 1600 | ps->addrlen); |
1584 | 1601 | ||