diff options
Diffstat (limited to 'src/transport/plugin_transport_http.c')
-rw-r--r-- | src/transport/plugin_transport_http.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index a6c9190bd..502e26597 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -513,6 +513,7 @@ http_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | |||
513 | struct Plugin *plugin = cls; | 513 | struct Plugin *plugin = cls; |
514 | struct HTTP_Message *msg; | 514 | struct HTTP_Message *msg; |
515 | struct Session *s; | 515 | struct Session *s; |
516 | |||
516 | GNUNET_assert (plugin != NULL); | 517 | GNUNET_assert (plugin != NULL); |
517 | 518 | ||
518 | int res = GNUNET_SYSERR; | 519 | int res = GNUNET_SYSERR; |
@@ -563,17 +564,20 @@ http_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | |||
563 | GNUNET_i2s (target)); | 564 | GNUNET_i2s (target)); |
564 | #endif | 565 | #endif |
565 | int res = GNUNET_OK; | 566 | int res = GNUNET_OK; |
567 | |||
566 | if (addrlen == sizeof (struct IPv4HttpAddress)) | 568 | if (addrlen == sizeof (struct IPv4HttpAddress)) |
567 | { | 569 | { |
568 | struct IPv4HttpAddress * a4 = (struct IPv4HttpAddress *) addr; | 570 | struct IPv4HttpAddress *a4 = (struct IPv4HttpAddress *) addr; |
569 | if ((ntohs(a4->u4_port) == 0) || (plugin->ipv4 == GNUNET_NO)) | 571 | |
570 | res = GNUNET_SYSERR; | 572 | if ((ntohs (a4->u4_port) == 0) || (plugin->ipv4 == GNUNET_NO)) |
573 | res = GNUNET_SYSERR; | ||
571 | } | 574 | } |
572 | if (addrlen == sizeof (struct IPv6HttpAddress)) | 575 | if (addrlen == sizeof (struct IPv6HttpAddress)) |
573 | { | 576 | { |
574 | struct IPv6HttpAddress * a6 = (struct IPv6HttpAddress *) addr; | 577 | struct IPv6HttpAddress *a6 = (struct IPv6HttpAddress *) addr; |
575 | if ((ntohs(a6->u6_port) == 0) || (plugin->ipv6 == GNUNET_NO)) | 578 | |
576 | res = GNUNET_SYSERR; | 579 | if ((ntohs (a6->u6_port) == 0) || (plugin->ipv6 == GNUNET_NO)) |
580 | res = GNUNET_SYSERR; | ||
577 | } | 581 | } |
578 | if (res == GNUNET_OK) | 582 | if (res == GNUNET_OK) |
579 | { | 583 | { |
@@ -606,8 +610,7 @@ http_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | |||
606 | { | 610 | { |
607 | #if DEBUG_HTTP | 611 | #if DEBUG_HTTP |
608 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 612 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
609 | "Using outbound client session %p to send to `%s'\n", | 613 | "Using outbound client session %p to send to `%s'\n", s, |
610 | s, | ||
611 | GNUNET_i2s (target)); | 614 | GNUNET_i2s (target)); |
612 | #endif | 615 | #endif |
613 | 616 | ||
@@ -618,8 +621,7 @@ http_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | |||
618 | { | 621 | { |
619 | #if DEBUG_HTTP | 622 | #if DEBUG_HTTP |
620 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 623 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
621 | "Using inbound server %p session to send to `%s'\n", | 624 | "Using inbound server %p session to send to `%s'\n", s, |
622 | s, | ||
623 | GNUNET_i2s (target)); | 625 | GNUNET_i2s (target)); |
624 | #endif | 626 | #endif |
625 | 627 | ||
@@ -659,16 +661,17 @@ http_plugin_disconnect (void *cls, const struct GNUNET_PeerIdentity *target) | |||
659 | GNUNET_assert (GNUNET_OK == server_disconnect (s)); | 661 | GNUNET_assert (GNUNET_OK == server_disconnect (s)); |
660 | GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s); | 662 | GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s); |
661 | 663 | ||
662 | struct HTTP_Message * msg = s->msg_head; | 664 | struct HTTP_Message *msg = s->msg_head; |
663 | struct HTTP_Message * tmp = s->msg_head; | 665 | struct HTTP_Message *tmp = s->msg_head; |
666 | |||
664 | while (msg != NULL) | 667 | while (msg != NULL) |
665 | { | 668 | { |
666 | tmp = msg->next; | 669 | tmp = msg->next; |
667 | 670 | ||
668 | GNUNET_CONTAINER_DLL_remove(s->msg_head,s->msg_tail, msg); | 671 | GNUNET_CONTAINER_DLL_remove (s->msg_head, s->msg_tail, msg); |
669 | if (msg->transmit_cont != NULL) | 672 | if (msg->transmit_cont != NULL) |
670 | { | 673 | { |
671 | msg->transmit_cont(msg->transmit_cont_cls, target, GNUNET_SYSERR); | 674 | msg->transmit_cont (msg->transmit_cont_cls, target, GNUNET_SYSERR); |
672 | } | 675 | } |
673 | GNUNET_free (msg); | 676 | GNUNET_free (msg); |
674 | msg = tmp; | 677 | msg = tmp; |
@@ -1427,18 +1430,20 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) | |||
1427 | while (s != NULL) | 1430 | while (s != NULL) |
1428 | { | 1431 | { |
1429 | struct Session *t = s->next; | 1432 | struct Session *t = s->next; |
1433 | |||
1430 | GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s); | 1434 | GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s); |
1431 | 1435 | ||
1432 | struct HTTP_Message * msg = s->msg_head; | 1436 | struct HTTP_Message *msg = s->msg_head; |
1433 | struct HTTP_Message * tmp = s->msg_head; | 1437 | struct HTTP_Message *tmp = s->msg_head; |
1438 | |||
1434 | while (msg != NULL) | 1439 | while (msg != NULL) |
1435 | { | 1440 | { |
1436 | tmp = msg->next; | 1441 | tmp = msg->next; |
1437 | 1442 | ||
1438 | GNUNET_CONTAINER_DLL_remove(s->msg_head,s->msg_tail, msg); | 1443 | GNUNET_CONTAINER_DLL_remove (s->msg_head, s->msg_tail, msg); |
1439 | if (msg->transmit_cont != NULL) | 1444 | if (msg->transmit_cont != NULL) |
1440 | { | 1445 | { |
1441 | msg->transmit_cont(msg->transmit_cont_cls, &s->target, GNUNET_SYSERR); | 1446 | msg->transmit_cont (msg->transmit_cont_cls, &s->target, GNUNET_SYSERR); |
1442 | } | 1447 | } |
1443 | GNUNET_free (msg); | 1448 | GNUNET_free (msg); |
1444 | msg = tmp; | 1449 | msg = tmp; |