gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-donau] branch master updated: [build] comment out some things of


From: gnunet
Subject: [taler-donau] branch master updated: [build] comment out some things of donau-httpd.c in order to build succesfully
Date: Tue, 28 Nov 2023 14:02:27 +0100

This is an automated email from the git hooks/post-receive script.

pius-loosli pushed a commit to branch master
in repository donau.

The following commit(s) were added to refs/heads/master by this push:
     new 28d1c94  [build] comment out some things of donau-httpd.c in order to 
build succesfully
28d1c94 is described below

commit 28d1c94fb2d1bfc2c0c4a59ea1f7e44cbed5141d
Author: Pius Loosli <loosp2@bfh.ch>
AuthorDate: Tue Nov 28 14:01:14 2023 +0100

    [build] comment out some things of donau-httpd.c in order to build 
succesfully
---
 src/donau/donau-httpd.c | 452 ++++++++++++++++++++++++------------------------
 1 file changed, 226 insertions(+), 226 deletions(-)

diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c
index 18b018d..2b3919c 100644
--- a/src/donau/donau-httpd.c
+++ b/src/donau/donau-httpd.c
@@ -313,8 +313,8 @@ handle_mhd_completion_callback (void *cls,
 
   TALER_MHD_parse_post_cleanup_callback (rc->opaque_post_parsing_context);
   /* Sanity-check that we didn't leave any transactions hanging */
-  GNUNET_break (GNUNET_OK ==
-                TEH_plugin->preflight (TEH_plugin->cls));
+  // GNUNET_break (GNUNET_OK ==
+  // TEH_plugin->preflight (TEH_plugin->cls));
   {
     struct GNUNET_TIME_Relative latency;
 
@@ -333,165 +333,165 @@ handle_mhd_completion_callback (void *cls,
 }
 
 
-/**
- * We found a request handler responsible for handling a request. Parse the
- * @a upload_data (if applicable) and the @a url and call the
- * handler.
- *
- * @param rc request context
- * @param url rest of the URL to parse
- * @param upload_data upload data to parse (if available)
- * @param[in,out] upload_data_size number of bytes in @a upload_data
- * @return MHD result code
- */
-static MHD_RESULT
-proceed_with_handler (struct TEH_RequestContext *rc,
-                      const char *url,
-                      const char *upload_data,
-                      size_t *upload_data_size)
-{
-  const struct TEH_RequestHandler *rh = rc->rh;
-  const char *args[rh->nargs + 2];
-  size_t ulen = strlen (url) + 1;
-  json_t *root = NULL;
-  MHD_RESULT ret;
-
-  /* We do check for "ulen" here, because we'll later stack-allocate a buffer
-     of that size and don't want to enable malicious clients to cause us
-     huge stack allocations. */
-  if (ulen > 512)
-  {
-    /* 512 is simply "big enough", as it is bigger than "6 * 54",
-       which is the longest URL format we ever get (for
-       /deposits/).  The value should be adjusted if we ever define protocol
-       endpoints with plausibly longer inputs.  */
-    GNUNET_break_op (0);
-    return TALER_MHD_reply_with_error (rc->connection,
-                                       MHD_HTTP_URI_TOO_LONG,
-                                       TALER_EC_GENERIC_URI_TOO_LONG,
-                                       url);
-  }
-
-  /* All POST endpoints come with a body in JSON format. So we parse
-     the JSON here. */
-  if (0 == strcasecmp (rh->method,
-                       MHD_HTTP_METHOD_POST))
-  {
-    enum GNUNET_GenericReturnValue res;
-
-    res = TALER_MHD_parse_post_json (rc->connection,
-                                     &rc->opaque_post_parsing_context,
-                                     upload_data,
-                                     upload_data_size,
-                                     &root);
-    if (GNUNET_SYSERR == res)
-    {
-      GNUNET_assert (NULL == root);
-      return MHD_NO; /* bad upload, could not even generate error */
-    }
-    if ( (GNUNET_NO == res) ||
-         (NULL == root) )
-    {
-      GNUNET_assert (NULL == root);
-      return MHD_YES; /* so far incomplete upload or parser error */
-    }
-  }
-
-  {
-    char d[ulen];
-    unsigned int i;
-    char *sp;
-
-    /* Parse command-line arguments */
-    /* make a copy of 'url' because 'strtok_r()' will modify */
-    GNUNET_memcpy (d,
-                   url,
-                   ulen);
-    i = 0;
-    args[i++] = strtok_r (d, "/", &sp);
-    while ( (NULL != args[i - 1]) &&
-            (i <= rh->nargs + 1) )
-      args[i++] = strtok_r (NULL, "/", &sp);
-    /* make sure above loop ran nicely until completion, and also
-       that there is no excess data in 'd' afterwards */
-    if ( ( (rh->nargs_is_upper_bound) &&
-           (i - 1 > rh->nargs) ) ||
-         ( (! rh->nargs_is_upper_bound) &&
-           (i - 1 != rh->nargs) ) )
-    {
-      char emsg[128 + 512];
-
-      GNUNET_snprintf (emsg,
-                       sizeof (emsg),
-                       "Got %u+/%u segments for `%s' request (`%s')",
-                       i - 1,
-                       rh->nargs,
-                       rh->url,
-                       url);
-      GNUNET_break_op (0);
-      json_decref (root);
-      return TALER_MHD_reply_with_error (rc->connection,
-                                         MHD_HTTP_NOT_FOUND,
-                                         
TALER_EC_DONAU_GENERIC_WRONG_NUMBER_OF_SEGMENTS,
-                                         emsg);
-    }
-    GNUNET_assert (NULL == args[i - 1]);
-
-    /* Above logic ensures that 'root' is exactly non-NULL for POST operations,
-       so we test for 'root' to decide which handler to invoke. */
-    if (0 == strcasecmp (rh->method,
-                         MHD_HTTP_METHOD_POST))
-      ret = rh->handler.post (rc,
-                              root,
-                              args);
-    else if (0 == strcasecmp (rh->method,
-                              MHD_HTTP_METHOD_DELETE))
-      ret = rh->handler.delete (rc,
-                                args);
-    else /* Only GET left */
-      ret = rh->handler.get (rc,
-                             args);
-  }
-  json_decref (root);
-  return ret;
-}
-
-
-/**
- * Handle a "/seed" request.
- *
- * @param rc request context
- * @param args array of additional options (must be empty for this function)
- * @return MHD result code
- */
-static MHD_RESULT
-handler_seed (struct TEH_RequestContext *rc,
-              const char *const args[])
-{
-#define SEED_SIZE 32
-  char *body;
-  MHD_RESULT ret;
-  struct MHD_Response *resp;
-
-  (void) args;
-  body = malloc (SEED_SIZE); /* must use malloc(), because MHD will use free() 
*/
-  if (NULL == body)
-    return MHD_NO;
-  GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
-                              body,
-                              SEED_SIZE);
-  resp = MHD_create_response_from_buffer (SEED_SIZE,
-                                          body,
-                                          MHD_RESPMEM_MUST_FREE);
-  TALER_MHD_add_global_headers (resp);
-  ret = MHD_queue_response (rc->connection,
-                            MHD_HTTP_OK,
-                            resp);
-  GNUNET_break (MHD_YES == ret);
-  MHD_destroy_response (resp);
-  return ret;
-#undef SEED_SIZE
-}
+// /**
+//  * We found a request handler responsible for handling a request. Parse the
+//  * @a upload_data (if applicable) and the @a url and call the
+//  * handler.
+//  *
+//  * @param rc request context
+//  * @param url rest of the URL to parse
+//  * @param upload_data upload data to parse (if available)
+//  * @param[in,out] upload_data_size number of bytes in @a upload_data
+//  * @return MHD result code
+//  */
+// static MHD_RESULT
+// proceed_with_handler (struct TEH_RequestContext *rc,
+//                       const char *url,
+//                       const char *upload_data,
+//                       size_t *upload_data_size)
+// {
+//   const struct TEH_RequestHandler *rh = rc->rh;
+//   const char *args[rh->nargs + 2];
+//   size_t ulen = strlen (url) + 1;
+//   json_t *root = NULL;
+//   MHD_RESULT ret;
+
+//   /* We do check for "ulen" here, because we'll later stack-allocate a 
buffer
+//      of that size and don't want to enable malicious clients to cause us
+//      huge stack allocations. */
+//   if (ulen > 512)
+//   {
+//     /* 512 is simply "big enough", as it is bigger than "6 * 54",
+//        which is the longest URL format we ever get (for
+//        /deposits/).  The value should be adjusted if we ever define protocol
+//        endpoints with plausibly longer inputs.  */
+//     GNUNET_break_op (0);
+//     return TALER_MHD_reply_with_error (rc->connection,
+//                                        MHD_HTTP_URI_TOO_LONG,
+//                                        TALER_EC_GENERIC_URI_TOO_LONG,
+//                                        url);
+//   }
+
+//   /* All POST endpoints come with a body in JSON format. So we parse
+//      the JSON here. */
+//   if (0 == strcasecmp (rh->method,
+//                        MHD_HTTP_METHOD_POST))
+//   {
+//     enum GNUNET_GenericReturnValue res;
+
+//     res = TALER_MHD_parse_post_json (rc->connection,
+//                                      &rc->opaque_post_parsing_context,
+//                                      upload_data,
+//                                      upload_data_size,
+//                                      &root);
+//     if (GNUNET_SYSERR == res)
+//     {
+//       GNUNET_assert (NULL == root);
+//       return MHD_NO; /* bad upload, could not even generate error */
+//     }
+//     if ( (GNUNET_NO == res) ||
+//          (NULL == root) )
+//     {
+//       GNUNET_assert (NULL == root);
+//       return MHD_YES; /* so far incomplete upload or parser error */
+//     }
+//   }
+
+//   {
+//     char d[ulen];
+//     unsigned int i;
+//     char *sp;
+
+//     /* Parse command-line arguments */
+//     /* make a copy of 'url' because 'strtok_r()' will modify */
+//     GNUNET_memcpy (d,
+//                    url,
+//                    ulen);
+//     i = 0;
+//     args[i++] = strtok_r (d, "/", &sp);
+//     while ( (NULL != args[i - 1]) &&
+//             (i <= rh->nargs + 1) )
+//       args[i++] = strtok_r (NULL, "/", &sp);
+//     /* make sure above loop ran nicely until completion, and also
+//        that there is no excess data in 'd' afterwards */
+//     if ( ( (rh->nargs_is_upper_bound) &&
+//            (i - 1 > rh->nargs) ) ||
+//          ( (! rh->nargs_is_upper_bound) &&
+//            (i - 1 != rh->nargs) ) )
+//     {
+//       char emsg[128 + 512];
+
+//       GNUNET_snprintf (emsg,
+//                        sizeof (emsg),
+//                        "Got %u+/%u segments for `%s' request (`%s')",
+//                        i - 1,
+//                        rh->nargs,
+//                        rh->url,
+//                        url);
+//       GNUNET_break_op (0);
+//       json_decref (root);
+//       return TALER_MHD_reply_with_error (rc->connection,
+//                                          MHD_HTTP_NOT_FOUND,
+//                                          
TALER_EC_DONAU_GENERIC_WRONG_NUMBER_OF_SEGMENTS,
+//                                          emsg);
+//     }
+//     GNUNET_assert (NULL == args[i - 1]);
+
+//     /* Above logic ensures that 'root' is exactly non-NULL for POST 
operations,
+//        so we test for 'root' to decide which handler to invoke. */
+//     if (0 == strcasecmp (rh->method,
+//                          MHD_HTTP_METHOD_POST))
+//       ret = rh->handler.post (rc,
+//                               root,
+//                               args);
+//     else if (0 == strcasecmp (rh->method,
+//                               MHD_HTTP_METHOD_DELETE))
+//       ret = rh->handler.delete (rc,
+//                                 args);
+//     else /* Only GET left */
+//       ret = rh->handler.get (rc,
+//                              args);
+//   }
+//   json_decref (root);
+//   return ret;
+// }
+
+
+// /**
+//  * Handle a "/seed" request.
+//  *
+//  * @param rc request context
+//  * @param args array of additional options (must be empty for this function)
+//  * @return MHD result code
+//  */
+// static MHD_RESULT
+// handler_seed (struct TEH_RequestContext *rc,
+//               const char *const args[])
+// {
+// #define SEED_SIZE 32
+//   char *body;
+//   MHD_RESULT ret;
+//   struct MHD_Response *resp;
+
+//   (void) args;
+//   body = malloc (SEED_SIZE); /* must use malloc(), because MHD will use 
free() */
+//   if (NULL == body)
+//     return MHD_NO;
+//   GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
+//                               body,
+//                               SEED_SIZE);
+//   resp = MHD_create_response_from_buffer (SEED_SIZE,
+//                                           body,
+//                                           MHD_RESPMEM_MUST_FREE);
+//   TALER_MHD_add_global_headers (resp);
+//   ret = MHD_queue_response (rc->connection,
+//                             MHD_HTTP_OK,
+//                             resp);
+//   GNUNET_break (MHD_YES == ret);
+//   MHD_destroy_response (resp);
+//   return ret;
+// #undef SEED_SIZE
+// }
 
 
 /**
@@ -519,75 +519,75 @@ handle_mhd_request (void *cls,
 {
   static struct TEH_RequestHandler handlers[] = {
     /* /robots.txt: disallow everything */
-    {
-      .url = "robots.txt",
-      .method = MHD_HTTP_METHOD_GET,
-      .handler.get = &TEH_handler_static_response,
-      .mime_type = "text/plain",
-      .data = "User-agent: *\nDisallow: /\n",
-      .response_code = MHD_HTTP_OK
-    },
+    // {
+    //   .url = "robots.txt",
+    //   .method = MHD_HTTP_METHOD_GET,
+    //   .handler.get = &TEH_handler_static_response,
+    //   .mime_type = "text/plain",
+    //   .data = "User-agent: *\nDisallow: /\n",
+    //   .response_code = MHD_HTTP_OK
+    // },
     /* Landing page, tell humans to go away. */
-    {
-      .url = "",
-      .method = MHD_HTTP_METHOD_GET,
-      .handler.get = TEH_handler_static_response,
-      .mime_type = "text/plain",
-      .data =
-        "Hello, I'm the Taler donau. This HTTP server is not for humans.\n",
-      .response_code = MHD_HTTP_OK
-    },
+    // {
+    //   .url = "",
+    //   .method = MHD_HTTP_METHOD_GET,
+    //   .handler.get = TEH_handler_static_response,
+    //   .mime_type = "text/plain",
+    //   .data =
+    //     "Hello, I'm the Taler donau. This HTTP server is not for humans.\n",
+    //   .response_code = MHD_HTTP_OK
+    // },
     /* AGPL licensing page, redirect to source. As per the AGPL-license, every
        deployment is required to offer the user a download of the source of
        the actual deployment. We make this easy by including a redirect to the
        source here. */
-    {
-      .url = "agpl",
-      .method = MHD_HTTP_METHOD_GET,
-      .handler.get = &TEH_handler_agpl_redirect
-    },
-    {
-      .url = "seed",
-      .method = MHD_HTTP_METHOD_GET,
-      .handler.get = &handler_seed
-    },
+    // {
+    //   .url = "agpl",
+    //   .method = MHD_HTTP_METHOD_GET,
+    //   .handler.get = &TEH_handler_agpl_redirect
+    // },
+    // {
+    //   .url = "seed",
+    //   .method = MHD_HTTP_METHOD_GET,
+    //   .handler.get = &handler_seed
+    // },
     /* Configuration */
-    {
-      .url = "config",
-      .method = MHD_HTTP_METHOD_GET,
-      .handler.get = &TEH_handler_config
-    },
+    // {
+    //   .url = "config",
+    //   .method = MHD_HTTP_METHOD_GET,
+    //   .handler.get = &TEH_handler_config
+    // },
     /* Performance metrics */
-    {
-      .url = "metrics",
-      .method = MHD_HTTP_METHOD_GET,
-      .handler.get = &TEH_handler_metrics
-    },
+    // {
+    //   .url = "metrics",
+    //   .method = MHD_HTTP_METHOD_GET,
+    //   .handler.get = &TEH_handler_metrics
+    // },
     /* Terms of service */
-    {
-      .url = "terms",
-      .method = MHD_HTTP_METHOD_GET,
-      .handler.get = &TEH_handler_terms
-    },
+    // {
+    //   .url = "terms",
+    //   .method = MHD_HTTP_METHOD_GET,
+    //   .handler.get = &TEH_handler_terms
+    // },
     /* Privacy policy */
-    {
-      .url = "privacy",
-      .method = MHD_HTTP_METHOD_GET,
-      .handler.get = &TEH_handler_privacy
-    },
+    // {
+    //   .url = "privacy",
+    //   .method = MHD_HTTP_METHOD_GET,
+    //   .handler.get = &TEH_handler_privacy
+    // },
     /* Return key material and fundamental properties for this donau */
-    {
-      .url = "keys",
-      .method = MHD_HTTP_METHOD_GET,
-      .handler.get = &TEH_keys_get_handler,
-    },
+    // {
+    //   .url = "keys",
+    //   .method = MHD_HTTP_METHOD_GET,
+    //   .handler.get = &TEH_keys_get_handler,
+    // },
     /* request R, used in clause schnorr withdraw and refresh */
-    {
-      .url = "csr-melt",
-      .method = MHD_HTTP_METHOD_POST,
-      .handler.post = &TEH_handler_csr_melt,
-      .nargs = 0
-    },
+    // {
+    //   .url = "csr-melt",
+    //   .method = MHD_HTTP_METHOD_POST,
+    //   .handler.post = &TEH_handler_csr_melt,
+    //   .nargs = 0
+    // },
 
 
     /* mark end of list */
@@ -1349,13 +1349,13 @@ run (void *cls,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  if (GNUNET_SYSERR ==
-      TEH_plugin->preflight (TEH_plugin->cls))
-  {
-    global_ret = EXIT_FAILURE;
-    GNUNET_SCHEDULER_shutdown ();
-    return;
-  }
+  // if (GNUNET_SYSERR ==
+  //     TEH_plugin->preflight (TEH_plugin->cls))
+  // {
+  //   global_ret = EXIT_FAILURE;
+  //   GNUNET_SCHEDULER_shutdown ();
+  //   return;
+  // }
   if (GNUNET_OK !=
       TEH_extensions_init ())
   {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]