diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-27 10:04:42 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-27 10:04:42 +0000 |
commit | f47cc990ea9a89cb39acc9c6a9789e6474197708 (patch) | |
tree | f8301a2b5405ed692592fb98c94d53dc4a9c9151 /src/transport/plugin_transport_http.c | |
parent | abcb868988fd2d754e13ef5122c8ada9c404b273 (diff) | |
download | gnunet-f47cc990ea9a89cb39acc9c6a9789e6474197708.tar.gz gnunet-f47cc990ea9a89cb39acc9c6a9789e6474197708.zip |
Refactoring gnunet time
Diffstat (limited to 'src/transport/plugin_transport_http.c')
-rw-r--r-- | src/transport/plugin_transport_http.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index ac04610c1..e4c88903f 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -882,10 +882,10 @@ static void mhd_write_mst_cb (void *cls, | |||
882 | if (pc->reset_task != GNUNET_SCHEDULER_NO_TASK) | 882 | if (pc->reset_task != GNUNET_SCHEDULER_NO_TASK) |
883 | GNUNET_SCHEDULER_cancel (pc->plugin->env->sched, pc->reset_task); | 883 | GNUNET_SCHEDULER_cancel (pc->plugin->env->sched, pc->reset_task); |
884 | 884 | ||
885 | if (delay.value > 0) | 885 | if (delay.rel_value > 0) |
886 | { | 886 | { |
887 | #if DEBUG_HTTP | 887 | #if DEBUG_HTTP |
888 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.value); | 888 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.rel_value); |
889 | #endif | 889 | #endif |
890 | pc->reset_task = GNUNET_SCHEDULER_add_delayed (pc->plugin->env->sched, delay, &reset_inbound_quota_delay, pc); | 890 | pc->reset_task = GNUNET_SCHEDULER_add_delayed (pc->plugin->env->sched, delay, &reset_inbound_quota_delay, pc); |
891 | } | 891 | } |
@@ -1182,7 +1182,7 @@ mhd_access_cb (void *cls, | |||
1182 | /* Recieving data */ | 1182 | /* Recieving data */ |
1183 | if ((*upload_data_size > 0) && (ps->recv_active == GNUNET_YES)) | 1183 | if ((*upload_data_size > 0) && (ps->recv_active == GNUNET_YES)) |
1184 | { | 1184 | { |
1185 | if (pc->delay.value == 0) | 1185 | if (pc->delay.rel_value == 0) |
1186 | { | 1186 | { |
1187 | #if DEBUG_HTTP | 1187 | #if DEBUG_HTTP |
1188 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: PUT with %u bytes forwarded to MST\n", ps, *upload_data_size); | 1188 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: PUT with %u bytes forwarded to MST\n", ps, *upload_data_size); |
@@ -1193,7 +1193,7 @@ mhd_access_cb (void *cls, | |||
1193 | else | 1193 | else |
1194 | { | 1194 | { |
1195 | #if DEBUG_HTTP | 1195 | #if DEBUG_HTTP |
1196 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: no inbound bandwidth available! Next read was delayed for %llu ms\n", ps, ps->peercontext->delay.value); | 1196 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: no inbound bandwidth available! Next read was delayed for %llu ms\n", ps, ps->peercontext->delay.rel_value); |
1197 | #endif | 1197 | #endif |
1198 | } | 1198 | } |
1199 | return MHD_YES; | 1199 | return MHD_YES; |
@@ -1264,7 +1264,7 @@ http_server_daemon_prepare (struct Plugin *plugin , struct MHD_Daemon *daemon_ha | |||
1264 | &max)); | 1264 | &max)); |
1265 | haveto = MHD_get_timeout (daemon_handle, &timeout); | 1265 | haveto = MHD_get_timeout (daemon_handle, &timeout); |
1266 | if (haveto == MHD_YES) | 1266 | if (haveto == MHD_YES) |
1267 | tv.value = (uint64_t) timeout; | 1267 | tv.rel_value = (uint64_t) timeout; |
1268 | else | 1268 | else |
1269 | tv = GNUNET_TIME_UNIT_SECONDS; | 1269 | tv = GNUNET_TIME_UNIT_SECONDS; |
1270 | GNUNET_NETWORK_fdset_copy_native (wrs, &rs, max + 1); | 1270 | GNUNET_NETWORK_fdset_copy_native (wrs, &rs, max + 1); |
@@ -1588,10 +1588,10 @@ static void curl_receive_mst_cb (void *cls, | |||
1588 | if (pc->reset_task != GNUNET_SCHEDULER_NO_TASK) | 1588 | if (pc->reset_task != GNUNET_SCHEDULER_NO_TASK) |
1589 | GNUNET_SCHEDULER_cancel (pc->plugin->env->sched, pc->reset_task); | 1589 | GNUNET_SCHEDULER_cancel (pc->plugin->env->sched, pc->reset_task); |
1590 | 1590 | ||
1591 | if (delay.value > 0) | 1591 | if (delay.rel_value > 0) |
1592 | { | 1592 | { |
1593 | #if DEBUG_HTTP | 1593 | #if DEBUG_HTTP |
1594 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.value); | 1594 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Inbound quota management: delay next read for %llu ms \n", ps, delay.abs_value); |
1595 | #endif | 1595 | #endif |
1596 | pc->reset_task = GNUNET_SCHEDULER_add_delayed (pc->plugin->env->sched, delay, &reset_inbound_quota_delay, pc); | 1596 | pc->reset_task = GNUNET_SCHEDULER_add_delayed (pc->plugin->env->sched, delay, &reset_inbound_quota_delay, pc); |
1597 | } | 1597 | } |
@@ -1611,10 +1611,10 @@ static size_t curl_receive_cb( void *stream, size_t size, size_t nmemb, void *pt | |||
1611 | { | 1611 | { |
1612 | struct Session * ps = ptr; | 1612 | struct Session * ps = ptr; |
1613 | 1613 | ||
1614 | if (ps->peercontext->delay.value > 0) | 1614 | if (ps->peercontext->delay.rel_value > 0) |
1615 | { | 1615 | { |
1616 | #if DEBUG_HTTP | 1616 | #if DEBUG_HTTP |
1617 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: no inbound bandwidth available! Next read was delayed for %llu ms\n", ps, ps->peercontext->delay.value); | 1617 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: no inbound bandwidth available! Next read was delayed for %llu ms\n", ps, ps->peercontext->delay.rel_value); |
1618 | #endif | 1618 | #endif |
1619 | return (0); | 1619 | return (0); |
1620 | } | 1620 | } |
@@ -1935,7 +1935,7 @@ static int send_check_connections (struct Plugin *plugin, struct Session *ps) | |||
1935 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_READDATA, ps); | 1935 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_READDATA, ps); |
1936 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_WRITEFUNCTION, curl_receive_cb); | 1936 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_WRITEFUNCTION, curl_receive_cb); |
1937 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_WRITEDATA, ps); | 1937 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_WRITEDATA, ps); |
1938 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_TIMEOUT, (long) timeout.value); | 1938 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_TIMEOUT, (long) timeout.rel_value); |
1939 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_PRIVATE, ps); | 1939 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_PRIVATE, ps); |
1940 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_CONNECTTIMEOUT, HTTP_CONNECT_TIMEOUT); | 1940 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_CONNECTTIMEOUT, HTTP_CONNECT_TIMEOUT); |
1941 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_BUFFERSIZE, 2*GNUNET_SERVER_MAX_MESSAGE_SIZE); | 1941 | curl_easy_setopt(ps->recv_endpoint, CURLOPT_BUFFERSIZE, 2*GNUNET_SERVER_MAX_MESSAGE_SIZE); |
@@ -2034,7 +2034,7 @@ static int send_check_connections (struct Plugin *plugin, struct Session *ps) | |||
2034 | curl_easy_setopt(ps->send_endpoint, CURLOPT_READDATA, ps); | 2034 | curl_easy_setopt(ps->send_endpoint, CURLOPT_READDATA, ps); |
2035 | curl_easy_setopt(ps->send_endpoint, CURLOPT_WRITEFUNCTION, curl_receive_cb); | 2035 | curl_easy_setopt(ps->send_endpoint, CURLOPT_WRITEFUNCTION, curl_receive_cb); |
2036 | curl_easy_setopt(ps->send_endpoint, CURLOPT_READDATA, ps); | 2036 | curl_easy_setopt(ps->send_endpoint, CURLOPT_READDATA, ps); |
2037 | curl_easy_setopt(ps->send_endpoint, CURLOPT_TIMEOUT, (long) timeout.value); | 2037 | curl_easy_setopt(ps->send_endpoint, CURLOPT_TIMEOUT, (long) timeout.rel_value); |
2038 | curl_easy_setopt(ps->send_endpoint, CURLOPT_PRIVATE, ps); | 2038 | curl_easy_setopt(ps->send_endpoint, CURLOPT_PRIVATE, ps); |
2039 | curl_easy_setopt(ps->send_endpoint, CURLOPT_CONNECTTIMEOUT, HTTP_CONNECT_TIMEOUT); | 2039 | curl_easy_setopt(ps->send_endpoint, CURLOPT_CONNECTTIMEOUT, HTTP_CONNECT_TIMEOUT); |
2040 | curl_easy_setopt(ps->send_endpoint, CURLOPT_BUFFERSIZE, 2 * GNUNET_SERVER_MAX_MESSAGE_SIZE); | 2040 | curl_easy_setopt(ps->send_endpoint, CURLOPT_BUFFERSIZE, 2 * GNUNET_SERVER_MAX_MESSAGE_SIZE); |
@@ -2982,7 +2982,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
2982 | GNUNET_assert ((port > 0) && (port <= 65535)); | 2982 | GNUNET_assert ((port > 0) && (port <= 65535)); |
2983 | plugin->port_inbound = port; | 2983 | plugin->port_inbound = port; |
2984 | gn_timeout = GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT; | 2984 | gn_timeout = GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT; |
2985 | unsigned int timeout = (gn_timeout.value) / 1000; | 2985 | unsigned int timeout = (gn_timeout.rel_value) / 1000; |
2986 | if ((plugin->http_server_daemon_v6 == NULL) && (plugin->use_ipv6 == GNUNET_YES) && (port != 0)) | 2986 | if ((plugin->http_server_daemon_v6 == NULL) && (plugin->use_ipv6 == GNUNET_YES) && (port != 0)) |
2987 | { | 2987 | { |
2988 | struct sockaddr * tmp = (struct sockaddr *) plugin->bind6_address; | 2988 | struct sockaddr * tmp = (struct sockaddr *) plugin->bind6_address; |