diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-09-17 15:21:07 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-09-17 15:21:07 +0000 |
commit | c74a75ecca434556774637cc72286bc4affa07b9 (patch) | |
tree | e8c4707f4f7be6740fd04a9b99c71a8e268abca4 | |
parent | 0023bacc0565ad444e8facefd1db9b622a8e07d4 (diff) | |
download | gnunet-c74a75ecca434556774637cc72286bc4affa07b9.tar.gz gnunet-c74a75ecca434556774637cc72286bc4affa07b9.zip |
- work in progress
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 16 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 21 | ||||
-rw-r--r-- | src/transport/test_transport_api_http_reverse_peer2.conf | 2 |
3 files changed, 20 insertions, 19 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index db1250236..7d3c8f9ea 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | #define VERBOSE_CURL GNUNET_YES | 35 | #define VERBOSE_CURL GNUNET_YES |
36 | 36 | ||
37 | #define PUT_DISCONNECT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1) | 37 | #define PUT_DISCONNECT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2) |
38 | 38 | ||
39 | #define ENABLE_PUT GNUNET_YES | 39 | #define ENABLE_PUT GNUNET_YES |
40 | #define ENABLE_GET GNUNET_YES | 40 | #define ENABLE_GET GNUNET_YES |
@@ -785,7 +785,7 @@ client_wake_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
785 | 785 | ||
786 | 786 | ||
787 | /** | 787 | /** |
788 | * Callback for message stream tokenixer | 788 | * Callback for message stream tokenizer |
789 | * | 789 | * |
790 | * @param cls the session | 790 | * @param cls the session |
791 | * @param client not used | 791 | * @param client not used |
@@ -800,15 +800,14 @@ client_receive_mst_cb (void *cls, void *client, | |||
800 | struct HTTP_Client_Plugin *plugin; | 800 | struct HTTP_Client_Plugin *plugin; |
801 | struct GNUNET_TIME_Relative delay; | 801 | struct GNUNET_TIME_Relative delay; |
802 | struct GNUNET_ATS_Information atsi[2]; | 802 | struct GNUNET_ATS_Information atsi[2]; |
803 | 803 | //GNUNET_break (0); | |
804 | if (GNUNET_YES != client_exist_session(p, s)) | 804 | if (GNUNET_YES != client_exist_session(p, s)) |
805 | { | 805 | { |
806 | GNUNET_break (0); | 806 | GNUNET_break (0); |
807 | return GNUNET_OK; | 807 | return GNUNET_OK; |
808 | } | 808 | } |
809 | plugin = s->plugin; | 809 | plugin = s->plugin; |
810 | 810 | //GNUNET_break (0); | |
811 | |||
812 | atsi[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); | 811 | atsi[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); |
813 | atsi[0].value = htonl (1); | 812 | atsi[0].value = htonl (1); |
814 | atsi[1].type = htonl (GNUNET_ATS_NETWORK_TYPE); | 813 | atsi[1].type = htonl (GNUNET_ATS_NETWORK_TYPE); |
@@ -876,7 +875,10 @@ client_receive (void *stream, size_t size, size_t nmemb, void *cls) | |||
876 | } | 875 | } |
877 | if (NULL == s->msg_tk) | 876 | if (NULL == s->msg_tk) |
878 | s->msg_tk = GNUNET_SERVER_mst_create (&client_receive_mst_cb, s); | 877 | s->msg_tk = GNUNET_SERVER_mst_create (&client_receive_mst_cb, s); |
879 | GNUNET_SERVER_mst_receive (s->msg_tk, s, stream, len, GNUNET_NO, GNUNET_NO); | 878 | //GNUNET_break (0); |
879 | int res = GNUNET_SERVER_mst_receive (s->msg_tk, s, stream, len, GNUNET_NO, GNUNET_NO); | ||
880 | //GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MST RESULT : %u \n" , res); | ||
881 | //GNUNET_break (0); | ||
880 | return len; | 882 | return len; |
881 | 883 | ||
882 | } | 884 | } |
@@ -1027,7 +1029,7 @@ client_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1027 | if (s->client_get == NULL) | 1029 | if (s->client_get == NULL) |
1028 | { | 1030 | { |
1029 | /* Disconnect other transmission direction and tell transport */ | 1031 | /* Disconnect other transmission direction and tell transport */ |
1030 | client_disconnect (s); | 1032 | //client_disconnect (s); |
1031 | } | 1033 | } |
1032 | } | 1034 | } |
1033 | if (easy_h == s->client_get) | 1035 | if (easy_h == s->client_get) |
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 2acbbaeb1..6d4549f35 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -1473,20 +1473,19 @@ server_disconnect_cb (void *cls, struct MHD_Connection *connection, | |||
1473 | GNUNET_free (sc); | 1473 | GNUNET_free (sc); |
1474 | plugin->cur_connections--; | 1474 | plugin->cur_connections--; |
1475 | 1475 | ||
1476 | if (((s->server_send == NULL) || (s->server_recv == NULL)) && | ||
1477 | ((GNUNET_YES == s->session_passed) && (GNUNET_NO == s->session_ended))) | ||
1478 | { | ||
1479 | /* Notify transport immediately that this session is invalid */ | ||
1480 | s->session_ended = GNUNET_YES; | ||
1481 | plugin->env->session_end (plugin->env->cls, &s->target, s); | ||
1482 | } | ||
1483 | |||
1484 | if ((s->server_send == NULL) && (s->server_recv == NULL)) | 1476 | if ((s->server_send == NULL) && (s->server_recv == NULL)) |
1485 | { | 1477 | { |
1486 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 1478 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
1487 | "Peer `%s' on address `%s' disconnected\n", | 1479 | "Peer `%s' on address `%s' disconnected\n", |
1488 | GNUNET_i2s (&s->target), | 1480 | GNUNET_i2s (&s->target), |
1489 | http_common_plugin_address_to_string (NULL, s->addr, s->addrlen)); | 1481 | http_common_plugin_address_to_string (NULL, s->addr, s->addrlen)); |
1482 | |||
1483 | if ((GNUNET_YES == s->session_passed) && (GNUNET_NO == s->session_ended)) | ||
1484 | { | ||
1485 | /* Notify transport immediately that this session is invalid */ | ||
1486 | s->session_ended = GNUNET_YES; | ||
1487 | plugin->env->session_end (plugin->env->cls, &s->target, s); | ||
1488 | } | ||
1490 | server_delete_session (s); | 1489 | server_delete_session (s); |
1491 | } | 1490 | } |
1492 | 1491 | ||
@@ -1636,10 +1635,10 @@ server_schedule (struct HTTP_Server_Plugin *plugin, | |||
1636 | last_timeout, timeout); | 1635 | last_timeout, timeout); |
1637 | last_timeout = timeout; | 1636 | last_timeout = timeout; |
1638 | } | 1637 | } |
1639 | if (timeout <= GNUNET_TIME_UNIT_SECONDS.rel_value) | 1638 | //if (timeout <= GNUNET_TIME_UNIT_SECONDS.rel_value) |
1640 | tv.rel_value = (uint64_t) timeout; | 1639 | tv.rel_value = (uint64_t) timeout; |
1641 | else | 1640 | //else |
1642 | tv = GNUNET_TIME_UNIT_SECONDS; | 1641 | //tv = GNUNET_TIME_UNIT_SECONDS; |
1643 | } | 1642 | } |
1644 | else | 1643 | else |
1645 | tv = GNUNET_TIME_UNIT_SECONDS; | 1644 | tv = GNUNET_TIME_UNIT_SECONDS; |
diff --git a/src/transport/test_transport_api_http_reverse_peer2.conf b/src/transport/test_transport_api_http_reverse_peer2.conf index d38a4c0ee..c7e9d4fe1 100644 --- a/src/transport/test_transport_api_http_reverse_peer2.conf +++ b/src/transport/test_transport_api_http_reverse_peer2.conf | |||
@@ -7,7 +7,7 @@ DEFAULTCONFIG = test_transport_api_http_reverse_peer2.conf | |||
7 | [transport-http_client] | 7 | [transport-http_client] |
8 | 8 | ||
9 | [transport-http_server] | 9 | [transport-http_server] |
10 | PORT = 12080 | 10 | PORT = 8080 |
11 | EXTERNAL_HOSTNAME = fulcrum.net.in.tum.de/gnunet | 11 | EXTERNAL_HOSTNAME = fulcrum.net.in.tum.de/gnunet |
12 | EXTERNAL_HOSTNAME_ONLY = YES | 12 | EXTERNAL_HOSTNAME_ONLY = YES |
13 | #USE_IPV4 = YES | 13 | #USE_IPV4 = YES |