aboutsummaryrefslogtreecommitdiff
path: root/src/rest/plugin_rest_copying.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rest/plugin_rest_copying.c')
-rw-r--r--src/rest/plugin_rest_copying.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/rest/plugin_rest_copying.c b/src/rest/plugin_rest_copying.c
index e601e505e..1649da3bb 100644
--- a/src/rest/plugin_rest_copying.c
+++ b/src/rest/plugin_rest_copying.c
@@ -82,24 +82,6 @@ cleanup_handle (struct RequestHandle *handle)
82 82
83 83
84/** 84/**
85 * Task run on shutdown. Cleans up everything.
86 *
87 * @param cls unused
88 * @param tc scheduler context
89 */
90static void
91do_error (void *cls)
92{
93 struct RequestHandle *handle = cls;
94 struct MHD_Response *resp;
95
96 resp = GNUNET_REST_create_response (NULL);
97 handle->proc (handle->proc_cls, resp, handle->response_code);
98 cleanup_handle (handle);
99}
100
101
102/**
103 * Handle rest request 85 * Handle rest request
104 * 86 *
105 * @param handle the lookup handle 87 * @param handle the lookup handle
@@ -155,7 +137,7 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle,
155 * @param proc_cls closure for @a proc 137 * @param proc_cls closure for @a proc
156 * @return #GNUNET_OK if request accepted 138 * @return #GNUNET_OK if request accepted
157 */ 139 */
158static void 140static enum GNUNET_GenericReturnValue
159rest_copying_process_request (struct GNUNET_REST_RequestHandle *conndata_handle, 141rest_copying_process_request (struct GNUNET_REST_RequestHandle *conndata_handle,
160 GNUNET_REST_ResultProcessor proc, 142 GNUNET_REST_ResultProcessor proc,
161 void *proc_cls) 143 void *proc_cls)
@@ -172,14 +154,10 @@ rest_copying_process_request (struct GNUNET_REST_RequestHandle *conndata_handle,
172 handle->proc = proc; 154 handle->proc = proc;
173 handle->rest_handle = conndata_handle; 155 handle->rest_handle = conndata_handle;
174 156
175 if (GNUNET_NO == GNUNET_REST_handle_request (conndata_handle, 157 return GNUNET_REST_handle_request (conndata_handle,
176 handlers, 158 handlers,
177 &err, 159 &err,
178 handle)) 160 handle);
179 {
180 handle->response_code = err.error_code;
181 GNUNET_SCHEDULER_add_now (&do_error, handle);
182 }
183} 161}
184 162
185 163