aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-07-14 13:00:33 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-07-14 13:00:33 +0000
commit3a5640894fe5b5a2a36daedf6048da6728346651 (patch)
treef43ab626de1c6c1ddbde78185fa47d2908a73537
parentbb3c07258c44f436fd748212fd4595cae7853a2b (diff)
downloadgnunet-3a5640894fe5b5a2a36daedf6048da6728346651.tar.gz
gnunet-3a5640894fe5b5a2a36daedf6048da6728346651.zip
-rw-r--r--src/transport/plugin_transport_http.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c
index 0c48acc8f..ce4cd469e 100644
--- a/src/transport/plugin_transport_http.c
+++ b/src/transport/plugin_transport_http.c
@@ -516,8 +516,8 @@ static void mhd_write_mst_cb (void *cls,
516 pc->plugin->env->receive (ps->peercontext->plugin->env->cls, 516 pc->plugin->env->receive (ps->peercontext->plugin->env->cls,
517 &pc->identity, 517 &pc->identity,
518 message, 1, ps, 518 message, 1, ps,
519 ps->addr, 519 NULL,
520 ps->addrlen); 520 0);
521} 521}
522 522
523static void curl_receive_mst_cb (void *cls, 523static void curl_receive_mst_cb (void *cls,
@@ -530,7 +530,8 @@ static void curl_receive_mst_cb (void *cls,
530 GNUNET_assert(pc != NULL); 530 GNUNET_assert(pc != NULL);
531 531
532 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 532 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
533 "Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n", 533 "Connection %X: Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n",
534 ps,
534 ntohs(message->type), 535 ntohs(message->type),
535 ntohs(message->size), 536 ntohs(message->size),
536 GNUNET_i2s(&(pc->identity)),http_plugin_address_to_string(NULL,ps->addr,ps->addrlen)); 537 GNUNET_i2s(&(pc->identity)),http_plugin_address_to_string(NULL,ps->addr,ps->addrlen));
@@ -564,7 +565,6 @@ int mhd_send_callback (void *cls, uint64_t pos, char *buf, int max)
564 struct Session * ps = cls; 565 struct Session * ps = cls;
565 struct HTTP_PeerContext * pc; 566 struct HTTP_PeerContext * pc;
566 struct HTTP_Message * msg; 567 struct HTTP_Message * msg;
567 int res;res=5;
568 568
569 GNUNET_assert (ps!=NULL); 569 GNUNET_assert (ps!=NULL);
570 pc = ps->peercontext; 570 pc = ps->peercontext;
@@ -596,7 +596,7 @@ int mhd_send_callback (void *cls, uint64_t pos, char *buf, int max)
596 { 596 {
597 if (NULL!=msg->transmit_cont) 597 if (NULL!=msg->transmit_cont)
598 msg->transmit_cont (msg->transmit_cont_cls,&pc->identity,GNUNET_OK); 598 msg->transmit_cont (msg->transmit_cont_cls,&pc->identity,GNUNET_OK);
599 res = remove_http_message(ps,msg); 599 remove_http_message(ps,msg);
600 } 600 }
601 } 601 }
602 return bytes_read; 602 return bytes_read;
@@ -890,6 +890,12 @@ http_server_daemon_prepare (void * cls, struct MHD_Daemon *daemon_handle)
890 GNUNET_NETWORK_fdset_copy_native (wes, &es, max); 890 GNUNET_NETWORK_fdset_copy_native (wes, &es, max);
891 if (daemon_handle == plugin->http_server_daemon_v4) 891 if (daemon_handle == plugin->http_server_daemon_v4)
892 { 892 {
893 if (plugin->http_server_task_v4 != GNUNET_SCHEDULER_NO_TASK)
894 {
895 GNUNET_SCHEDULER_cancel(plugin->env->sched, plugin->http_server_task_v4);
896 plugin->http_server_daemon_v4 = GNUNET_SCHEDULER_NO_TASK;
897 }
898
893 ret = GNUNET_SCHEDULER_add_select (plugin->env->sched, 899 ret = GNUNET_SCHEDULER_add_select (plugin->env->sched,
894 GNUNET_SCHEDULER_PRIORITY_DEFAULT, 900 GNUNET_SCHEDULER_PRIORITY_DEFAULT,
895 GNUNET_SCHEDULER_NO_TASK, 901 GNUNET_SCHEDULER_NO_TASK,
@@ -901,6 +907,12 @@ http_server_daemon_prepare (void * cls, struct MHD_Daemon *daemon_handle)
901 } 907 }
902 if (daemon_handle == plugin->http_server_daemon_v6) 908 if (daemon_handle == plugin->http_server_daemon_v6)
903 { 909 {
910 if (plugin->http_server_task_v6 != GNUNET_SCHEDULER_NO_TASK)
911 {
912 GNUNET_SCHEDULER_cancel(plugin->env->sched, plugin->http_server_task_v6);
913 plugin->http_server_task_v6 = GNUNET_SCHEDULER_NO_TASK;
914 }
915
904 ret = GNUNET_SCHEDULER_add_select (plugin->env->sched, 916 ret = GNUNET_SCHEDULER_add_select (plugin->env->sched,
905 GNUNET_SCHEDULER_PRIORITY_DEFAULT, 917 GNUNET_SCHEDULER_PRIORITY_DEFAULT,
906 GNUNET_SCHEDULER_NO_TASK, 918 GNUNET_SCHEDULER_NO_TASK,
@@ -2011,6 +2023,7 @@ process_interfaces (void *cls,
2011 t6->u6_port = htons (plugin->port_inbound); 2023 t6->u6_port = htons (plugin->port_inbound);
2012 plugin->env->notify_address(plugin->env->cls,"http",t6,sizeof (struct IPv6HttpAddress) , GNUNET_TIME_UNIT_FOREVER_REL); 2024 plugin->env->notify_address(plugin->env->cls,"http",t6,sizeof (struct IPv6HttpAddress) , GNUNET_TIME_UNIT_FOREVER_REL);
2013 } 2025 }
2026 return GNUNET_NO;
2014 return GNUNET_OK; 2027 return GNUNET_OK;
2015} 2028}
2016 2029