diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-26 14:09:44 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-26 14:09:44 +0000 |
commit | d942e62f877b930e633e512e33548c387b97c726 (patch) | |
tree | 1b2ab3b098c3cab75fa3b9ce2740836c30db02b4 /src/transport/plugin_transport_http.c | |
parent | f3dbebee8b087c25aab0cef0a0228845a8954596 (diff) | |
download | gnunet-d942e62f877b930e633e512e33548c387b97c726.tar.gz gnunet-d942e62f877b930e633e512e33548c387b97c726.zip |
implemented session based sending in transport service (coexisting with old code)
Diffstat (limited to 'src/transport/plugin_transport_http.c')
-rw-r--r-- | src/transport/plugin_transport_http.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index f4729811c..fb9376526 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -532,7 +532,7 @@ notify_session_end (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
532 | } | 532 | } |
533 | 533 | ||
534 | /** | 534 | /** |
535 | * Creates a new session the transport service will use to send data to the | 535 | * Creates a new outbound session the transport service will use to send data to the |
536 | * peer | 536 | * peer |
537 | * | 537 | * |
538 | * @param cls the plugin | 538 | * @param cls the plugin |
@@ -579,7 +579,7 @@ http_get_session (void *cls, | |||
579 | s->addrlen = addrlen; | 579 | s->addrlen = addrlen; |
580 | s->next = NULL; | 580 | s->next = NULL; |
581 | s->next_receive = GNUNET_TIME_absolute_get_zero (); | 581 | s->next_receive = GNUNET_TIME_absolute_get_zero (); |
582 | 582 | s->inbound = GNUNET_NO; | |
583 | s->ats_address_network_type = htonl (GNUNET_ATS_NET_UNSPECIFIED); | 583 | s->ats_address_network_type = htonl (GNUNET_ATS_NET_UNSPECIFIED); |
584 | 584 | ||
585 | /* Get ATS type */ | 585 | /* Get ATS type */ |
@@ -616,11 +616,12 @@ http_get_session (void *cls, | |||
616 | /* initiate new connection */ | 616 | /* initiate new connection */ |
617 | if (GNUNET_SYSERR == client_connect (s)) | 617 | if (GNUNET_SYSERR == client_connect (s)) |
618 | { | 618 | { |
619 | if (s != NULL) | 619 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name, |
620 | { | 620 | "Cannot connect to peer `%s' address `%s''\n", |
621 | GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s); | 621 | http_plugin_address_to_string(NULL, s->addr, s->addrlen), |
622 | delete_session (s); | 622 | GNUNET_i2s (&s->target)); |
623 | } | 623 | GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s); |
624 | delete_session (s); | ||
624 | return NULL; | 625 | return NULL; |
625 | } | 626 | } |
626 | 627 | ||
@@ -676,8 +677,8 @@ http_plugin_send (void *cls, | |||
676 | { | 677 | { |
677 | if ((tmp == session) && | 678 | if ((tmp == session) && |
678 | (0 == memcmp (&session->target, &tmp->target, sizeof (struct GNUNET_PeerIdentity))) && | 679 | (0 == memcmp (&session->target, &tmp->target, sizeof (struct GNUNET_PeerIdentity))) && |
679 | (session->addrlen != tmp->addrlen) && | 680 | (session->addrlen == tmp->addrlen) && |
680 | (0 != memcmp (session->addr, tmp->addr, tmp->addrlen))) | 681 | (0 == memcmp (session->addr, tmp->addr, tmp->addrlen))) |
681 | break; | 682 | break; |
682 | tmp = tmp->next; | 683 | tmp = tmp->next; |
683 | } | 684 | } |