aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/plugin_transport_http.c')
-rw-r--r--src/transport/plugin_transport_http.c44
1 files changed, 39 insertions, 5 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c
index bb61b27e4..571b0db49 100644
--- a/src/transport/plugin_transport_http.c
+++ b/src/transport/plugin_transport_http.c
@@ -585,22 +585,25 @@ http_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target,
585 { 585 {
586#if DEBUG_HTTP 586#if DEBUG_HTTP
587 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 587 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
588 "Using outbound client session to send to `%s'\n", 588 "Using outbound client session %p to send to `%s'\n",
589 s,
589 GNUNET_i2s (target)); 590 GNUNET_i2s (target));
590#endif 591#endif
592
591 client_send (s, msg); 593 client_send (s, msg);
592 res = msgbuf_size; 594 res = msgbuf_size;
593 } 595 }
594 if (s->inbound == GNUNET_YES) 596 if (s->inbound == GNUNET_YES)
595 { 597 {
596 server_send (s, msg);
597 res = msgbuf_size;
598#if DEBUG_HTTP 598#if DEBUG_HTTP
599 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 599 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
600 "Using inbound server session to send to `%s'\n", 600 "Using inbound server %p session to send to `%s'\n",
601 s,
601 GNUNET_i2s (target)); 602 GNUNET_i2s (target));
602#endif 603#endif
603 604
605 server_send (s, msg);
606 res = msgbuf_size;
604 } 607 }
605 return res; 608 return res;
606} 609}
@@ -634,6 +637,22 @@ http_plugin_disconnect (void *cls, const struct GNUNET_PeerIdentity *target)
634 else 637 else
635 GNUNET_assert (GNUNET_OK == server_disconnect (s)); 638 GNUNET_assert (GNUNET_OK == server_disconnect (s));
636 GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s); 639 GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s);
640
641 struct HTTP_Message * msg = s->msg_head;
642 struct HTTP_Message * tmp = s->msg_head;
643 while (msg != NULL)
644 {
645 tmp = msg->next;
646
647 GNUNET_CONTAINER_DLL_remove(s->msg_head,s->msg_tail, msg);
648 if (msg->transmit_cont != NULL)
649 {
650 msg->transmit_cont(msg->transmit_cont_cls, target, GNUNET_SYSERR);
651 }
652 GNUNET_free (msg);
653 msg = tmp;
654 }
655
637 delete_session (s); 656 delete_session (s);
638 } 657 }
639 s = next; 658 s = next;
@@ -1387,8 +1406,23 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
1387 while (s != NULL) 1406 while (s != NULL)
1388 { 1407 {
1389 struct Session *t = s->next; 1408 struct Session *t = s->next;
1390
1391 GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s); 1409 GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s);
1410
1411 struct HTTP_Message * msg = s->msg_head;
1412 struct HTTP_Message * tmp = s->msg_head;
1413 while (msg != NULL)
1414 {
1415 tmp = msg->next;
1416
1417 GNUNET_CONTAINER_DLL_remove(s->msg_head,s->msg_tail, msg);
1418 if (msg->transmit_cont != NULL)
1419 {
1420 msg->transmit_cont(msg->transmit_cont_cls, &s->target, GNUNET_SYSERR);
1421 }
1422 GNUNET_free (msg);
1423 msg = tmp;
1424 }
1425
1392 delete_session (s); 1426 delete_session (s);
1393 s = t; 1427 s = t;
1394 } 1428 }