aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport-testing2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport-testing2.c')
-rw-r--r--src/transport/transport-testing2.c50
1 files changed, 23 insertions, 27 deletions
diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c
index ec27ac8ba..11bb6c7d1 100644
--- a/src/transport/transport-testing2.c
+++ b/src/transport/transport-testing2.c
@@ -225,10 +225,10 @@ notify_connect (void *cls,
225 GNUNET_SCHEDULER_cancel (cc->tct); 225 GNUNET_SCHEDULER_cancel (cc->tct);
226 cc->tct = NULL; 226 cc->tct = NULL;
227 } 227 }
228 if (NULL != cc->ats_sh) 228 if (NULL != cc->ah_sh)
229 { 229 {
230 GNUNET_ATS_connectivity_suggest_cancel (cc->ats_sh); 230 GNUNET_TRANSPORT_application_suggest_cancel (cc->ah_sh);
231 cc->ats_sh = NULL; 231 cc->ah_sh = NULL;
232 } 232 }
233 } 233 }
234 } 234 }
@@ -268,6 +268,7 @@ notify_disconnect (void *cls,
268 int no = 0; 268 int no = 0;
269 struct GNUNET_TRANSPORT_TESTING_PeerContext *p2 = NULL; 269 struct GNUNET_TRANSPORT_TESTING_PeerContext *p2 = NULL;
270 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc; 270 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc;
271 struct GNUNET_BANDWIDTH_Value32NBO bw;
271 272
272 p2 = find_peer_context (p->tth, 273 p2 = find_peer_context (p->tth,
273 peer); 274 peer);
@@ -321,10 +322,11 @@ notify_disconnect (void *cls,
321 if (NULL == cc->tct) 322 if (NULL == cc->tct)
322 cc->tct = GNUNET_SCHEDULER_add_now (&offer_hello, 323 cc->tct = GNUNET_SCHEDULER_add_now (&offer_hello,
323 cc); 324 cc);
324 if (NULL == cc->ats_sh) 325 if (NULL == cc->ah_sh)
325 cc->ats_sh = GNUNET_ATS_connectivity_suggest (cc->p1->ats, 326 cc->ah_sh = GNUNET_TRANSPORT_application_suggest (cc->p1->ah,
326 &p2->id, 327 &p2->id,
327 1); 328 GNUNET_MQ_PRIO_BEST_EFFORT,
329 bw);
328 } 330 }
329 } 331 }
330} 332}
@@ -512,11 +514,11 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct
512 GNUNET_free (emsg); 514 GNUNET_free (emsg);
513 return NULL; 515 return NULL;
514 } 516 }
515 p->ats = GNUNET_ATS_connectivity_init (p->cfg); 517 p->ah = GNUNET_TRANSPORT_application_init (p->cfg);
516 if (NULL == p->ats) 518 if (NULL == p->ah)
517 { 519 {
518 LOG (GNUNET_ERROR_TYPE_ERROR, 520 LOG (GNUNET_ERROR_TYPE_ERROR,
519 "Failed to connect to ATS service for peer `%s': `%s'\n", 521 "Failed to connect to TNG service for peer `%s': `%s'\n",
520 cfgname, 522 cfgname,
521 emsg); 523 emsg);
522 GNUNET_TRANSPORT_TESTING_stop_peer (p); 524 GNUNET_TRANSPORT_TESTING_stop_peer (p);
@@ -525,9 +527,6 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct
525 } 527 }
526 p->ph = GNUNET_PEERSTORE_connect (p->cfg); 528 p->ph = GNUNET_PEERSTORE_connect (p->cfg);
527 // FIXME Error handling 529 // FIXME Error handling
528 p->ah = GNUNET_TRANSPORT_application_init (p->cfg);
529 GNUNET_assert (NULL != p->ah);
530 // FIXME Error handling
531 p->rh_task = GNUNET_SCHEDULER_add_now (retrieve_hello, p); 530 p->rh_task = GNUNET_SCHEDULER_add_now (retrieve_hello, p);
532 531
533 return p; 532 return p;
@@ -565,10 +564,10 @@ GNUNET_TRANSPORT_TESTING_restart_peer (struct
565 (cc->p2 == p)) 564 (cc->p2 == p))
566 GNUNET_TRANSPORT_TESTING_connect_peers_cancel (cc); 565 GNUNET_TRANSPORT_TESTING_connect_peers_cancel (cc);
567 } 566 }
568 if (NULL != p->ats) 567 if (NULL != p->ah)
569 { 568 {
570 GNUNET_ATS_connectivity_done (p->ats); 569 GNUNET_TRANSPORT_application_done (p->ah);
571 p->ats = NULL; 570 p->ah = NULL;
572 } 571 }
573 if (GNUNET_SYSERR == 572 if (GNUNET_SYSERR ==
574 GNUNET_TESTING_peer_stop (p->peer)) 573 GNUNET_TESTING_peer_stop (p->peer))
@@ -607,7 +606,7 @@ GNUNET_TRANSPORT_TESTING_restart_peer (struct
607 &notify_connect, 606 &notify_connect,
608 &notify_disconnect); 607 &notify_disconnect);
609 GNUNET_assert (NULL != p->th); 608 GNUNET_assert (NULL != p->th);
610 p->ats = GNUNET_ATS_connectivity_init (p->cfg); 609 p->ah = GNUNET_TRANSPORT_application_init (p->cfg);
611 p->pic = GNUNET_PEERSTORE_iterate (p->ph, 610 p->pic = GNUNET_PEERSTORE_iterate (p->ph,
612 "transport", 611 "transport",
613 &p->id, 612 &p->id,
@@ -654,11 +653,6 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct
654 GNUNET_TRANSPORT_core_disconnect (p->th); 653 GNUNET_TRANSPORT_core_disconnect (p->th);
655 p->th = NULL; 654 p->th = NULL;
656 } 655 }
657 if (NULL != p->ats)
658 {
659 GNUNET_ATS_connectivity_done (p->ats);
660 p->ats = NULL;
661 }
662 if (NULL != p->ah) 656 if (NULL != p->ah)
663 { 657 {
664 GNUNET_TRANSPORT_application_done (p->ah); 658 GNUNET_TRANSPORT_application_done (p->ah);
@@ -794,6 +788,7 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct
794 struct GNUNET_TRANSPORT_TESTING_Handle *tth = p1->tth; 788 struct GNUNET_TRANSPORT_TESTING_Handle *tth = p1->tth;
795 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc; 789 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc;
796 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *ccn; 790 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *ccn;
791 struct GNUNET_BANDWIDTH_Value32NBO bw;
797 792
798 ccn = NULL; 793 ccn = NULL;
799 for (cc = tth->cc_head; NULL != cc; cc = cc->next) 794 for (cc = tth->cc_head; NULL != cc; cc = cc->next)
@@ -825,9 +820,10 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct
825 cc); 820 cc);
826 cc->tct = GNUNET_SCHEDULER_add_now (&offer_hello, 821 cc->tct = GNUNET_SCHEDULER_add_now (&offer_hello,
827 cc); 822 cc);
828 cc->ats_sh = GNUNET_ATS_connectivity_suggest (cc->p1->ats, 823 cc->ah_sh = GNUNET_TRANSPORT_application_suggest (cc->p1->ah,
829 &p2->id, 824 &p2->id,
830 1); 825 GNUNET_MQ_PRIO_BEST_EFFORT,
826 bw);
831 LOG (GNUNET_ERROR_TYPE_DEBUG, 827 LOG (GNUNET_ERROR_TYPE_DEBUG,
832 "New connect request %p\n", 828 "New connect request %p\n",
833 cc); 829 cc);
@@ -849,10 +845,10 @@ GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct
849 GNUNET_SCHEDULER_cancel (cc->tct); 845 GNUNET_SCHEDULER_cancel (cc->tct);
850 cc->tct = NULL; 846 cc->tct = NULL;
851 } 847 }
852 if (NULL != cc->ats_sh) 848 if (NULL != cc->ah_sh)
853 { 849 {
854 GNUNET_ATS_connectivity_suggest_cancel (cc->ats_sh); 850 GNUNET_TRANSPORT_application_suggest_cancel (cc->ah_sh);
855 cc->ats_sh = NULL; 851 cc->ah_sh = NULL;
856 } 852 }
857 GNUNET_CONTAINER_DLL_remove (tth->cc_head, 853 GNUNET_CONTAINER_DLL_remove (tth->cc_head,
858 tth->cc_tail, 854 tth->cc_tail,