aboutsummaryrefslogtreecommitdiff
path: root/src/rest
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
committerChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
commit7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch)
treebdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/rest
parent01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff)
downloadgnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.tar.gz
gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.zip
tighten formatting rules
Diffstat (limited to 'src/rest')
-rw-r--r--src/rest/gnunet-rest-server.c6
-rw-r--r--src/rest/plugin_rest_config.c6
-rw-r--r--src/rest/plugin_rest_copying.c2
-rw-r--r--src/rest/rest.c3
4 files changed, 16 insertions, 1 deletions
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c
index 2456ad50c..02a2c6daf 100644
--- a/src/rest/gnunet-rest-server.c
+++ b/src/rest/gnunet-rest-server.c
@@ -185,6 +185,7 @@ run_mhd_now ()
185 httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, NULL); 185 httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, NULL);
186} 186}
187 187
188
188/** 189/**
189 * Plugin result callback 190 * Plugin result callback
190 * 191 *
@@ -242,6 +243,7 @@ cleanup_handle (struct MhdConnectionHandle *handle)
242 GNUNET_free (handle); 243 GNUNET_free (handle);
243} 244}
244 245
246
245static int 247static int
246header_iterator (void *cls, 248header_iterator (void *cls,
247 enum MHD_ValueKind kind, 249 enum MHD_ValueKind kind,
@@ -299,6 +301,7 @@ url_iterator (void *cls,
299 return MHD_YES; 301 return MHD_YES;
300} 302}
301 303
304
302static int 305static int
303post_data_iter (void *cls, 306post_data_iter (void *cls,
304 enum MHD_ValueKind kind, 307 enum MHD_ValueKind kind,
@@ -334,6 +337,7 @@ post_data_iter (void *cls,
334 return MHD_YES; 337 return MHD_YES;
335} 338}
336 339
340
337/* ********************************* MHD response generation ******************* */ 341/* ********************************* MHD response generation ******************* */
338 342
339/** 343/**
@@ -641,6 +645,7 @@ schedule_httpd ()
641 GNUNET_NETWORK_fdset_destroy (wws); 645 GNUNET_NETWORK_fdset_destroy (wws);
642} 646}
643 647
648
644/** 649/**
645 * Task run whenever HTTP server operations are pending. 650 * Task run whenever HTTP server operations are pending.
646 * 651 *
@@ -1050,4 +1055,5 @@ main (int argc, char *const *argv)
1050 return ret; 1055 return ret;
1051} 1056}
1052 1057
1058
1053/* end of gnunet-rest-server.c */ 1059/* end of gnunet-rest-server.c */
diff --git a/src/rest/plugin_rest_config.c b/src/rest/plugin_rest_config.c
index 16f5d2ec1..d89c858ee 100644
--- a/src/rest/plugin_rest_config.c
+++ b/src/rest/plugin_rest_config.c
@@ -124,6 +124,7 @@ add_sections (void *cls,
124 json_object_set_new (sections_obj, section, sec_obj); 124 json_object_set_new (sections_obj, section, sec_obj);
125} 125}
126 126
127
127static void 128static void
128add_section_contents (void *cls, 129add_section_contents (void *cls,
129 const char *section, 130 const char *section,
@@ -135,6 +136,7 @@ add_section_contents (void *cls,
135 json_object_set_new (section_obj, option, json_string (value)); 136 json_object_set_new (section_obj, option, json_string (value));
136} 137}
137 138
139
138/** 140/**
139 * Handle rest request 141 * Handle rest request
140 * 142 *
@@ -179,6 +181,7 @@ get_cont (struct GNUNET_REST_RequestHandle *con_handle,
179 json_decref (result); 181 json_decref (result);
180} 182}
181 183
184
182struct GNUNET_CONFIGURATION_Handle * 185struct GNUNET_CONFIGURATION_Handle *
183set_value (struct GNUNET_CONFIGURATION_Handle *config, 186set_value (struct GNUNET_CONFIGURATION_Handle *config,
184 const char *section, 187 const char *section,
@@ -202,6 +205,7 @@ set_value (struct GNUNET_CONFIGURATION_Handle *config,
202 return config; // for error handling (0 -> success, 1 -> error) 205 return config; // for error handling (0 -> success, 1 -> error)
203} 206}
204 207
208
205/** 209/**
206 * Handle REST POST request 210 * Handle REST POST request
207 * 211 *
@@ -308,6 +312,7 @@ set_cont (struct GNUNET_REST_RequestHandle *con_handle,
308 cleanup_handle (handle); 312 cleanup_handle (handle);
309} 313}
310 314
315
311/** 316/**
312 * Handle rest request 317 * Handle rest request
313 * 318 *
@@ -416,4 +421,5 @@ libgnunet_plugin_rest_config_done (void *cls)
416 return NULL; 421 return NULL;
417} 422}
418 423
424
419/* end of plugin_rest_config.c */ 425/* end of plugin_rest_config.c */
diff --git a/src/rest/plugin_rest_copying.c b/src/rest/plugin_rest_copying.c
index eabe96c63..e601e505e 100644
--- a/src/rest/plugin_rest_copying.c
+++ b/src/rest/plugin_rest_copying.c
@@ -120,7 +120,6 @@ get_cont (struct GNUNET_REST_RequestHandle *con_handle,
120} 120}
121 121
122 122
123
124/** 123/**
125 * Handle rest request 124 * Handle rest request
126 * 125 *
@@ -231,4 +230,5 @@ libgnunet_plugin_rest_copying_done (void *cls)
231 return NULL; 230 return NULL;
232} 231}
233 232
233
234/* end of plugin_rest_copying.c */ 234/* end of plugin_rest_copying.c */
diff --git a/src/rest/rest.c b/src/rest/rest.c
index b83530ee1..0dfd44ce7 100644
--- a/src/rest/rest.c
+++ b/src/rest/rest.c
@@ -46,6 +46,7 @@ GNUNET_REST_namespace_match (const char *url, const char *namespace)
46 return 0 == strncmp (namespace, url, strlen (namespace)); 46 return 0 == strncmp (namespace, url, strlen (namespace));
47} 47}
48 48
49
49/** 50/**
50 * Create MHD response 51 * Create MHD response
51 * 52 *
@@ -71,6 +72,7 @@ GNUNET_REST_create_response (const char *data)
71 return resp; 72 return resp;
72} 73}
73 74
75
74int 76int
75GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn, 77GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn,
76 const struct GNUNET_REST_RequestHandler *handlers, 78 const struct GNUNET_REST_RequestHandler *handlers,
@@ -106,4 +108,5 @@ GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn,
106 return GNUNET_NO; 108 return GNUNET_NO;
107} 109}
108 110
111
109/* end of rest.c */ 112/* end of rest.c */