[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 02/02: rewrite error handling and subsystem PUT
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 02/02: rewrite error handling and subsystem PUT |
Date: |
Sun, 12 Aug 2018 01:47:08 +0200 |
This is an automated email from the git hooks/post-receive script.
phil pushed a commit to branch master
in repository gnunet.
commit 89485145a0f33984a70bffdf0f766667b4a3e75e
Author: Phil <address@hidden>
AuthorDate: Sun Aug 12 01:46:11 2018 +0200
rewrite error handling and subsystem PUT
---
src/identity/plugin_rest_identity.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/identity/plugin_rest_identity.c
b/src/identity/plugin_rest_identity.c
index 89f6e7f8b..9f1765a63 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -560,6 +560,7 @@ ego_get_pubkey (struct GNUNET_REST_RequestHandle
*con_handle,
if (strlen (GNUNET_REST_API_NS_IDENTITY_PUBKEY) >= strlen (handle->url))
{
+ handle->response_code = MHD_HTTP_NOT_FOUND;
handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_MISSING_PUBKEY);
GNUNET_SCHEDULER_add_now (&do_error, handle);
return;
@@ -598,6 +599,7 @@ ego_get_name (struct GNUNET_REST_RequestHandle *con_handle,
if (strlen (GNUNET_REST_API_NS_IDENTITY_NAME) >= strlen (handle->url))
{
+ handle->response_code = MHD_HTTP_NOT_FOUND;
handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_MISSING_NAME);
GNUNET_SCHEDULER_add_now (&do_error, handle);
return;
@@ -1036,7 +1038,6 @@ ego_delete_pubkey (struct GNUNET_REST_RequestHandle
*con_handle,
{
struct RequestHandle *handle = cls;
struct EgoEntry *ego_entry;
- struct MHD_Response *resp;
char *keystring;
keystring = NULL;
@@ -1053,9 +1054,9 @@ ego_delete_pubkey (struct GNUNET_REST_RequestHandle
*con_handle,
if (NULL == ego_entry)
{
- resp = GNUNET_REST_create_response (NULL);
- handle->proc (handle->proc_cls, resp, MHD_HTTP_NOT_FOUND);
- GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
+ handle->response_code = MHD_HTTP_NOT_FOUND;
+ handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
+ GNUNET_SCHEDULER_add_now (&do_error, handle);
return;
}
@@ -1081,7 +1082,6 @@ ego_delete_name (struct GNUNET_REST_RequestHandle
*con_handle,
{
struct RequestHandle *handle = cls;
struct EgoEntry *ego_entry;
- struct MHD_Response *resp;
char *name;
name = NULL;
@@ -1098,9 +1098,9 @@ ego_delete_name (struct GNUNET_REST_RequestHandle
*con_handle,
if (NULL == ego_entry)
{
- resp = GNUNET_REST_create_response (NULL);
- handle->proc (handle->proc_cls, resp, MHD_HTTP_NOT_FOUND);
- GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);
+ handle->response_code = MHD_HTTP_NOT_FOUND;
+ handle->emsg = GNUNET_strdup(GNUNET_REST_IDENTITY_NOT_FOUND);
+ GNUNET_SCHEDULER_add_now (&do_error, handle);
return;
}
--
To stop receiving notification emails like this one, please contact
address@hidden