aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-09-26 14:44:29 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-09-26 14:44:29 +0000
commit659f91758ced91c6a993e6632d8cbada69246bc7 (patch)
treec47365c20829cf2951d5e88a4dff2206497900eb /src/transport
parentbc7af64f95c314bb67dc6ee69d466065edd811d5 (diff)
downloadgnunet-659f91758ced91c6a993e6632d8cbada69246bc7.tar.gz
gnunet-659f91758ced91c6a993e6632d8cbada69246bc7.zip
fixes
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/plugin_transport_http_client.c26
-rw-r--r--src/transport/plugin_transport_http_new.c18
2 files changed, 27 insertions, 17 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index c5fea94a1..e4942248a 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -189,7 +189,7 @@ client_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
189 { 189 {
190#if DEBUG_HTTP 190#if DEBUG_HTTP
191 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 191 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
192 "Client: %X connection to '%s' %s ended\n", s, GNUNET_i2s(&s->target), GNUNET_a2s (s->addr, s->addrlen)); 192 "Client: %X connection to '%s' %s ended\n", msg->easy_handle, GNUNET_i2s(&s->target), GNUNET_a2s (s->addr, s->addrlen));
193#endif 193#endif
194 client_disconnect(s); 194 client_disconnect(s);
195 //GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,"Notifying about ended session to peer `%s' `%s'\n", GNUNET_i2s (&s->target), http_plugin_address_to_string (plugin, s->addr, s->addrlen)); 195 //GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,"Notifying about ended session to peer `%s' `%s'\n", GNUNET_i2s (&s->target), http_plugin_address_to_string (plugin, s->addr, s->addrlen));
@@ -214,15 +214,17 @@ client_disconnect (struct Session *s)
214 struct HTTP_Message * msg; 214 struct HTTP_Message * msg;
215 struct HTTP_Message * t; 215 struct HTTP_Message * t;
216 216
217
218
219 if (s->client_put != NULL)
220 {
217#if DEBUG_HTTP 221#if DEBUG_HTTP
218 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 222 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
219 "Client: %X Deleting outbound PUT session to peer `%s'\n", 223 "Client: %X Deleting outbound PUT session to peer `%s'\n",
220 s, 224 s->client_put,
221 GNUNET_i2s (&s->target)); 225 GNUNET_i2s (&s->target));
222#endif 226#endif
223 227
224 if (s->client_put != NULL)
225 {
226 mret = curl_multi_remove_handle (plugin->client_mh, s->client_put); 228 mret = curl_multi_remove_handle (plugin->client_mh, s->client_put);
227 if (mret != CURLM_OK) 229 if (mret != CURLM_OK)
228 { 230 {
@@ -234,12 +236,7 @@ client_disconnect (struct Session *s)
234 s->client_put = NULL; 236 s->client_put = NULL;
235 } 237 }
236 238
237#if DEBUG_HTTP 239
238 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
239 "Client: %X Deleting outbound GET session to peer `%s'\n",
240 s,
241 GNUNET_i2s (&s->target));
242#endif
243 if (s->recv_wakeup_task != GNUNET_SCHEDULER_NO_TASK) 240 if (s->recv_wakeup_task != GNUNET_SCHEDULER_NO_TASK)
244 { 241 {
245 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task); 242 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task);
@@ -248,6 +245,13 @@ client_disconnect (struct Session *s)
248 245
249 if (s->client_get != NULL) 246 if (s->client_get != NULL)
250 { 247 {
248#if DEBUG_HTTP
249 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
250 "Client: %X Deleting outbound GET session to peer `%s'\n",
251 s->client_get,
252 GNUNET_i2s (&s->target));
253#endif
254
251 mret = curl_multi_remove_handle (plugin->client_mh, s->client_get); 255 mret = curl_multi_remove_handle (plugin->client_mh, s->client_get);
252 if (mret != CURLM_OK) 256 if (mret != CURLM_OK)
253 { 257 {
@@ -429,7 +433,7 @@ client_send_cb (void *stream, size_t size, size_t nmemb, void *cls)
429#if VERBOSE_CLIENT 433#if VERBOSE_CLIENT
430 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 434 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
431 "Client: %X Message with %u bytes sent, removing message from queue\n", 435 "Client: %X Message with %u bytes sent, removing message from queue\n",
432 s, msg->size, msg->pos); 436 s->client_put, msg->size, msg->pos);
433#endif 437#endif
434 /* Calling transmit continuation */ 438 /* Calling transmit continuation */
435 if (NULL != msg->transmit_cont) 439 if (NULL != msg->transmit_cont)
diff --git a/src/transport/plugin_transport_http_new.c b/src/transport/plugin_transport_http_new.c
index 47d4743fd..2c7037694 100644
--- a/src/transport/plugin_transport_http_new.c
+++ b/src/transport/plugin_transport_http_new.c
@@ -494,10 +494,7 @@ http_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target,
494 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name, 494 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
495 "%s exisiting session\n", (s!=NULL) ? "Found" : "NOT Found"); 495 "%s exisiting session\n", (s!=NULL) ? "Found" : "NOT Found");
496#endif 496#endif
497 // FIXME DEBUGGING 497
498 if (session != NULL)
499 s= session;
500 //FIXME END
501 /* create new outbound connection */ 498 /* create new outbound connection */
502 if (s == NULL) 499 if (s == NULL)
503 { 500 {
@@ -656,7 +653,7 @@ nat_add_address (void *cls, int add_remove, const struct sockaddr *addr,
656#if DEBUG_HTTP 653#if DEBUG_HTTP
657 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 654 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
658 "Notifying transport to add IPv6 address `%s'\n", 655 "Notifying transport to add IPv6 address `%s'\n",
659 http_plugin_address_to_string(NULL, &w_t6->addr, sizeof (struct sockaddr_in))); 656 http_plugin_address_to_string(NULL, &w_t6->addr, sizeof (struct sockaddr_in6)));
660#endif 657#endif
661 plugin->env->notify_address (plugin->env->cls, add_remove, &w_t6->addr, sizeof (struct sockaddr_in6)); 658 plugin->env->notify_address (plugin->env->cls, add_remove, &w_t6->addr, sizeof (struct sockaddr_in6));
662 break; 659 break;
@@ -722,7 +719,7 @@ nat_remove_address (void *cls, int add_remove, const struct sockaddr *addr,
722#if DEBUG_HTTP 719#if DEBUG_HTTP
723 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 720 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
724 "Notifying transport to remove IPv6 address `%s'\n", 721 "Notifying transport to remove IPv6 address `%s'\n",
725 http_plugin_address_to_string(NULL, &w_t4->addr, sizeof (struct sockaddr_in))); 722 http_plugin_address_to_string(NULL, &w_t6->addr, sizeof (struct sockaddr_in6)));
726#endif 723#endif
727 plugin->env->notify_address (plugin->env->cls, add_remove, &w_t6->addr, 724 plugin->env->notify_address (plugin->env->cls, add_remove, &w_t6->addr,
728 sizeof (struct sockaddr_in6 )); 725 sizeof (struct sockaddr_in6 ));
@@ -786,6 +783,10 @@ start_report_addresses (struct Plugin *plugin)
786 res = 783 res =
787 GNUNET_SERVICE_get_server_addresses (plugin->name, plugin->env->cfg, 784 GNUNET_SERVICE_get_server_addresses (plugin->name, plugin->env->cfg,
788 &addrs, &addrlens); 785 &addrs, &addrlens);
786#if 0
787 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
788 _("FOUND %u addresses\n"),res);
789#endif
789 790
790 if (res != GNUNET_SYSERR) 791 if (res != GNUNET_SYSERR)
791 { 792 {
@@ -798,6 +799,11 @@ start_report_addresses (struct Plugin *plugin)
798 while (res > 0) 799 while (res > 0)
799 { 800 {
800 res--; 801 res--;
802#if 0
803 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
804 _("FREEING %s\n"),
805 GNUNET_a2s (addrs[res], addrlens[res]));
806#endif
801 GNUNET_assert (addrs[res] != NULL); 807 GNUNET_assert (addrs[res] != NULL);
802 GNUNET_free (addrs[res]); 808 GNUNET_free (addrs[res]);
803 } 809 }