[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: ERROR: ...undefined reference t
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: ERROR: ...undefined reference to 'ANASTASIS_get_config' |
Date: |
Tue, 19 May 2020 17:01:31 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 3dbeb64 ERROR: ...undefined reference to 'ANASTASIS_get_config'
3dbeb64 is described below
commit 3dbeb64b31f6f1070f7c6a94a841482c3129208c
Author: Dennis Neufeld <address@hidden>
AuthorDate: Tue May 19 15:01:20 2020 +0000
ERROR: ...undefined reference to 'ANASTASIS_get_config'
---
src/cli/anastasis-cli-splitter.c | 157 +++++++++++++++++++--------------------
src/include/anastasis_service.h | 1 -
src/lib/anastasis_api_config.c | 8 +-
3 files changed, 80 insertions(+), 86 deletions(-)
diff --git a/src/cli/anastasis-cli-splitter.c b/src/cli/anastasis-cli-splitter.c
index 1140a74..39301d3 100644
--- a/src/cli/anastasis-cli-splitter.c
+++ b/src/cli/anastasis-cli-splitter.c
@@ -25,7 +25,6 @@
#include <readline/readline.h>
#include <readline/history.h>
#include <taler/taler_util.h>
-#include "anastasis_service.h"
#include "anastasis.h"
/**
@@ -150,11 +149,6 @@ struct TruthUploadState
*/
struct SaltState
{
- /**
- * URL of the anastasis backend.
- */
- const char *anastasis_url;
-
/**
* Expected status code.
*/
@@ -169,6 +163,11 @@ struct SaltState
* The salt value from server.
*/
struct ANASTASIS_CRYPTO_SaltP salt;
+
+ /**
+ * Reference to a TruthUploadState.
+ */
+ struct TruthUploadState *tus;
};
/**
@@ -176,11 +175,6 @@ struct SaltState
*/
struct ConfigState
{
- /**
- * URL of the anastasis backend.
- */
- const char *anastasis_url;
-
/**
* Expected status code.
*/
@@ -191,6 +185,11 @@ struct ConfigState
*/
struct ANASTASIS_ConfigOperation *co;
+ /**
+ * Reference to a TruthUploadState.
+ */
+ struct TruthUploadState *tus;
+
/**
* Cost.
*/
@@ -237,43 +236,7 @@ static struct TruthUploadState *tu_states;
/**
* Amount of truth upload states
*/
-static unsigned int tu_states_length;
-
-
-/**
- * Function called with the results of a #ANASTASIS_salt().
- *
- * @param cls closure
- * @param http_status HTTP status of the request
- * @param salt salt from the server
- */
-static void
-salt_cb (void *cls,
- unsigned int http_status,
- const struct ANASTASIS_CRYPTO_SaltP *salt)
-{
- struct SaltState *ss = cls;
-
- ss->so = NULL;
- if (http_status != ss->http_status)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u in %s:%u\n",
- http_status,
- __FILE__,
- __LINE__);
- return;
- }
- if (NULL == salt)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Salt is NULL in %s:%u\n",
- __FILE__,
- __LINE__);
- return;
- }
- ss->salt = *salt;
-}
+static unsigned int tu_states_length = 0;
/**
@@ -300,6 +263,8 @@ config_cb (void *cls,
http_status,
__FILE__,
__LINE__);
+ printf ("Server #%u is not available!\n",
+ tu_states_length);
return;
}
if (NULL == cost)
@@ -320,6 +285,65 @@ config_cb (void *cls,
}
cs->cost = *cost;
cs->methods = methods;
+ printf ("Server #%u is available\n",
+ tu_states_length);
+
+ cs->tus->backend_methods = cs->methods;
+ cs->tus->backend_cost = &cs->cost;
+ // FIXME add config max insurance amount
+
+ GNUNET_array_append (tu_states,
+ tu_states_length,
+ *cs->tus);
+}
+
+
+/**
+ * Function called with the results of a #ANASTASIS_salt().
+ *
+ * @param cls closure
+ * @param http_status HTTP status of the request
+ * @param salt salt from the server
+ */
+static void
+salt_cb (void *cls,
+ unsigned int http_status,
+ const struct ANASTASIS_CRYPTO_SaltP *salt)
+{
+ struct SaltState *ss = cls;
+ struct ConfigState *cs = GNUNET_new (struct ConfigState);
+
+ ss->so = NULL;
+ if (http_status != ss->http_status)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unexpected response code %u in %s:%u\n",
+ http_status,
+ __FILE__,
+ __LINE__);
+ printf ("Server #%u is not available!\n",
+ tu_states_length);
+ return;
+ }
+ ss->salt = *salt;
+ ss->tus->backend_salt = &ss->salt;
+
+ cs->tus = ss->tus;
+ cs->http_status = MHD_HTTP_OK;
+ cs->co = ANASTASIS_get_config (ctx,
+ cs->tus->backend_url,
+ config_cb,
+ cs);
+ // FIXME: DELETE THIS, WHEN ABOVE IS FIXED_
+ // cs->methods = "question"; // FIXME
+ // TALER_string_to_amount ("EUR:3.99",
+ // &cs->cost);
+
+ if (NULL == cs->co)
+ {
+ GNUNET_break (0);
+ return;
+ }
}
@@ -424,19 +448,17 @@ read_keyboard_command (void *cls)
// FIXME "server add" logic here
struct TruthUploadState tus;
struct SaltState *ss;
- struct ConfigState *cs;
size_t url_len = characters - strlen ("server add ");
-
ss = GNUNET_new (struct SaltState);
- cs = GNUNET_new (struct ConfigState);
+
char *url = &buffer[strlen ("server add ")];
tus.backend_url = GNUNET_malloc (url_len);
strncpy (tus.backend_url,
url,
url_len);
- ss->anastasis_url = tus.backend_url;
ss->http_status = MHD_HTTP_OK;
+ ss->tus = &tus;
ss->so = ANASTASIS_salt (ctx,
tus.backend_url,
salt_cb,
@@ -446,33 +468,6 @@ read_keyboard_command (void *cls)
GNUNET_break (0);
return;
}
- tus.backend_salt = &ss->salt;
-
- cs->anastasis_url = tus.backend_url;
- cs->http_status = MHD_HTTP_OK;
- /* FIXME: undefined reference to ANASTASIS_get_config
- cs->co = ANASTASIS_get_config (ctx,
- tus.backend_url,
- config_cb,
- cs); */
- // FIXME: DELETE THIS, WHEN ABOVE IS FIXED_
- cs->methods = "question"; // FIXME
- TALER_string_to_amount ("EUR:3.99",
- &cs->cost);
- /* FIXME: Uncomment this when aboce is fixed
- if (NULL == cs->co)
- {
- GNUNET_break (0);
- return;
- }*/
-
- tus.backend_methods = cs->methods;
- tus.backend_cost = &cs->cost;
- // FIXME add config max insurance amount
-
- GNUNET_array_append (tu_states,
- tu_states_length,
- tus);
start_read_keyboard ();
GNUNET_free (buffer);
buffer = NULL;
@@ -705,8 +700,6 @@ start_read_keyboard ()
return;
}
-
-
printf ("'x' to quit\n");
printf ("'o' to show options\n");
printf ("Waiting for keyboard input\n");
@@ -789,10 +782,12 @@ main (int argc,
/* the available command line options */
struct GNUNET_GETOPT_CommandLineOption options[] = {
+ // FIXME json is not an int...
GNUNET_GETOPT_option_flag ('m',
"me",
"import json file containing details to create
user identifier",
&import_id),
+ // FIXME recovery document also is not a int...
GNUNET_GETOPT_option_flag ('i',
"import",
"import json file containing a recovery
document",
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 64ce9f6..7b46e8a 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -245,7 +245,6 @@ struct ANASTASIS_UploadDetails
const char *payment_request;
} details;
-
};
diff --git a/src/lib/anastasis_api_config.c b/src/lib/anastasis_api_config.c
index aefcd45..e9433fd 100644
--- a/src/lib/anastasis_api_config.c
+++ b/src/lib/anastasis_api_config.c
@@ -115,10 +115,10 @@ handle_config_finished (void *cls,
struct ANASTASIS_ConfigOperation *
-ANASTASIS_config (struct GNUNET_CURL_Context *ctx,
- const char *base_url,
- ANASTASIS_ConfigCallback cb,
- void *cb_cls)
+ANASTASIS_get_config (struct GNUNET_CURL_Context *ctx,
+ const char *base_url,
+ ANASTASIS_ConfigCallback cb,
+ void *cb_cls)
{
struct ANASTASIS_ConfigOperation *co;
CURL *eh;
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: ERROR: ...undefined reference to 'ANASTASIS_get_config',
gnunet <=