diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-12 18:29:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-12 18:29:57 +0000 |
commit | 73b81b1d9d597e88a999b7bfdde6a6690f64e227 (patch) | |
tree | ef25bddee05012e0e461fe7fba5f2fd9957a6ba6 /src | |
parent | f53f9f3c89077d4d120317503eef4b134cbe8d80 (diff) | |
download | gnunet-73b81b1d9d597e88a999b7bfdde6a6690f64e227.tar.gz gnunet-73b81b1d9d597e88a999b7bfdde6a6690f64e227.zip |
-fix leak, style
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 72562607d..ca6c0febc 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -3037,16 +3037,17 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) | |||
3037 | return NULL; | 3037 | return NULL; |
3038 | } | 3038 | } |
3039 | 3039 | ||
3040 | const char *http_plugin_address_to_string (void *cls, | 3040 | |
3041 | const void *addr, | 3041 | static const char * |
3042 | size_t addrlen) | 3042 | http_plugin_address_to_string (void *cls, |
3043 | const void *addr, | ||
3044 | size_t addrlen) | ||
3043 | { | 3045 | { |
3044 | #if BUILD_HTTPS | 3046 | #if BUILD_HTTPS |
3045 | return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen); | 3047 | return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen); |
3046 | #else | 3048 | #else |
3047 | return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen); | 3049 | return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen); |
3048 | #endif | 3050 | #endif |
3049 | |||
3050 | } | 3051 | } |
3051 | 3052 | ||
3052 | 3053 | ||
@@ -3079,9 +3080,6 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3079 | struct GNUNET_TRANSPORT_PluginFunctions *api; | 3080 | struct GNUNET_TRANSPORT_PluginFunctions *api; |
3080 | struct HTTP_Server_Plugin *plugin; | 3081 | struct HTTP_Server_Plugin *plugin; |
3081 | 3082 | ||
3082 | plugin = GNUNET_new (struct HTTP_Server_Plugin); | ||
3083 | plugin->env = env; | ||
3084 | |||
3085 | if (NULL == env->receive) | 3083 | if (NULL == env->receive) |
3086 | { | 3084 | { |
3087 | /* run in 'stub' mode (i.e. as part of gnunet-peerinfo), don't fully | 3085 | /* run in 'stub' mode (i.e. as part of gnunet-peerinfo), don't fully |
@@ -3093,7 +3091,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3093 | api->address_pretty_printer = &http_common_plugin_address_pretty_printer; | 3091 | api->address_pretty_printer = &http_common_plugin_address_pretty_printer; |
3094 | return api; | 3092 | return api; |
3095 | } | 3093 | } |
3096 | 3094 | plugin = GNUNET_new (struct HTTP_Server_Plugin); | |
3095 | plugin->env = env; | ||
3097 | api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions); | 3096 | api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions); |
3098 | api->cls = plugin; | 3097 | api->cls = plugin; |
3099 | api->send = &http_server_plugin_send; | 3098 | api->send = &http_server_plugin_send; |
@@ -3118,8 +3117,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3118 | /* Configure plugin */ | 3117 | /* Configure plugin */ |
3119 | if (GNUNET_SYSERR == server_configure_plugin (plugin)) | 3118 | if (GNUNET_SYSERR == server_configure_plugin (plugin)) |
3120 | { | 3119 | { |
3121 | LIBGNUNET_PLUGIN_TRANSPORT_DONE (api); | 3120 | LIBGNUNET_PLUGIN_TRANSPORT_DONE (api); |
3122 | return NULL; | 3121 | return NULL; |
3123 | } | 3122 | } |
3124 | 3123 | ||
3125 | /* Check IPv6 support */ | 3124 | /* Check IPv6 support */ |
@@ -3132,8 +3131,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3132 | 3131 | ||
3133 | if (GNUNET_SYSERR == server_start (plugin)) | 3132 | if (GNUNET_SYSERR == server_start (plugin)) |
3134 | { | 3133 | { |
3135 | LIBGNUNET_PLUGIN_TRANSPORT_DONE (api); | 3134 | LIBGNUNET_PLUGIN_TRANSPORT_DONE (api); |
3136 | return NULL; | 3135 | return NULL; |
3137 | } | 3136 | } |
3138 | return api; | 3137 | return api; |
3139 | } | 3138 | } |