diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-09-09 11:04:40 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-09-09 11:04:40 +0000 |
commit | c74fc426bdc67c3a5a3d334b00048a570ea7965d (patch) | |
tree | 12db08cd525f525b7af646c270a47bf1951bec4a /src/transport/plugin_transport_http.c | |
parent | 0abd0fef03ae0868a5172b361df5bfa7aeae3724 (diff) | |
download | gnunet-c74fc426bdc67c3a5a3d334b00048a570ea7965d.tar.gz gnunet-c74fc426bdc67c3a5a3d334b00048a570ea7965d.zip |
HTTPS testcases pass
Diffstat (limited to 'src/transport/plugin_transport_http.c')
-rw-r--r-- | src/transport/plugin_transport_http.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index 26d0e5fdf..cdbc900f5 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -42,10 +42,12 @@ | |||
42 | 42 | ||
43 | #if BUILD_HTTPS | 43 | #if BUILD_HTTPS |
44 | #define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_https_init | 44 | #define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_https_init |
45 | #define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_plugin_transport_https_done | ||
45 | #define LIBGNUNET_PLUGIN_TRANSPORT_COMPONENT transport_https | 46 | #define LIBGNUNET_PLUGIN_TRANSPORT_COMPONENT transport_https |
46 | #define PROTOCOL_PREFIX "https" | 47 | #define PROTOCOL_PREFIX "https" |
47 | #else | 48 | #else |
48 | #define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_http_init | 49 | #define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_http_init |
50 | #define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_plugin_transport_http_done | ||
49 | #define LIBGNUNET_PLUGIN_TRANSPORT_COMPONENT transport_http | 51 | #define LIBGNUNET_PLUGIN_TRANSPORT_COMPONENT transport_http |
50 | #define PROTOCOL_PREFIX "http" | 52 | #define PROTOCOL_PREFIX "http" |
51 | #endif | 53 | #endif |
@@ -661,12 +663,12 @@ process_interfaces (void *cls, | |||
661 | { | 663 | { |
662 | if (0 == memcmp(&plugin->bind4_address->sin_addr, &bnd_cmp, sizeof (struct in_addr))) | 664 | if (0 == memcmp(&plugin->bind4_address->sin_addr, &bnd_cmp, sizeof (struct in_addr))) |
663 | { | 665 | { |
664 | plugin->env->notify_address(plugin->env->cls,"http",t4, sizeof (struct IPv4HttpAddress), GNUNET_TIME_UNIT_FOREVER_REL); | 666 | plugin->env->notify_address(plugin->env->cls,PROTOCOL_PREFIX,t4, sizeof (struct IPv4HttpAddress), GNUNET_TIME_UNIT_FOREVER_REL); |
665 | } | 667 | } |
666 | } | 668 | } |
667 | else | 669 | else |
668 | { | 670 | { |
669 | plugin->env->notify_address(plugin->env->cls,"http",t4, sizeof (struct IPv4HttpAddress), GNUNET_TIME_UNIT_FOREVER_REL); | 671 | plugin->env->notify_address(plugin->env->cls,PROTOCOL_PREFIX,t4, sizeof (struct IPv4HttpAddress), GNUNET_TIME_UNIT_FOREVER_REL); |
670 | } | 672 | } |
671 | GNUNET_free (t4); | 673 | GNUNET_free (t4); |
672 | } | 674 | } |
@@ -687,7 +689,7 @@ process_interfaces (void *cls, | |||
687 | &((struct sockaddr_in6 *) addr)->sin6_addr, | 689 | &((struct sockaddr_in6 *) addr)->sin6_addr, |
688 | sizeof (struct in6_addr)); | 690 | sizeof (struct in6_addr)); |
689 | t6->u6_port = htons (plugin->port_inbound); | 691 | t6->u6_port = htons (plugin->port_inbound); |
690 | plugin->env->notify_address(plugin->env->cls,"http",t6,sizeof (struct IPv6HttpAddress) , GNUNET_TIME_UNIT_FOREVER_REL); | 692 | plugin->env->notify_address(plugin->env->cls,PROTOCOL_PREFIX,t6,sizeof (struct IPv6HttpAddress) , GNUNET_TIME_UNIT_FOREVER_REL); |
691 | } | 693 | } |
692 | } | 694 | } |
693 | else | 695 | else |
@@ -696,7 +698,7 @@ process_interfaces (void *cls, | |||
696 | &((struct sockaddr_in6 *) addr)->sin6_addr, | 698 | &((struct sockaddr_in6 *) addr)->sin6_addr, |
697 | sizeof (struct in6_addr)); | 699 | sizeof (struct in6_addr)); |
698 | t6->u6_port = htons (plugin->port_inbound); | 700 | t6->u6_port = htons (plugin->port_inbound); |
699 | plugin->env->notify_address(plugin->env->cls,"http",t6,sizeof (struct IPv6HttpAddress) , GNUNET_TIME_UNIT_FOREVER_REL); | 701 | plugin->env->notify_address(plugin->env->cls,PROTOCOL_PREFIX,t6,sizeof (struct IPv6HttpAddress) , GNUNET_TIME_UNIT_FOREVER_REL); |
700 | } | 702 | } |
701 | GNUNET_free (t6); | 703 | GNUNET_free (t6); |
702 | } | 704 | } |
@@ -2412,7 +2414,7 @@ http_plugin_address_to_string (void *cls, | |||
2412 | * Exit point from the plugin. | 2414 | * Exit point from the plugin. |
2413 | */ | 2415 | */ |
2414 | void * | 2416 | void * |
2415 | libgnunet_plugin_transport_http_done (void *cls) | 2417 | LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) |
2416 | { | 2418 | { |
2417 | struct GNUNET_TRANSPORT_PluginFunctions *api = cls; | 2419 | struct GNUNET_TRANSPORT_PluginFunctions *api = cls; |
2418 | struct Plugin *plugin = api->cls; | 2420 | struct Plugin *plugin = api->cls; |
@@ -2586,7 +2588,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
2586 | _("Require valid port number for transport plugin `%s' in configuration!\n"), | 2588 | _("Require valid port number for transport plugin `%s' in configuration!\n"), |
2587 | PROTOCOL_PREFIX); | 2589 | PROTOCOL_PREFIX); |
2588 | GNUNET_free(component_name); | 2590 | GNUNET_free(component_name); |
2589 | libgnunet_plugin_transport_http_done (api); | 2591 | LIBGNUNET_PLUGIN_TRANSPORT_DONE (api); |
2590 | return NULL; | 2592 | return NULL; |
2591 | } | 2593 | } |
2592 | 2594 | ||
@@ -2704,7 +2706,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
2704 | GNUNET_free (cert_file); | 2706 | GNUNET_free (cert_file); |
2705 | GNUNET_free (component_name); | 2707 | GNUNET_free (component_name); |
2706 | 2708 | ||
2707 | libgnunet_plugin_transport_http_done(api); | 2709 | LIBGNUNET_PLUGIN_TRANSPORT_DONE(api); |
2708 | GNUNET_free (cmd); | 2710 | GNUNET_free (cmd); |
2709 | return NULL; | 2711 | return NULL; |
2710 | } | 2712 | } |
@@ -2724,7 +2726,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
2724 | GNUNET_free (cert_file); | 2726 | GNUNET_free (cert_file); |
2725 | GNUNET_free (component_name); | 2727 | GNUNET_free (component_name); |
2726 | 2728 | ||
2727 | libgnunet_plugin_transport_http_done(api); | 2729 | LIBGNUNET_PLUGIN_TRANSPORT_DONE(api); |
2728 | return NULL; | 2730 | return NULL; |
2729 | } | 2731 | } |
2730 | } | 2732 | } |
@@ -2834,7 +2836,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
2834 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR,"HTTP Server with %s could not be started on port %u! %s plugin failed!\n",tmp, port, PROTOCOL_PREFIX); | 2836 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR,"HTTP Server with %s could not be started on port %u! %s plugin failed!\n",tmp, port, PROTOCOL_PREFIX); |
2835 | GNUNET_free (tmp); | 2837 | GNUNET_free (tmp); |
2836 | GNUNET_free (component_name); | 2838 | GNUNET_free (component_name); |
2837 | libgnunet_plugin_transport_http_done (api); | 2839 | LIBGNUNET_PLUGIN_TRANSPORT_DONE (api); |
2838 | return NULL; | 2840 | return NULL; |
2839 | } | 2841 | } |
2840 | 2842 | ||
@@ -2849,7 +2851,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
2849 | _("Could not initialize curl multi handle, failed to start %s plugin!\n"), | 2851 | _("Could not initialize curl multi handle, failed to start %s plugin!\n"), |
2850 | PROTOCOL_PREFIX); | 2852 | PROTOCOL_PREFIX); |
2851 | GNUNET_free(component_name); | 2853 | GNUNET_free(component_name); |
2852 | libgnunet_plugin_transport_http_done (api); | 2854 | LIBGNUNET_PLUGIN_TRANSPORT_DONE (api); |
2853 | return NULL; | 2855 | return NULL; |
2854 | } | 2856 | } |
2855 | 2857 | ||